/* ============ Mehdi Khabouze — CV · "Midnight & Gold" ============ */
:root {
  --bg: #f5f7fb; --bg-2: #e9eef6; --surface: #ffffff; --surface-2: #f8fafd;
  --ink: #0b1626; --ink-2: #46546b; --ink-3: #7a879b; --line: #dde4ef;
  --accent: #1f4fd9; --accent-2: #4a86f7; --accent-soft: rgba(31, 79, 217, .09);
  --gold: #b58a37; --gold-2: #e3c27a;
  --night: #07101f; --night-2: #0c1830;
  --shadow: 0 1px 2px rgba(11, 22, 38, .04), 0 16px 36px -20px rgba(11, 22, 38, .2);
  --shadow-h: 0 1px 2px rgba(11, 22, 38, .05), 0 30px 56px -24px rgba(31, 79, 217, .38);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}
[data-theme="dark"] {
  --bg: #08111f; --bg-2: #0d1830; --surface: #0f1a30; --surface-2: #12203a;
  --ink: #ecf1f9; --ink-2: #a5b2c8; --ink-3: #75839b; --line: #1d2c47;
  --accent: #7aa8ff; --accent-2: #9bbcff; --accent-soft: rgba(122, 168, 255, .12);
  --gold: #e0bd6d; --gold-2: #f0d9a0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 20px 44px -24px rgba(0, 0, 0, .75);
  --shadow-h: 0 1px 2px rgba(0, 0, 0, .3), 0 32px 58px -24px rgba(122, 168, 255, .35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; font-size: 15px; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background .6s var(--ease), color .6s var(--ease); }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--gold-2); color: var(--night); }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

/* ---------- intro curtain ---------- */
.curtain { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--night); color: #fff; animation: curtain 1.15s .55s var(--ease) forwards; pointer-events: none; }
.curtain span { font-weight: 800; font-size: clamp(2.6rem, 9vw, 4.5rem); letter-spacing: -.06em; animation: monogram .9s var(--ease) both; }
.curtain i { font-style: normal; color: var(--gold-2); }
@keyframes monogram { from { opacity: 0; transform: translateY(24px) scale(.94); } 60% { opacity: 1; } }
@keyframes curtain { to { transform: translateY(-101%); visibility: hidden; } }

/* progress + cursor */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120; background: linear-gradient(90deg, var(--accent), var(--gold-2)); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.cur { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cur { display: block; position: fixed; inset: 0; z-index: 250; pointer-events: none; mix-blend-mode: difference; }
  .cur i { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
  .cur-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
  .cur-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(255, 255, 255, .8); transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .3s; }
  .cur.big .cur-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255, 255, 255, .9); }
  .cur.hid { opacity: 0; }
}

