/*
    cavitcakir.github.io — 2026 rebuild
    One accent, two themes, zero jQuery.
*/

/* ---------- tokens ---------- */
:root {
    --bg: #fbfaf8;
    --bg-alt: #f2f0ec;
    --surface: #ffffff;
    --line: #e2ded7;
    --line-strong: #cdc7bd;
    --text: #17191c;
    --muted: #5f6873;
    --faint: #8b94a0;
    --accent: #0d8f80;
    --accent-soft: rgba(13, 143, 128, 0.1);
    --accent-text: #0a6f63;
    --warn: #b4620a;
    --shadow: 0 1px 2px rgba(20, 24, 30, 0.05), 0 8px 24px -12px rgba(20, 24, 30, 0.18);
    --shadow-lg: 0 2px 4px rgba(20, 24, 30, 0.06), 0 20px 48px -20px rgba(20, 24, 30, 0.28);
    --radius: 14px;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --nav-h: 64px;
}

:root[data-theme="dark"] {
    --bg: #0c0f13;
    --bg-alt: #11151b;
    --surface: #141920;
    --line: #232a33;
    --line-strong: #333c48;
    --text: #e8edf3;
    --muted: #9aa5b2;
    --faint: #6e7a88;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --accent-text: #5eead4;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 56px -24px rgba(0, 0, 0, 0.85);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; }

a {
    color: var(--accent-text);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--text); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.mono { font-family: var(--mono); }

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    z-index: 200;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease, background 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.brand span { color: var(--accent-text); }

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin-left: auto;
}
.nav-links a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--muted);
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }

#theme-toggle .moon { display: none; }
:root[data-theme="dark"] #theme-toggle .moon { display: block; }
:root[data-theme="dark"] #theme-toggle .sun { display: none; }

#nav-toggle { display: none; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 550;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
    color: var(--text);
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #04120f;
}
.btn-primary:hover { color: #04120f; filter: brightness(1.06); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- hero ---------- */
.hero {
    padding: clamp(48px, 9vw, 104px) 0 clamp(56px, 8vw, 96px);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -220px;
    left: 50%;
    width: 900px;
    height: 520px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
    pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-inner { max-width: 760px; }

.hero h1 {
    font-size: clamp(2.8rem, 7.5vw, 4.4rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    margin-bottom: 14px;
}

.tagline {
    font-family: var(--mono);
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    color: var(--accent-text);
    min-height: 1.8em;
    margin-bottom: 20px;
}
.caret {
    display: inline-block;
    width: 9px;
    height: 1.05em;
    background: var(--accent);
    vertical-align: -0.18em;
    margin-left: 2px;
    animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 62ch;
    margin-bottom: 30px;
}
.hero-lede strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 96px) 0; scroll-margin-top: var(--nav-h); }
.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sec-head { margin-bottom: clamp(28px, 4vw, 44px); }
.sec-num {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent-text);
    display: block;
    margin-bottom: 8px;
}
.sec-head h2 {
    font-size: clamp(1.7rem, 3.6vw, 2.2rem);
    letter-spacing: -0.035em;
}
.sec-head p {
    color: var(--muted);
    margin-top: 10px;
    max-width: 60ch;
}

