/* =========================================================
   Farwa Ramzan — portfolio
   Themes: [data-theme="dark"] (default) and [data-theme="light"]
   ========================================================= */

:root,
:root[data-theme="dark"] {
    --bg: #0b0b0d;
    --bg-alt: #0f0f12;
    --surface: #141418;
    --surface-2: #1a1a1f;
    --field: #0b0b0d;
    --line: #23232a;
    --line-strong: #31313a;
    --grid-line: #1d1d23;

    --text: #f0f0f3;
    --text-soft: #cfcfd6;
    --muted: #a0a0ab;
    --dim: #73737e;

    --accent: #f0728f;
    --accent-soft: rgba(240, 114, 143, 0.12);
    --accent-line: rgba(240, 114, 143, 0.38);
    --glow: rgba(139, 30, 63, 0.3);
    --glow-soft: rgba(139, 30, 63, 0.16);

    --pass: #5ed39a;
    --pass-soft: rgba(94, 211, 154, 0.12);
    --pass-line: rgba(94, 211, 154, 0.28);

    --btn-bg: #f0f0f3;
    --btn-text: #0b0b0d;
    --btn-hover: #ffffff;
    --header-bg: rgba(11, 11, 13, 0.8);
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
    --on-accent: #1a0a10;

    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f8f7f4;
    --bg-alt: #f1efea;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --field: #fbfaf8;
    --line: #e6e2da;
    --line-strong: #d6d1c7;
    --grid-line: #e9e5dd;

    --text: #16151a;
    --text-soft: #33323a;
    --muted: #5c5a64;
    --dim: #85828c;

    --accent: #b0234f;
    --accent-soft: rgba(176, 35, 79, 0.08);
    --accent-line: rgba(176, 35, 79, 0.3);
    --glow: rgba(176, 35, 79, 0.12);
    --glow-soft: rgba(176, 35, 79, 0.07);

    --pass: #137a4f;
    --pass-soft: rgba(19, 122, 79, 0.08);
    --pass-line: rgba(19, 122, 79, 0.25);

    --btn-bg: #16151a;
    --btn-text: #f8f7f4;
    --btn-hover: #000000;
    --header-bg: rgba(248, 247, 244, 0.82);
    --shadow: 0 30px 70px -36px rgba(40, 30, 20, 0.28);
    --on-accent: #ffffff;

    color-scheme: light;
}

:root {
    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --radius: 14px;
    --radius-sm: 9px;
    --container: 1120px;
    --header-h: 68px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Smooth colour change when switching themes (only while switching) */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, fill 0.35s ease !important;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* Scroll progress */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    height: 2px;
    width: 100%;
    background: var(--accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: 500 15.5px/1 var(--font-sans);
    letter-spacing: -0.005em;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease),
        color 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s;
}
.btn .icon { width: 17px; height: 17px; transition: transform 0.25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn[download]:hover .icon { transform: translateY(2px); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-hover); }

.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; gap: 8px; }
.btn-sm .icon { width: 15px; height: 15px; }

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}
.site-header.scrolled {
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--line);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--accent-line);
    transition: transform 0.4s var(--ease), box-shadow 0.3s;
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent-line); }
.brand-dot { color: var(--accent); }

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
.nav-link {
    position: relative;
    padding: 8px 11px;
    font-size: 14px;
    color: var(--muted);
    border-radius: 8px;
    transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active { color: var(--text); }
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 2px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--accent);
}
.nav-cv { margin-left: 10px; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle,
.nav-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    color: var(--text-soft);
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); background: var(--surface); }
.theme-toggle .icon {
    position: absolute;
    width: 18px;
    height: 18px;
    transition: transform 0.45s var(--ease), opacity 0.3s;
}
/* Show the icon of the theme you'll switch TO */
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
[data-theme="light"] .icon-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }

.nav-toggle { display: none; }
.nav-toggle span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span:first-child { top: 15px; }
.nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(100svh, 900px);
    padding: calc(var(--header-h) + 64px) 0 80px;
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    width: 680px;
    height: 680px;
    right: -180px;
    top: -140px;
    background: radial-gradient(circle, var(--glow), transparent 65%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-soft);
    letter-spacing: 0.01em;
    margin-bottom: 26px;
}
.eyebrow-slash { color: var(--accent); margin-right: 4px; }

.hero-title {
    font-size: clamp(2.6rem, 5vw, 4.1rem);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -0.045em;
    margin-bottom: 28px;
}
.accent { color: var(--accent); }

.hero-lede {
    max-width: 33em;
    font-size: 18.5px;
    line-height: 1.65;
    color: var(--text-soft);
    margin-bottom: 14px;
}
.hero-sub {
    max-width: 33em;
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 10px; }
.hero-meta .icon { width: 16px; height: 16px; }

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background: var(--pass);
}
.status-dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--pass);
    animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Report card */