/* ---------- top bar ---------- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 90; padding-top: env(safe-area-inset-top); color: #fff; transition: background .5s var(--ease), box-shadow .5s var(--ease), color .4s, transform .6s var(--ease); }
.bar.solid { color: var(--ink); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); box-shadow: 0 1px 0 var(--line); }
.bar.hide { transform: translateY(-100%); }
.bar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: -.05em; }
.logo span { color: var(--gold-2); }
.links { position: relative; display: flex; gap: .1rem; padding: .22rem; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(10px); transition: background .4s, border-color .4s; }
.bar.solid .links { background: color-mix(in srgb, var(--surface) 75%, transparent); border-color: var(--line); }
.links a { position: relative; z-index: 1; display: block; padding: .4rem .95rem; border-radius: 999px; font-size: .84rem; font-weight: 500; opacity: .72; transition: opacity .3s; }
.links a:hover, .links a.on { opacity: 1; }
.links-pill { position: absolute; z-index: 0; top: .22rem; bottom: .22rem; left: 0; width: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: transform .55s var(--ease), width .55s var(--ease), opacity .3s; opacity: 0; }
.bar.solid .links-pill { background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent) inset; }
.bar-act { display: flex; align-items: center; gap: .5rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); transition: transform .5s var(--ease), border-color .3s, background .4s; }
.bar.solid .icon-btn { border-color: var(--line); background: var(--surface); }
.icon-btn:hover { transform: rotate(20deg) scale(1.07); border-color: var(--gold); }
.icon-btn svg { width: 18px; height: 18px; }
.i-moon { display: none; } [data-theme="dark"] .i-sun { display: none; } [data-theme="dark"] .i-moon { display: block; }
.menu-btn { display: none; position: relative; }
.menu-btn i { position: absolute; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease); }
.menu-btn i:first-child { transform: translateY(-3px); } .menu-btn i:last-child { transform: translateY(3px); }
.menu-btn[aria-expanded="true"] i:first-child { transform: rotate(45deg); } .menu-btn[aria-expanded="true"] i:last-child { transform: rotate(-45deg); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .85rem 1.45rem; border-radius: 999px; font-weight: 600; font-size: .92rem; transition: transform .5s var(--ease), box-shadow .5s var(--ease), background .35s, border-color .35s, color .35s; will-change: transform; white-space: nowrap; position: relative; overflow: hidden; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-sm { padding: .52rem 1.05rem; font-size: .84rem; } .btn-sm svg { width: 15px; height: 15px; }
.btn-solid { background: #fff; color: var(--night); }
.bar.solid .btn-solid { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .bar.solid .btn-solid { background: var(--accent); color: #06112a; }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), #d3a54c); color: #1a1204; box-shadow: 0 16px 34px -16px rgba(227, 194, 122, .7); }
.btn-gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .9s var(--ease); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-gold:hover, .btn-solid:hover { transform: translateY(-2px); }
.btn-glass { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--gold); transform: translateY(-2px); }
.btn-link { padding-inline: .4rem; color: var(--gold-2); } .btn-link svg { transition: transform .45s var(--ease); } .btn-link:hover svg { transform: translateX(5px); }

/* download dropdown */
.dl { position: relative; }
.dl-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; padding: .35rem; border-radius: 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-h); opacity: 0; transform: translateY(-8px) scale(.97); transform-origin: top right; pointer-events: none; transition: opacity .3s var(--ease), transform .45s var(--ease); z-index: 95; }
.dl-hero .dl-menu { left: 0; right: auto; transform-origin: top left; }
.dl.open .dl-menu { opacity: 1; transform: none; pointer-events: auto; }
.dl-menu a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 11px; font-size: .88rem; font-weight: 500; transition: background .25s; }
.dl-menu a:hover { background: var(--accent-soft); }
.dl-menu b { display: grid; place-items: center; width: 28px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 500 .68rem var(--mono); }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(20px); animation: up 1s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes up { to { opacity: 1; transform: none; } }
.ln { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .06em .14em 0; margin-bottom: -.14em; }
.rv-w { display: inline-block; transform: translateY(112%) rotate(3deg); animation: word 1.2s var(--ease) forwards; animation-delay: var(--d, 0s); transform-origin: 0 100%; }
@keyframes word { to { transform: none; } }
.rv-s { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.rv-s.in { opacity: 1; transform: none; }
/* split headings */
.sw { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .05em .14em 0; margin-bottom: -.14em; }
.sw > i { display: inline-block; font-style: inherit; transform: translateY(112%) rotate(3deg); transform-origin: 0 100%; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * .06s); }
[data-split].in .sw > i { transform: none; }

