/* =========================================================================
   Saimcan Sesigür — personal CV site
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ---------- Tokens ---------- */

:root {
    color-scheme: light dark;

    --bg: #fafaf9;
    --bg-sub: #f5f5f4;
    --fg: #18181b;
    --fg-mut: #52525b;
    --fg-sub: #a1a1aa;
    --border: #e7e5e4;
    --accent: #0d9488;

    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --max-main: 46rem;
    --sidebar-w: 22rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --bg-sub: #171717;
        --fg: #fafafa;
        --fg-mut: #a1a1aa;
        --fg-sub: #71717a;
        --border: #262626;
        --accent: #5eead4;
    }
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p { margin: 0 0 1rem; }

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--fg-sub);
    text-underline-offset: 3px;
    transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

img { max-width: 100%; display: block; }

.skip-link {
    position: absolute;
    left: -9999px;
    padding: .5rem 1rem;
    background: var(--fg);
    color: var(--bg);
    text-decoration: none;
    z-index: 100;
    border-radius: 4px;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Layout ---------- */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 3rem 2.5rem 2rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.avatar {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--border);
}

.name {
    font-size: 1.625rem;
    letter-spacing: -0.035em;
    margin-bottom: 0.125rem;
}

.sub-title {
    color: var(--fg-mut);
    font-size: 0.9375rem;
    margin: 0;
}

.location {
    color: var(--fg-sub);
    font-size: 0.8125rem;
    margin: 1.25rem 0 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.location::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.sb-contact {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sb-contact a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--fg-mut);
    transition: color .15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sb-contact a:hover { color: var(--accent); }
.sb-contact svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    stroke-width: 1.5;
}

/* Sidebar nav */

.section-nav { margin-top: auto; }

.section-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-nav a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    text-decoration: none;
    color: var(--fg-sub);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    transition: color .25s ease;
}
.section-nav a::before {
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1px;
    margin-right: 0.875rem;
    background: currentColor;
    transition: width .25s ease, background .25s ease;
}
.section-nav a:hover { color: var(--fg); }
.section-nav a.is-active { color: var(--fg); }
.section-nav a.is-active::before {
    width: 2.5rem;
    background: var(--accent);
}

/* ---------- Main ---------- */

main {
    padding: 3.5rem 3rem 6rem;
    max-width: var(--max-main);
    width: 100%;
}

section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}
section:first-of-type {
    border-top: none;
    padding-top: 0.5rem;
}

.sect-label {
    display: block;
    color: var(--fg-sub);
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.sect-title {
    font-size: 2.25rem;
    margin-bottom: 1.75rem;
}

.subsect-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fg-mut);
    margin: 2.5rem 0 1rem;
}
.subsect-title:first-of-type { margin-top: 0; }

/* Intro */

.intro {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--fg);
}
.intro p { margin-bottom: 1rem; }
.intro p:last-child { margin-bottom: 0; }

/* Role (experience + education) */

.role {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 2rem;
    padding: 1.75rem 0;
    border-bottom: 1px dashed var(--border);
}
.role:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.role:first-of-type { padding-top: 0.5rem; }

.role-date {
    color: var(--fg-sub);
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    padding-top: 0.375rem;
}

.role-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.015em;
}

.role-org {
    font-size: 0.9375rem;
    color: var(--fg-mut);
    margin: 0 0 0.375rem;
}

.role-loc {
    font-size: 0.8125rem;
    color: var(--fg-sub);
    margin: 0 0 0.875rem;
}

.role ul {
    padding: 0;
    margin: 0;
    list-style: none;
}
.role li {
    position: relative;
    padding-left: 1.125rem;
    margin-bottom: 0.375rem;
    color: var(--fg-mut);
    font-size: 0.9375rem;
    line-height: 1.55;
}
.role li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.625rem;
    width: 0.5rem;
    height: 1px;
    background: var(--fg-sub);
}

/* Skills */

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.skills li {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--fg-mut);
    background: var(--bg-sub);
    transition: color .15s, border-color .15s;
}
.skills li:hover {
    color: var(--fg);
    border-color: var(--accent);
}

.personal-skills {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    color: var(--fg-mut);
}
.personal-skills li {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Certificates */

.certs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.875rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.cert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-sub);
    transition: border-color .15s;
}
.cert:hover { border-color: var(--accent); }
.cert img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    flex-shrink: 0;
}
.cert-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.125rem;
    letter-spacing: -0.01em;
}
.cert-issuer {
    font-size: 0.8125rem;
    color: var(--fg-sub);
    margin: 0;
}

/* Interests */

.interests {
    display: grid;
    gap: 1.5rem;
}
.interest-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
}
.interest-desc {
    margin: 0;
    color: var(--fg-mut);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Contact */

.contact-grid {
    display: grid;
    gap: 1.25rem;
    margin: 0;
}
.contact-item {
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border);
}
.contact-item:last-child { border-bottom: none; padding-bottom: 0; }
.contact-item dt {
    color: var(--fg-sub);
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.375rem;
    font-weight: 500;
}
.contact-item dd {
    margin: 0;
    font-size: 1rem;
}

.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--fg-sub);
    font-size: 0.8125rem;
}
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .layout {
        display: block;
        max-width: 720px;
    }
    .sidebar {
        position: static;
        height: auto;
        padding: 2rem 1.5rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    main {
        padding: 2.5rem 1.5rem 4rem;
        max-width: none;
    }
    .section-nav { display: none; }
    .role {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1.5rem 0;
    }
    .role-date { padding-top: 0; }
    .personal-skills { gap: 1rem 1.5rem; }
    .sect-title { font-size: 1.875rem; }
}

@media (max-width: 480px) {
    .sect-title { font-size: 1.625rem; }
    .name { font-size: 1.375rem; }
    .sb-contact a { font-size: 0.8125rem; }
}

/* ---------- Print ---------- */

@media print {
    :root {
        color-scheme: light;
        --bg: #fff;
        --fg: #000;
        --fg-mut: #333;
        --fg-sub: #666;
        --border: #ccc;
    }
    body { font-size: 10.5pt; }
    .layout { display: block; max-width: none; }
    .sidebar {
        position: static;
        height: auto;
        padding: 0 0 1rem;
        border: none;
        border-bottom: 1px solid var(--border);
        margin-bottom: 1rem;
    }
    main { padding: 0; max-width: none; }
    .section-nav, .skip-link, .sb-contact { display: none; }
    section {
        page-break-inside: avoid;
        padding: 1rem 0;
        border-top-width: 0.5px;
    }
    .role {
        page-break-inside: avoid;
        grid-template-columns: 8rem 1fr;
        gap: 1rem;
        padding: 0.75rem 0;
    }
    a { color: #000; text-decoration: underline; }
    .sect-title { font-size: 16pt; }
    .role-title { font-size: 11.5pt; }
    .cert, .skills li { background: #fff; }
}