.report {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-family: var(--font-mono);
    font-size: 13px;
    overflow: hidden;
}
.report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
}
.report-file::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 2px;
    background: var(--line-strong);
    vertical-align: 1px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.pill-pass {
    color: var(--pass);
    background: var(--pass-soft);
    border: 1px solid var(--pass-line);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.report-body { padding: 20px 18px 18px; }
.report-cmd { color: var(--text-soft); margin-bottom: 16px; word-break: break-word; }
.prompt { color: var(--accent); margin-right: 6px; }

.report-lines li {
    display: grid;
    grid-template-columns: 18px 96px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-top: 1px dashed var(--line);
    align-items: baseline;
}
.tick { color: var(--pass); }
.key { color: var(--dim); }
.val { color: var(--text-soft); font-family: var(--font-sans); font-size: 14.5px; line-height: 1.5; }

.report-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--line-strong);
    color: var(--muted);
}
.pass-text { color: var(--pass); }
.report-ready { color: var(--text); }
.report-ready::before { content: "→ "; color: var(--accent); }

.js .report-lines li,
.js .report-summary {
    opacity: 0;
    transform: translateY(4px);
    animation: line-in 0.5s var(--ease) forwards;
}
.js .report-lines li:nth-child(1) { animation-delay: 0.35s; }
.js .report-lines li:nth-child(2) { animation-delay: 0.6s; }
.js .report-lines li:nth-child(3) { animation-delay: 0.85s; }
.js .report-lines li:nth-child(4) { animation-delay: 1.1s; }
.js .report-lines li:nth-child(5) { animation-delay: 1.35s; }
.js .report-summary { animation-delay: 1.7s; }
@keyframes line-in { to { opacity: 1; transform: none; } }

/* ---------- Stats band ---------- */
.stats-band {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg-alt);
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
    padding: 34px 28px;
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dd {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
}
.stat dt { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- Sections ---------- */
.section {
    padding: 120px 0;
    border-top: 1px solid var(--line);
}
.stats-band + .section { border-top: 0; }
.section-alt { background: var(--bg-alt); }
.section-tight { padding: 88px 0; }

.section-head { max-width: 700px; margin-bottom: 60px; }
.section-index {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}
.section-title {
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    line-height: 1.12;
    font-weight: 600;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.section-lede {
    margin-top: 18px;
    font-size: 18px;
    color: var(--muted);
    max-width: 36em;
}

/* ---------- Approach / principles ---------- */
.principles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.principle {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 32px 32px 28px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.principle:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.principle-num {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 18px;
}
.principle h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin-bottom: 12px;
}
.principle > p:not(.principle-proof) { color: var(--muted); font-size: 16px; margin-bottom: 24px; }
.principle-proof {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed var(--line-strong);
    font-size: 14.5px;
    color: var(--text-soft);
    line-height: 1.5;
}
.principle-proof span {
    display: block;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pass);
    margin-bottom: 4px;
}

/* ---------- Experience ---------- */
.role {
    position: relative;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    padding: 48px 0;
    border-top: 1px solid var(--line);
}
.role:first-child { border-top: 0; padding-top: 0; }

.role-meta { position: relative; padding-left: 22px; }
.role-meta::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--dim);
    background: var(--bg-alt);
}
.role-current .role-meta::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.role-dates {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}
.role-current .role-dates { color: var(--accent); }
.role-company { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.role-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pass);
    background: var(--pass-soft);
    border: 1px solid var(--pass-line);
}

.role-title {
    font-size: 23px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 10px;
}
.role-summary { color: var(--muted); margin-bottom: 26px; }

.role-groups { display: grid; gap: 26px; margin-bottom: 28px; }
.group-label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 10px;
}

.bullets { display: grid; gap: 10px; margin-bottom: 24px; max-width: 46em; }
.role-groups .bullets { margin-bottom: 0; }
.bullets li {
    position: relative;
    padding-left: 22px;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.65;
}
.bullets li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.8em;
    width: 8px;
    height: 1.5px;
    background: var(--accent);
}

.highlight {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 18px 0 26px;
    padding: 18px 22px;
    border: 1px solid var(--line-strong);
    border-left: 2px solid var(--pass);
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--pass-soft), transparent 70%);
}
.highlight-num {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--pass);
}
.highlight-text { color: var(--text-soft); font-size: 15.5px; line-height: 1.5; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li,
.chip,
.project-tags li {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    background: var(--surface);
}

/* ---------- Process pipeline ---------- */
.pipeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.stage {
    position: relative;
    padding: 30px 28px 32px;
    background: var(--bg);
    transition: background-color 0.3s var(--ease);
}
.stage:hover { background: var(--surface); }
.stage-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.stage-num { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.stage-check {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    color: var(--pass);
    background: var(--pass-soft);
    border: 1px solid var(--pass-line);
}
.stage-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 10px; }
.stage p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }

/* ---------- Expertise ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
    margin-bottom: 72px;
}
.skill-head {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line-strong);
}
.skill-list li {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 15.5px;
}

.toolkit {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.toolkit-head {
    display: flex;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}
.toolkit-head span:first-child::before { content: "~/"; color: var(--accent); }
.toolkit-count { color: var(--dim); }

.toolkit-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}
.toolkit-row:last-child { border-bottom: 0; }
.toolkit-row dt { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }
.toolkit-row dd { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font-size: 13px;
    padding: 6px 12px;
    color: var(--text-soft);
    background: var(--bg);
    transition: border-color 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--accent-line); color: var(--text); }

/* ---------- Projects ---------- */
.projects {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.project {
    display: flex;
    flex-direction: column;
    min-height: 168px;
    padding: 22px 22px 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.project:hover { border-color: var(--muted); transform: translateY(-2px); }
.project-id { font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin-bottom: 14px; }
.project-name {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: auto;
    padding-bottom: 18px;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tags li { font-size: 11.5px; padding: 4px 9px; background: var(--bg); }
.project-tags .tag-fintech {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

/* ---------- Education ---------- */
.education .section-index { margin-bottom: 22px; }
.edu-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 28px 30px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}
.edu-degree { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 4px; }
.edu-school { color: var(--muted); }
.edu-meta {
    display: flex;
    gap: 10px 28px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-soft);
}

/* ---------- Contact ---------- */
.contact-section {
    background: radial-gradient(ellipse 60% 80% at 0% 100%, var(--glow-soft), transparent 70%), var(--bg);
}
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 72px;
    align-items: start;
}

.contact-links { display: grid; gap: 12px; margin-top: 40px; }
.contact-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 14px 14px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.25s var(--ease);
}
.contact-link:hover { border-color: var(--accent-line); }
.contact-link > .icon { width: 20px; height: 20px; color: var(--accent); }
.contact-main { display: grid; min-width: 0; flex: 1; }
.contact-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.contact-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dim);
}
.contact-value { font-size: 16px; overflow-wrap: anywhere; }
.contact-arrow { color: var(--dim); margin-right: 6px; transition: transform 0.25s var(--ease), color 0.25s; }
.contact-link:hover .contact-arrow { color: var(--text); transform: translate(2px, -2px); }

.copy-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.copy-btn .icon { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.copy-btn.copied { color: var(--pass); border-color: var(--pass-line); }

.contact-form {
    position: relative;
    padding: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    gap: 18px;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; color: var(--text-soft); }
.field input,
.field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--field);
    color: var(--text);
    font: 16px/1.5 var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field ::placeholder { color: var(--dim); }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input,
.field.invalid textarea { border-color: var(--accent); }
.field-error {
    display: none;
    font-size: 13.5px;
    color: var(--accent);
    line-height: 1.4;
}
.field.invalid .field-error { display: block; }

.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.form-foot .btn:disabled { opacity: 0.6; cursor: progress; }
.form-status { font-size: 14px; color: var(--muted); }
.form-status.err { color: var(--accent); }
.form-status a { text-decoration: underline; text-underline-offset: 3px; }

.form-success {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    border-radius: inherit;
    background: var(--surface);
    animation: line-in 0.5s var(--ease) both;
}
.form-success[hidden] { display: none; }
.form-success h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; }
.form-success p { color: var(--muted); margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--muted);
}
.footer-mono { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }
.footer-top { transition: color 0.2s; }
.footer-top:hover { color: var(--text); }

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

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .nav-link { padding: 8px 8px; }
    .nav-link.active::after { left: 8px; right: 8px; }
}

@media (max-width: 980px) {
    .hero { padding: calc(var(--header-h) + 56px) 0 72px; min-height: 0; }
    .hero-inner { grid-template-columns: 1fr; gap: 56px; }
    .report { max-width: 560px; }

    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { padding: 26px 24px; }
    .stat:nth-child(3) { border-left: 0; padding-left: 0; }
    .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }

    .role { grid-template-columns: 1fr; gap: 16px; }
    .role-badge { display: none; }
    .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skills-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 900px) {
    .nav-toggle { display: grid; }
    .nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 12px 16px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.5);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
    }
    .nav.open { opacity: 1; transform: none; visibility: visible; }
    .nav-link { padding: 14px 8px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
    .nav-link.active { color: var(--accent); }
    .nav-link.active::after { display: none; }
    .nav-cv { margin: 14px 0 0; height: 46px; }
    .site-header.menu-open { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: var(--line); }
}

@media (max-width: 640px) {
    body { font-size: 16.5px; }
    .container { padding: 0 16px; }
    .section { padding: 88px 0; }
    .section-tight { padding: 64px 0; }
    .section-head { margin-bottom: 44px; }
    .section-lede { font-size: 17px; }

    .hero-lede { font-size: 17.5px; }
    .hero-actions .btn { flex: 1 1 auto; }

    .report-lines li { grid-template-columns: 16px minmax(0, 1fr); row-gap: 2px; }
    .report-lines .val { grid-column: 2; }

    .principles,
    .pipeline,
    .skills-grid,
    .projects { grid-template-columns: 1fr; }
    .principle { padding: 26px 22px 22px; }
    .project { min-height: 0; }

    .toolkit-row { grid-template-columns: 1fr; gap: 10px; }
    .field-row { grid-template-columns: 1fr; }
    .contact-form,
    .form-success { padding: 22px; }
    .copy-text { display: none; }
    .highlight { flex-direction: column; align-items: flex-start; gap: 8px; }
    .edu-card { padding: 22px; }
}

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