/* ---------- hero (always midnight) ---------- */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--night); border-radius: 0 0 clamp(26px, 4vw, 52px) clamp(26px, 4vw, 52px); overflow: clip; padding-top: 108px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg i { position: absolute; display: block; }
.g1 { width: 70vw; max-width: 900px; aspect-ratio: 1; left: -18%; top: -34%; background: radial-gradient(closest-side, rgba(58, 108, 240, .5), transparent); animation: drift 18s ease-in-out infinite alternate; }
.g2 { width: 60vw; max-width: 760px; aspect-ratio: 1; right: -16%; bottom: -30%; background: radial-gradient(closest-side, rgba(227, 194, 122, .3), transparent); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate3d(7vw, 5vw, 0) scale(1.12); } }
.grid-bg { inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000, transparent); mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000, transparent); }
.hero-in { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; padding-block: clamp(1.2rem, 4vw, 2.6rem) 1.6rem; }
.badge { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .42rem .95rem; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); font-size: .78rem; font-weight: 500; color: #c9d5ea; backdrop-filter: blur(8px); }
.badge a { color: #fff; font-weight: 700; border-bottom: 1px solid var(--gold-2); }
.badge .sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .25); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } }
.name { margin-top: 1.2rem; font-size: clamp(3.1rem, 9vw, 6.6rem); font-weight: 800; letter-spacing: -.06em; line-height: .96; }
.name .serif { font-size: 1.08em; font-weight: 400; letter-spacing: -.03em; background: linear-gradient(100deg, var(--gold-2), #fff 60%, var(--gold-2)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; animation: word 1.2s var(--ease) forwards, sheen 7s 2.5s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
@supports not (background-clip: text) { .name .serif { color: var(--gold-2); } }
.role { margin-top: 1.3rem; font-size: clamp(1.1rem, 2.2vw, 1.45rem); font-weight: 500; color: #e8eef9; display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.role-pre { color: #8ea1c2; }
.roles { position: relative; display: inline-grid; height: 1.4em; overflow: hidden; vertical-align: bottom; }
.roles b { grid-area: 1 / 1; font-weight: 700; color: var(--gold-2); transform: translateY(110%); opacity: 0; transition: transform .8s var(--ease), opacity .6s; white-space: nowrap; }
.roles b.on { transform: none; opacity: 1; } .roles b.out { transform: translateY(-110%); opacity: 0; }
.lead { margin-top: 1rem; max-width: 33rem; font-size: 1.04rem; color: #aebcd5; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1.7rem; }

.hero-pic { position: relative; justify-self: center; width: min(100%, 360px); }
.pic { position: relative; aspect-ratio: 1; transition: transform .35s ease-out; will-change: transform; }
.pic img { position: absolute; inset: 9%; width: 82%; height: 82%; border-radius: 34%; object-fit: cover; object-position: 50% 12%; background: #14223d; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .14); animation: morph 14s ease-in-out infinite alternate; }
@keyframes morph { 0% { border-radius: 34% 38% 36% 40%; } 100% { border-radius: 40% 34% 42% 34%; } }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); }
.r1 { border-style: dashed; border-color: rgba(227, 194, 122, .45); animation: spin 46s linear infinite; }
.r2 { inset: 4%; border-color: rgba(122, 168, 255, .4); border-top-color: transparent; border-left-color: transparent; animation: spin 24s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip-float { position: absolute; display: flex; gap: .4rem; align-items: center; padding: .5rem .9rem; border-radius: 14px; background: rgba(12, 24, 48, .72); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .7); font-size: .76rem; color: #cfdaee; animation: bob 7s ease-in-out infinite; white-space: nowrap; }
.chip-float b { font: 500 .74rem var(--mono); color: var(--gold-2); }
.c1 { left: -8%; top: 12%; } .c2 { right: -6%; top: 46%; animation-delay: -2.5s; } .c3 { left: 6%; bottom: 4%; animation-delay: -5s; }
@keyframes bob { 50% { transform: translateY(-10px); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding-block: 1.5rem 1.8rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.stats dt { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stats dd { font-size: .78rem; color: #8ea1c2; margin-top: .2rem; max-width: 11rem; line-height: 1.35; }
.marq { overflow: hidden; border-top: 1px solid rgba(255, 255, 255, .08); padding-block: .95rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marq-t { display: flex; width: max-content; gap: 2.4rem; animation: marq 38s linear infinite; }
.marq-t span { font: 500 .8rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #6d80a3; display: flex; align-items: center; gap: 2.4rem; }
.marq-t span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: .8; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.sec { padding-block: clamp(3rem, 7vw, 5rem) 0; }
.sec-h { margin-bottom: 1.8rem; }
.sec-h-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.sec h2 { margin-top: .5rem; font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.04; }
.sec h2 .serif { font-size: 1.1em; font-weight: 400; letter-spacing: -.03em; color: var(--accent); }

/* about bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.b-main { grid-column: 1 / -1; padding: clamp(1.3rem, 3vw, 2rem); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2.2rem; }
.b-main p { color: var(--ink-2); font-size: 1.02rem; }
.b-main strong { color: var(--ink); font-weight: 600; } .b-main a { color: var(--accent); }
.b-card { position: relative; padding: 1.2rem 1.3rem; border-radius: 22px; background: linear-gradient(160deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); overflow: hidden; transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .3s; }
.b-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 28%, transparent), transparent); transition: transform .8s var(--ease); }
.b-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-h); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.b-card:hover::after { transform: scale(1.8); }
.b-card b { font: 500 .72rem var(--mono); color: var(--gold); }
.b-card h4 { margin-top: .6rem; font-size: 1.1rem; font-weight: 700; letter-spacing: -.03em; }
.b-card span { display: block; margin-top: .25rem; font-size: .88rem; color: var(--ink-3); position: relative; z-index: 1; }

/* timelines */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem 3.2rem; }
.col-h { display: flex; align-items: center; gap: .7rem; font: 500 .76rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1.2rem; }
.col-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tl { position: relative; padding-left: 1.6rem; }
.tl::before { content: ""; position: absolute; left: 4px; top: .4rem; bottom: .4rem; width: 1px; background: var(--line); }
.tl::after { content: ""; position: absolute; left: 4px; top: .4rem; width: 1px; height: var(--tlp, 0%); background: linear-gradient(var(--accent), var(--gold)); max-height: calc(100% - .8rem); }
.tl-i { position: relative; padding: .15rem 0 1.4rem; transition: transform .5s var(--ease); }
.tl-i:last-child { padding-bottom: 0; }
.tl-i:hover { transform: translateX(5px); }
.tl-i::before { content: ""; position: absolute; left: -1.6rem; top: .6rem; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); transition: transform .5s var(--ease), background .3s, box-shadow .4s; }
.tl-i:hover::before { transform: scale(1.5); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-d { font: 500 .72rem var(--mono); color: var(--gold); letter-spacing: .04em; }
.tl-i h4 { font-size: 1rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.35; margin-top: .15rem; }
.tl-i h4 em { display: block; font-style: normal; font-weight: 500; font-size: .86rem; color: var(--ink-3); }
.tl-i ul { margin-top: .45rem; display: grid; gap: .25rem; }
.tl-i li { position: relative; padding-left: .9rem; font-size: .86rem; color: var(--ink-2); line-height: 1.5; }
.tl-i li::before { content: ""; position: absolute; left: 0; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.tl-i li b { color: var(--ink); font-weight: 600; }

/* work */
.filters { display: flex; flex-wrap: wrap; gap: .3rem; padding: .25rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.f { position: relative; z-index: 1; padding: .4rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 500; color: var(--ink-2); transition: color .35s, background .35s; }
.f:hover { color: var(--ink); } .f.on { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .f.on { background: var(--accent); color: #06112a; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; perspective: 1200px; }
.card { position: relative; display: flex; flex-direction: column; gap: .55rem; padding: 1.25rem 1.3rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; isolation: isolate; transform-style: preserve-3d; transition: transform .35s ease-out, box-shadow .6s var(--ease), opacity .45s var(--ease), border-color .3s; will-change: transform; }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); transition: opacity .4s; }
.card:hover { box-shadow: var(--shadow-h); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: 1.06rem; font-weight: 700; letter-spacing: -.03em; }
.card p { font-size: .87rem; color: var(--ink-2); line-height: 1.5; flex: 1; }
.tag-top { position: absolute; top: .95rem; right: .95rem; font: 500 .62rem var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: .22rem .55rem; border-radius: 6px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tags i { font: 500 .68rem var(--mono); font-style: normal; padding: .17rem .52rem; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); }
.links-r { display: flex; gap: .95rem; margin-top: .15rem; font-size: .8rem; font-weight: 600; }
.links-r a { color: var(--accent); position: relative; } .links-r a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.links-r a:hover::after { transform: scaleX(1); }
.links-r small { font: 500 .6rem var(--mono); color: var(--ink-3); }
.card.extra { display: none; } .grid.all .card.extra { display: flex; }
.card.hide { display: none !important; }
.card.enter { animation: cardIn .7s var(--ease) backwards; animation-delay: var(--i, 0s); }
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.96); } }
.more-w { display: flex; justify-content: center; margin-top: 1.4rem; }
.more-w .btn svg { transition: transform .5s var(--ease); } .more-w.open .btn svg { transform: rotate(180deg); }
.more-w.off { display: none; }

/* skills */
.sk-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; }
.sk { padding: 1.15rem 1.25rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.sk h4 { font: 500 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .38rem; }
.chips i { font-style: normal; font-size: .8rem; font-weight: 500; padding: .3rem .75rem; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); opacity: 0; transform: translateY(8px) scale(.94); transition: opacity .6s var(--ease), transform .6s var(--ease), background .3s, color .3s; transition-delay: calc(var(--k, 0) * .05s); }
.sk.in .chips i { opacity: 1; transform: none; }
.chips i.core { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sk.in .chips i:hover { transform: translateY(-3px); background: var(--accent); color: #fff; transition-delay: 0s; }
[data-theme="dark"] .sk.in .chips i:hover { color: #06112a; }
.certs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: .95rem; }
.cert { display: grid; gap: .15rem; padding: .95rem 1.1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: transform .55s var(--ease), border-color .3s, box-shadow .55s var(--ease); }
.cert:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: var(--shadow-h); }
.cert b { font-size: .88rem; letter-spacing: -.015em; line-height: 1.3; } .cert span { font-size: .75rem; color: var(--ink-3); }
.quotes { display: grid; grid-template-columns: 1.4fr 1fr; gap: .95rem; margin-top: .95rem; }
.quotes blockquote { padding: 1.3rem 1.4rem; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.quotes blockquote::before { content: "“"; position: absolute; top: -.35rem; left: 1rem; font: 400 4.6rem/1 var(--serif); color: var(--gold); opacity: .4; }
.quotes p { font: 400 1.18rem/1.4 var(--serif); font-style: italic; color: var(--ink); padding-top: .9rem; }
.quotes footer { margin-top: .7rem; font-size: .76rem; color: var(--ink-3); } .quotes footer b { color: var(--ink); }

/* contact */
.contact { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem 3rem; align-items: center; padding: clamp(1.8rem, 5vw, 3.2rem); border-radius: 34px; color: #eaf0fb; background: var(--night); position: relative; overflow: hidden; isolation: isolate; }
.contact::before { content: ""; position: absolute; z-index: -1; width: 700px; height: 700px; left: -200px; top: -300px; background: radial-gradient(closest-side, rgba(58, 108, 240, .45), transparent); animation: drift 20s ease-in-out infinite alternate; }
.contact::after { content: ""; position: absolute; z-index: -1; right: -90px; bottom: -110px; width: 300px; height: 300px; border-radius: 50%; border: 1px solid rgba(227, 194, 122, .3); box-shadow: 0 0 0 40px rgba(227, 194, 122, .04), 0 0 0 80px rgba(227, 194, 122, .03); }
.contact .eyebrow { color: var(--gold-2); }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 5.4vw, 4rem); } .contact h2 .serif { color: var(--gold-2); }
.contact p { margin-top: .9rem; color: #aebcd5; max-width: 26rem; }
.c-list { display: grid; position: relative; z-index: 1; }
.c-list li { display: flex; gap: 1rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: .98rem; }
.c-list li:last-child { border: 0; }
.c-list span { flex: none; width: 4.8rem; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: #7c8fb0; }
.c-list a { font-weight: 500; transition: color .3s, transform .4s var(--ease); word-break: break-word; display: inline-block; } .c-list a:hover { color: var(--gold-2); transform: translateX(4px); }

.foot { display: flex; justify-content: space-between; gap: 1rem; padding-block: 2rem 2.4rem; font-size: .8rem; color: var(--ink-3); }
.foot a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; gap: 1.4rem; padding-top: 1rem; }
  .hero-pic { order: -1; width: min(52vw, 220px); justify-self: start; }
  .chip-float { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .two, .contact { grid-template-columns: 1fr; }
  .b-main { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; } .b-main { grid-column: auto; }
  .grid, .sk-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotes { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .links { position: fixed; inset: 70px 12px auto 12px; flex-direction: column; padding: .5rem; border-radius: 22px; background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-h); opacity: 0; transform: translateY(-10px) scale(.98); pointer-events: none; transition: opacity .35s var(--ease), transform .5s var(--ease); }
  .links.open { opacity: 1; transform: none; pointer-events: auto; }
  .links a { padding: .8rem 1rem; font-size: .98rem; opacity: 1; }
  .links-pill { display: none; }
}
@media (max-width: 600px) {
  html { font-size: 14.5px; }
  .grid, .sk-g, .certs { grid-template-columns: minmax(0, 1fr); }
  .sec-h-row { align-items: flex-start; }
  .filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .filters::-webkit-scrollbar { display: none; }
  .f { flex: none; }
  .cta .btn { flex: 1 1 auto; } .cta .dl { flex: 1 1 100%; } .cta .dl .btn { width: 100%; } .dl-hero .dl-menu { right: 0; }
  .c-list li { flex-direction: column; gap: .1rem; }
  .name { font-size: clamp(2.9rem, 15vw, 4.2rem); }
  .badge .sep { display: none; }
}
@media (max-width: 360px) { .stats dt { font-size: 1.5rem; } .btn { padding-inline: 1rem; } .bar-in { gap: .4rem; } .btn-sm span { display: none; } }

@media print { .bar, .progress, .cur, .curtain, .chip-float, .more-w, .filters, .marq { display: none !important; } .hero { color: #000; background: none; } .rv, .rv-s, .rv-w, .sw > i, .chips i { opacity: 1 !important; transform: none !important; animation: none !important; } .card.extra { display: flex !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .rv, .rv-w, .rv-s, .sw > i, .chips i { opacity: 1; transform: none; } .curtain { display: none; }
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