/* ---------- about ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 52px);
    align-items: start;
}
.about-grid > div > p { color: var(--muted); }
.about-grid strong { color: var(--text); font-weight: 600; }

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card h3 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h3::before {
    content: "//";
    font-family: var(--mono);
    color: var(--accent-text);
    font-weight: 500;
}

.glance { margin: 0; }
.glance dt {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 2px;
}
.glance dd {
    margin: 0 0 14px;
    font-size: 0.92rem;
    color: var(--text);
}
.glance dd:last-child { margin-bottom: 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--line) 22%, var(--line));
}

.job { position: relative; padding-bottom: 40px; }
.job:last-child { padding-bottom: 0; }
.job::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 9px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--line-strong);
}
.job.now::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}
.alt .job::before { background: var(--bg-alt); }
.alt .job.now::before { background: var(--accent); }

.job-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 4px;
}
.job-head h3 { font-size: 1.1rem; }
.job-date {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--faint);
    margin-left: auto;
    white-space: nowrap;
}
.job-co {
    font-size: 0.92rem;
    color: var(--accent-text);
    font-weight: 550;
    margin-bottom: 12px;
}
.job-co em {
    font-style: normal;
    color: var(--faint);
    font-weight: 400;
}
.job-prev {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0 0 14px;
    padding-left: 14px;
    border-left: 2px solid var(--line);
}
.job-prev h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
}
.job-prev .job-date { margin-left: auto; }

.bullets { list-style: none; }
.bullets li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 0.94rem;
}
.bullets li:last-child { margin-bottom: 0; }
.bullets li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.72em;
    width: 6px;
    height: 1px;
    background: var(--line-strong);
}
.bullets strong { color: var(--text); font-weight: 600; }

/* ---------- projects ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}
.filter {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter[aria-pressed="true"] {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.proj {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 22px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.proj:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-lg);
}
.proj[hidden] { display: none; }
.proj h3 { font-size: 1.02rem; margin-bottom: 8px; }
.proj-meta {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--faint);
    margin-bottom: 14px;
}
.proj .bullets { margin-bottom: 16px; }
.proj .bullets li { font-size: 0.88rem; }
.proj-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}
.chip {
    font-family: var(--mono);
    font-size: 0.71rem;
    color: var(--muted);
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 8px;
}
.proj-link {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 550;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.proj-link svg { width: 13px; height: 13px; }
.proj:hover .proj-link svg { transform: translate(2px, -2px); }
.proj-link svg { transition: transform 0.2s ease; }

/* ---------- education ---------- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.edu h3 { font-size: 1.05rem; margin-bottom: 2px; }
.edu h3::before { content: none; }
.edu .job-date { margin: 0 0 10px; display: block; }
.edu h4 {
    font-size: 0.92rem;
    font-weight: 550;
    color: var(--accent-text);
    margin-bottom: 12px;
}

/* ---------- skills ---------- */
.skill-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}
.sk h3 {
    font-size: 0.82rem;
    font-family: var(--mono);
    font-weight: 550;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.sk h3::before { content: none; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.pills li {
    font-size: 0.85rem;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--text);
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.pills li:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    transform: translateY(-2px);
}

/* ---------- contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(28px, 4vw, 52px);
    align-items: start;
}
.contact-list { list-style: none; margin-top: 22px; }
.contact-list li { margin-bottom: 12px; }
.contact-list a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 0.88rem;
    color: var(--muted);
}
.contact-list a:hover { color: var(--accent-text); }
.contact-list svg { width: 16px; height: 16px; flex: none; }

form { display: grid; gap: 12px; }
label {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
}
input, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.94rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 132px; resize: vertical; }
form button { justify-content: center; }
.form-note {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--faint);
    text-align: center;
}

/* ---------- footer ---------- */
footer {
    border-top: 1px solid var(--line);
    padding: 32px 0;
    background: var(--bg);
}
footer .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}
footer p {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--faint);
}
.socials { display: flex; gap: 6px; list-style: none; }
.socials a {
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
    color: var(--muted);
}
.socials a:hover { color: var(--accent-text); background: var(--bg-alt); }
.socials svg { width: 18px; height: 18px; }

/* ---------- reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
    #nav-toggle { display: inline-flex; }
    .nav-links {
        position: fixed;
        inset: var(--nav-h) 0 auto;
        flex-direction: column;
        gap: 2px;
        margin: 0;
        padding: 12px 24px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 8px; font-size: 1rem; }
    .nav .desk-only { display: none; }
    .job-date { margin-left: 0; width: 100%; }
    footer .wrap { justify-content: center; text-align: center; }
}

@media (max-width: 420px) {
    .projects { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

@media print {
    .nav, .hero-actions, .filters, #contact, footer .socials { display: none; }
    body { background: #fff; color: #000; }
}
