/* ============================================================
   Yasaman Abdollahi — Portfolio
   Tokens sourced from Figma file xNZWITTX177gWPepvkbYPy (node 232:1771)
============================================================ */
:root {
    --bg-page: #FBFBFF;          /* page background */
    --bg-card: #FFFFFF;
    --bg-dark: #1C2649;          /* Virtual Credit Game card */
    --text-primary: #191919;
    --text-secondary: #7C7C7C;
    --text-tertiary: #999999;
    --accent: #2144F5;
    --accent-hover: #1A38CC;
    --purple: #7B3AED;
    --border: #E6E6F0;
    --border-strong: #D8D8E2;
    --skill-pill-bg: #191919;
    --skill-pill-text: #F2F2F5;
    --radius-card: 20px;
    --radius-media: 14px;
    --radius-button: 40px;
    --radius-badge: 32px;
    --maxw: 1120px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    /* easeOutCubic — eases in from rest instead of launching at full speed like --ease-out */
    --ease-gentle: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ===== Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* ===== Nav ===== */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 16px 32px; background: transparent; }
nav .container { display: flex; justify-content: space-between; align-items: center; padding: 0 32px; }
.nav-logo { display: inline-flex; align-items: center; color: var(--text-primary); flex-shrink: 0; transition: transform .3s var(--ease-out), color .3s ease; }
.nav-logo:hover { transform: translateY(-1px); color: var(--purple); }
.nav-cat { height: 42px; width: auto; display: block; }
.nav-center {
    display: flex; align-items: center; gap: 4px; list-style: none;
    background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8); border-radius: 50px; padding: 8px;
    box-shadow: 0 4px 24px rgba(40,40,90,0.06);
}
.nav-center a { font-size: 15px; font-weight: 500; color: var(--text-secondary); padding: 8px 18px; border-radius: 40px; transition: color .2s, background .2s; white-space: nowrap; }
.nav-center a:hover { color: var(--text-primary); background: rgba(33,68,245,0.06); }
.nav-center a.active { color: var(--accent); background: rgba(33,68,245,0.08); }
.nav-resume { display: inline-flex; align-items: center; gap: 8px; padding: 11px 28px; background: var(--text-primary); border-radius: 50px; color: #fff; font-size: 15px; font-weight: 600; transition: background .2s, transform .2s; flex-shrink: 0; }
.nav-resume:hover { background: #000; transform: translateY(-1px); }
.nav-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; border: none; background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); border-radius: 12px; box-shadow: 0 4px 24px rgba(40,40,90,0.06); }
.nav-burger span { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--text-primary); border-radius: 2px; transition: transform .3s ease, opacity .2s ease; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; z-index: 90; background: rgba(251,251,255,0.97); backdrop-filter: blur(20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; opacity: 0; pointer-events: none; transform: translateY(-12px); transition: opacity .3s ease, transform .3s ease; }
.mobile-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mobile-menu-link { font-size: 24px; font-weight: 600; color: var(--text-primary); padding: 12px 24px; letter-spacing: -0.5px; }
.mobile-menu-resume { margin-top: 12px; background: var(--text-primary); color: #fff; border-radius: var(--radius-button); }

/* ===== Mega hero ===== */
.mega-hero { position: relative; padding: 310px 0 200px; overflow: hidden; }
.mega-hero-content { text-align: center; position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.mega-hero-greeting { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.mega-hero-greeting .sparkle { display: inline-flex; color: var(--purple); }
.mega-hero-name { font-size: 84px; font-weight: 800; color: var(--purple); letter-spacing: -3.5px; line-height: 1; }
/* Typewriter: hidden copies of every phrase reserve the widest box, so the
   hero never reflows as text types in and out. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.tw { position: relative; display: inline-block; vertical-align: bottom; min-height: 1.1em; }
.tw-sizer { display: block; height: 0; overflow: hidden; visibility: hidden; white-space: nowrap; pointer-events: none; user-select: none; }
.tw-sizer::after { content: ''; display: inline-block; width: .4em; }
.tw-visible { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.tw-caret { display: inline-block; width: 5px; height: .82em; border-radius: 2px; margin-inline-start: .1em; background: currentColor; animation: caret-blink .55s step-end infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.floating-pill { position: absolute; padding: 16px 32px; border-radius: 999px; font-size: 21px; font-weight: 700; box-shadow: 0 8px 22px rgba(40,40,90,0.06); z-index: 1; white-space: nowrap; will-change: transform; transition: transform .6s var(--ease-out), box-shadow .4s ease; --amp: 3deg; --lift: 6px; animation: pill-shake var(--dur) ease-in-out infinite var(--delay); }
.pill-design-system { top: 34%; left: 13%; background: #E5DEFB; color: #5B36C9; --baseRot: -6deg; --dur: 2.8s; --delay: 0s; }
.pill-prototype     { top: 31%; right: 9%;  background: #D2EFE2; color: #1F7A57; --baseRot: 8deg;  --dur: 3.2s; --delay: -.4s; }
.pill-research      { bottom: 20%; left: 7%; background: #FBE6D6; color: #C4571A; --baseRot: -10deg; --dur: 3s;   --delay: -.9s; }
.pill-product       { bottom: 20%; right: 11%; background: #D9EFD2; color: #2F7A1F; --baseRot: 4deg;  --dur: 2.6s; --delay: -1.3s; }
.pill-ai            { top: 57%; right: 3%; background: #FBDCE9; color: #B5325E; --baseRot: -8deg; --dur: 3.4s; --delay: -1.7s; --amp: 4deg; }
/* wobble around each pill's own resting tilt; negative delays desync them from frame 1 */
@keyframes pill-shake {
    0%, 100% { transform: rotate(calc(var(--baseRot) - var(--amp))) translateY(0); }
    50%      { transform: rotate(calc(var(--baseRot) + var(--amp))) translateY(calc(var(--lift) * -1)); }
}
.floating-pill:hover { animation-play-state: paused; transform: rotate(var(--baseRot)) translateY(-8px) scale(1.04); box-shadow: 0 14px 28px rgba(40,40,90,0.10); }

/* ===== Section shared ===== */
.section { padding: 56px 0; }
.section-title { font-size: 32px; font-weight: 700; letter-spacing: -1px; margin-bottom: 40px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

/* ===== About ===== */
.about-body { display: flex; align-items: flex-start; gap: 48px; }
.about-aside { width: 275px; flex-shrink: 0; }
.about-photo { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); margin-bottom: 18px; background: linear-gradient(135deg,#EEEAFB 0%,#E0EAFD 100%); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-hi { font-size: 15px; color: var(--text-secondary); margin-bottom: 2px; }
.about-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 14px; }
.about-aside a { display: block; color: var(--accent); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.about-aside a:hover { text-decoration: underline; }
.about-card { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 36px 40px; }
.about-role { font-size: 24px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.4px; }
.about-bio { font-size: 16px; color: var(--text-secondary); line-height: 1.75; }

/* ===== Work grid (Case Studies + Projects) ===== */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.work-card { grid-column: span 6; border-radius: var(--radius-card); background: var(--bg-card); border: 1px solid var(--border); color: inherit; display: flex; flex-direction: column; overflow: hidden; transition: transform .35s var(--ease-out), box-shadow .35s ease, border-color .35s ease; }
.work-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -14px rgba(40,40,90,0.14); border-color: var(--border-strong); }
.work-lg { grid-column: span 7; }
.work-md { grid-column: span 5; }
.work-sm { grid-column: span 4; }
.work-media { margin: 12px 12px 0; border-radius: var(--radius-media); overflow: hidden; }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.work-card:hover .work-media img { transform: scale(1.03); }
.work-body { padding: 18px 22px 22px; }
.work-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 8px; }
.work-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 18px; }
.card-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-primary); transition: border-color .25s ease, color .25s ease; }
.card-btn svg { width: 15px; height: 15px; }
.work-card:hover .card-btn { border-color: var(--accent); color: var(--accent); }

/* ===== Virtual Credit Game card (exact rebuild of Figma node 232:2386) ===== */
.vcg-card { grid-column: span 8; height: 447px; position: relative; border-radius: 28px; overflow: hidden; background: var(--bg-dark); border: 1px solid rgba(255,255,255,0.10); display: block; transition: transform .35s var(--ease-out), box-shadow .35s ease; }
.vcg-card:hover { transform: translateY(-4px); box-shadow: 0 28px 60px -20px rgba(28,38,73,0.6); }
.vcg-glow { position: absolute; top: -28%; left: 6%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(124,82,237,0.55) 0%, rgba(86,90,210,0.25) 38%, rgba(28,38,73,0) 70%); pointer-events: none; }
.vcg-phones { position: absolute; top: 42px; left: 26px; right: 26px; display: flex; gap: 12px; align-items: flex-start; }
.vcg-phone { flex: 0 1 146px; width: 146px; aspect-ratio: 146 / 293; height: auto; min-width: 0; object-fit: cover; align-self: flex-start; }
.vcg-screens { width: 100%; height: auto; display: block; }
.vcg-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 28px 24px; }
.vcg-overlay::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 44%; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.82) 55%, rgba(0,0,0,0.95) 88%); pointer-events: none; z-index: 0; transition: height .45s var(--ease-out); }
.vcg-card:hover .vcg-overlay::before { height: 82%; }
.vcg-overlay > * { position: relative; z-index: 1; }
.vcg-title { color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.vcg-desc { color: #EDEDED; font-size: 14px; line-height: 1.4; }
.vcg-desc strong { font-weight: 700; }
.vcg-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-button); padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-primary); box-shadow: 0 0 4px rgba(0,0,0,0.08); }
.vcg-btn svg { width: 22px; height: 22px; }
/* default = title only; reveal description + button on hover */
.vcg-desc, .vcg-btn { opacity: 0; max-height: 0; margin-top: 0; overflow: hidden; transform: translateY(6px); transition: opacity .35s ease, max-height .45s var(--ease-out), margin-top .45s var(--ease-out), transform .45s var(--ease-out); }
.vcg-card:hover .vcg-desc { opacity: 1; max-height: 96px; margin-top: 12px; transform: none; }
.vcg-card:hover .vcg-btn  { opacity: 1; max-height: 60px; margin-top: 16px; transform: none; }

/* ===== Overlay card system (text + button over the mockup, like Figma) ===== */
.ov2 { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--border-strong); display: block; background: #F4EEFF; transition: transform .5s var(--ease-gentle), box-shadow .5s var(--ease-gentle); }
.ov2:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -18px rgba(40,40,90,0.22); }
.ov-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ov-fade { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; }
.ov-fade::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; pointer-events: none; z-index: 0; transition: height .6s var(--ease-gentle); }
.ov-fade-light::before { background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.86) 46%, rgba(255,255,255,0.98) 78%); }
.ov-fade-dark::before  { background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.82) 52%, rgba(0,0,0,0.94) 84%); }
/* Figma stops: #000 @ 0% opacity -> #000 @ 46% opacity, spanning the full card.
   Height is pinned at 100% in both rest and hover so the ramp never shifts. */
.ov-fade-46::before          { background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.46) 100%); height: 100%; }
.ov2:hover .ov-fade-46::before { height: 100%; }
/* Separate scrim purely for caption contrast — the Figma ramp alone is too even
   to lift white text off the app screenshots. Sits above ::before, below content. */
.ov-fade-46::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 66%; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(10,14,28,0) 0%, rgba(10,14,28,0.55) 48%, rgba(10,14,28,0.88) 100%); }
.ov2:hover .ov-fade::before { height: 84%; }
.ov-fade > * { position: relative; z-index: 1; }
.ov-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.ov-desc { font-size: 16px; line-height: 1.4; max-width: 94%; }
.ov-fade-light .ov-title { color: #000; }
.ov-fade-light .ov-desc { color: #161616; }
.ov-fade-dark .ov-title { color: #fff; }
.ov-fade-dark .ov-desc { color: #EDEDED; }
.ov-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; border-radius: 40px; padding: 10px 16px; font-size: 14px; font-weight: 500; color: #000; background: rgba(255,255,255,0.85); border: 1px solid #e6e9ee; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 0 8px rgba(0,0,0,0.08); }
/* flex-shrink:0 — otherwise the flex row steals width from the icon and squashes it */
.ov-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
/* default = title only; reveal description + button on hover (Figma Hover=Yes) */
.ov-desc, .ov-btn { opacity: 0; max-height: 0; margin-top: 0; overflow: hidden; transform: translateY(6px); transition: opacity .45s var(--ease-gentle), max-height .55s var(--ease-gentle), margin-top .55s var(--ease-gentle), transform .55s var(--ease-gentle); }
.ov2:hover .ov-desc { opacity: 1; max-height: 96px; margin-top: 8px; transform: none; transition-delay: .05s; }
.ov2:hover .ov-btn  { opacity: 1; max-height: 60px; margin-top: 16px; transform: none; transition-delay: .12s; }
/* "Coming soon" case-study cards: badge + non-interactive state */
.soon-badge { position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 40px; font-size: 13px; font-weight: 600; letter-spacing: .2px; color: #fff; background: rgba(25,25,25,0.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(40,40,90,0.18); }
.soon-badge svg { width: 15px; height: 15px; }
.is-soon { cursor: default; }
.is-soon:hover { transform: none; box-shadow: 0 24px 50px -18px rgba(40,40,90,0.10); }
.is-soon .ov-art { filter: grayscale(0.35); opacity: 0.92; }
/* spans + per-row heights (desktop) */
.ov-7 { grid-column: span 7; } .ov-5 { grid-column: span 5; } .ov-4 { grid-column: span 4; } .ov-8 { grid-column: span 8; }
.h-cs { height: 447px; } .h-531 { height: 447px; } .h-510 { height: 447px; }

/* ===== Experience / Courses ===== */
.stack-list { display: flex; flex-direction: column; gap: 20px; }
.stack-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 30px 32px; background: var(--bg-card); border-radius: var(--radius-card); border: 1px solid var(--border); }
.stack-role { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.stack-org { font-size: 16px; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.stack-desc { font-size: 15px; color: var(--text-secondary); max-width: 620px; line-height: 1.6; }
.stack-date { font-size: 14px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; padding-left: 16px; }

/* ===== Skills ===== */
.skills-wrap { display: flex; flex-direction: column; gap: 28px; }
.skills-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.skill-tag { padding: 9px 22px; background: var(--skill-pill-bg); color: var(--skill-pill-text); border-radius: var(--radius-badge); font-size: 14px; font-weight: 500; transition: transform .45s var(--ease-out), box-shadow .35s ease, background .35s ease; }
.skill-tag:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 22px rgba(25,25,25,0.22); background: #2A2A38; }

/* ===== Contact ===== */
.contact-content { text-align: center; max-width: 580px; margin: 0 auto; }
.contact-content .section-title { margin-bottom: 16px; }
.contact-desc { font-size: 18px; color: var(--text-secondary); margin-bottom: 36px; }
.contact-links { display: flex; justify-content: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.contact-link { display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border: 1px solid var(--border-strong); background: var(--bg-card); border-radius: var(--radius-button); font-size: 15px; font-weight: 500; color: var(--text-primary); transition: border-color .2s, color .2s; }
.contact-link:hover { border-color: var(--accent); color: var(--accent); }
.contact-link svg { width: 19px; height: 19px; }
.contact-email { font-size: 15px; color: var(--text-secondary); }
.contact-email a { color: var(--accent); }

/* ===== Scroll reveal ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== Preview toolbar (dev helper — remove for production) ===== */
.preview-toolbar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; gap: 8px; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); padding: 8px 16px; border-radius: 12px; }
.preview-toolbar button { padding: 6px 14px; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; background: rgba(255,255,255,0.12); color: #fff; transition: background .2s; }
.preview-toolbar button:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   RESPONSIVE — TABLET (max 1023px)
============================================================ */
@media (max-width: 1023px) {
    .container { padding: 0 28px; }
    .work-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .work-card, .work-lg, .work-md, .work-sm { grid-column: span 1; }
    .ov-7, .ov-5, .ov-4, .ov-8 { grid-column: span 1; }
    .h-cs, .h-531, .h-510 { height: auto; }
    .ov2 { aspect-ratio: 16 / 12; }
    .vcg-card { grid-column: span 2; height: auto; aspect-ratio: 16 / 9; }
    .mega-hero { padding: 200px 0 170px; }
    .mega-hero-name { font-size: 58px; letter-spacing: -2.2px; }
    .floating-pill { font-size: 15px; padding: 11px 22px; }
    .pill-design-system { left: 3%; top: 19%; }
    .pill-prototype { right: 3%; top: 19%; }
    .pill-research { left: 3%; bottom: 22%; }
    .pill-product { right: 3%; bottom: 22%; }
    .pill-ai { right: 1%; top: 48%; }
    .about-body { gap: 32px; }
    .about-card { padding: 30px 32px; }
    .section { padding: 44px 0; }
    .section-title { font-size: 28px; margin-bottom: 32px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 767px)
============================================================ */
@media (max-width: 767px) {
    .container { padding: 0 20px; }
    nav { padding: 14px 20px; }
    nav .container { padding: 0; }
    .nav-center, .nav-resume { display: none; }
    .nav-burger { display: flex; }
    .mega-hero { padding: 190px 0 150px; }
    .mega-hero-greeting { font-size: 18px; }
    .mega-hero-name { font-size: 40px; letter-spacing: -1.6px; }
    .floating-pill { font-size: 12px; padding: 8px 14px; }
    .pill-design-system { left: 4%; top: 34%; }
    .pill-prototype { right: 4%; top: 34%; }
    .pill-research { left: 4%; bottom: 18%; }
    .pill-product { right: 4%; bottom: 16%; }
    .pill-ai { right: 2%; top: 56%; }
    .about-body { flex-direction: column; align-items: stretch; gap: 24px; }
    .about-aside { width: 100%; text-align: center; }
    .about-photo { margin: 0 auto 16px; }
    .about-card { padding: 26px 22px; }
    .about-role { font-size: 21px; }
    .work-grid { grid-template-columns: 1fr; gap: 16px; }
    .ov-7, .ov-5, .ov-4, .ov-8 { grid-column: span 1; }
    .h-cs, .h-531, .h-510 { height: 400px; }
    .ov2 { height: 400px; aspect-ratio: auto; }
    .vcg-card { grid-column: span 1; height: 350px; aspect-ratio: auto; }
    .vcg-phones { top: 28px; left: 16px; right: 16px; gap: 8px; }
    .vcg-overlay { padding: 14px 20px 20px; }
    .vcg-desc { font-size: 14px; }
    .section { padding: 38px 0; }
    .section-title { font-size: 24px; margin-bottom: 26px; }
    .stack-item { flex-direction: column; gap: 12px; padding: 22px; }
    .stack-date { white-space: normal; padding-left: 0; }
    .skill-tag { padding: 8px 16px; font-size: 13px; }
    .contact-link { flex: 1 1 calc(50% - 12px); justify-content: center; }
    .contact-desc { font-size: 16px; }
    .preview-toolbar { flex-wrap: wrap; max-width: calc(100% - 24px); justify-content: center; }
}

/* ===== Small phones (max 459px) ===== */
@media (max-width: 459px) {
    .mega-hero-name { font-size: 32px; letter-spacing: -1.2px; }
}

/* ===== Reduced motion / touch ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .floating-pill { animation: none !important; }
    .tw-caret { animation: none !important; opacity: 0; }
    *, *::before, *::after { transition-duration: 0.001ms !important; }
}
@media (hover: none), (max-width: 767px) {
    .work-card:hover, .vcg-card:hover { transform: none; }
    .work-card:hover .work-media img { transform: none; }
    .floating-pill:hover { transform: none; }
    .skill-tag:hover { transform: none; }
    /* keep cards collapsed on touch: title on the left, icon-only button on the right */
    .ov-fade { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 10px; }
    .ov-desc { display: none; }
    .ov-btn {
        opacity: 1; max-height: none; margin-top: 0; transform: none;
        align-self: flex-end; flex: 0 0 auto;
        width: 44px; height: 44px; padding: 0; gap: 0;
        font-size: 0; line-height: 0; justify-content: center; border-radius: 50%;
    }
    .ov-btn svg { width: 20px; height: 20px; }

    .vcg-overlay { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 10px; }
    .vcg-desc { display: none; }
    .vcg-btn {
        opacity: 1; max-height: none; margin-top: 0; transform: none;
        align-self: flex-end; flex: 0 0 auto;
        width: 44px; height: 44px; padding: 0; gap: 0;
        font-size: 0; line-height: 0; justify-content: center; border-radius: 50%;
    }
    .vcg-btn svg { width: 22px; height: 22px; }
}

/* ===== Case Study Modal ===== */
.cs-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(28, 28, 50, 0.55);
    backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .3s ease;
}
.cs-overlay.is-open { opacity: 1; }
.cs-overlay[hidden] { display: none; }

.cs-modal {
    position: relative;
    width: 100%; max-width: 760px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 40px 90px -30px rgba(28, 38, 73, 0.5);
    transform: translateY(16px) scale(.98);
    transition: transform .3s var(--ease-out);
    outline: none;
}
.cs-overlay.is-open .cs-modal { transform: none; }

.cs-close {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    color: var(--text-primary); cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.cs-close:hover { background: #fff; transform: scale(1.06); }
.cs-close svg { width: 20px; height: 20px; }

.cs-hero { position: relative; }
.cs-hero-img {
    display: block; width: 100%; height: 280px;
    object-fit: cover;
    border-radius: 28px 28px 0 0;
}
.cs-hero-text { padding: 24px 36px 0; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cs-tag {
    font-size: 13px; font-weight: 500;
    padding: 6px 14px; border-radius: 999px;
    background: #F4EEFF; color: #5B45C9;
}
.cs-title {
    font-size: 28px; font-weight: 700; letter-spacing: -0.5px;
    color: var(--text-primary);
}

.cs-body { padding: 24px 36px 40px; }
.cs-section + .cs-section { margin-top: 28px; }
.cs-heading {
    font-size: 18px; font-weight: 600; color: var(--text-primary);
    margin-bottom: 10px;
}
.cs-content { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.cs-content p { margin: 0 0 12px; }
.cs-content p:last-child { margin-bottom: 0; }
.cs-content ul, .cs-content ol { margin: 0 0 12px; padding-left: 20px; }
.cs-content li { margin-bottom: 8px; }
.cs-content strong { color: var(--text-primary); }
.cs-content img { width: 100%; border-radius: 14px; margin: 12px 0; }
/* Case-study stat tiles */
.cs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 12px; }
.cs-stat { background: var(--bg-page); border: 1px solid var(--border); border-radius: 14px; padding: 14px 12px; }
.cs-stat b { display: block; font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.15; }
.cs-stat span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-secondary); }
.cs-delta { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.cs-delta > div { display: contents; }
.cs-delta dt { font-size: 14px; color: var(--text-secondary); }
.cs-delta .cs-nums { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.cs-delta .cs-up { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }
@media (max-width: 767px) { .cs-stats { grid-template-columns: repeat(2, 1fr); } }
.cs-figph {
    margin: 14px 0;
    padding: 28px 16px;
    border: 1px dashed #C9BEEA;
    border-radius: 14px;
    background: #F8F5FF;
    color: #8A7CB8;
    font-size: 13px; text-align: center;
}
.cs-figcap { margin: -4px 0 14px; font-size: 12.5px; color: var(--text-secondary); text-align: center; }

/* One-week build timeline (My Role) */
.cs-timeline { margin: 16px 0 6px; }
.cs-timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cs-timeline-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.cs-timeline-range { font-size: 13px; font-weight: 600; color: var(--purple); white-space: nowrap; }
.cs-timeline-track { display: flex; gap: 6px; }
.cs-phase { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-phase-days { font-size: 13px; font-weight: 700; }
.cs-phase-label { font-size: 12.5px; line-height: 1.3; }
.cs-phase-a { background: #EDE7FE; }
.cs-phase-a .cs-phase-days { color: var(--purple); }
.cs-phase-a .cs-phase-label { color: #5B4B96; }
.cs-phase-b { background: #E7EEFE; }
.cs-phase-b .cs-phase-days { color: #2C5BC4; }
.cs-phase-b .cs-phase-label { color: #45557F; }
@media (max-width: 480px) { .cs-timeline-track { flex-direction: column; } }

@media (max-width: 640px) {
    .cs-overlay { padding: 0; }
    .cs-modal { max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .cs-hero-img { border-radius: 0; height: 200px; }
    .cs-hero-text { padding: 20px 22px 0; }
    .cs-title { font-size: 22px; }
    .cs-body { padding: 20px 22px 32px; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-overlay, .cs-modal { transition: none; }
    .cs-modal { transform: none; }
}

/* ============================================================
   THEME SWITCH (button in the nav, both themes)
============================================================ */
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle {
    width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
    color: var(--text-primary); background: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 4px 24px rgba(40,40,90,0.06);
    transition: transform .3s var(--ease-out), background .2s ease, color .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px) rotate(-12deg); color: var(--purple); }
.theme-toggle svg { width: 20px; height: 20px; grid-area: 1 / 1; transition: opacity .3s ease, transform .4s var(--ease-out); }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(60deg) scale(.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: none; }
/* colours glide when switching (only during the switch, so hover/reveal timings stay untouched) */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease !important;
}

/* ============================================================
   DARK THEME
   Neutral near-black with a faint cool tint (not pure #000, so cards can sit on it), three surface steps,
   soft off-white text, and the brand indigo/purple lifted just enough to stay readable on dark (AA+).
============================================================ */
[data-theme="dark"] {
    color-scheme: dark;
    --bg-page: #0D0E12;          /* page */
    --bg-card: #15171D;          /* cards, about, experience */
    --bg-elev: #1B1E26;          /* pills, buttons, inputs on cards */
    --bg-dark: #161B33;          /* Virtual Credit Game card */
    --text-primary: #EDEEF3;     /* 16.9:1 on page */
    --text-secondary: #A3A7B5;   /*  7.9:1 on page */
    --text-tertiary: #7E8392;    /*  4.9:1 on page */
    --accent: #8C9CFF;           /* brand indigo #2144F5, lifted for dark — 7.4:1 */
    --accent-hover: #A8B4FF;
    --purple: #B39BFF;           /* brand purple #7B3AED, lifted — 8:1 */
    --border: #22252E;
    --border-strong: #2D313C;
    --skill-pill-bg: #1B1E26;
    --skill-pill-text: #E3E5EC;
}
[data-theme="dark"] body { background: var(--bg-page); }

/* nav */
[data-theme="dark"] .nav-center,
[data-theme="dark"] .nav-burger,
[data-theme="dark"] .theme-toggle { background: rgba(21,23,29,0.72); border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 6px 28px rgba(0,0,0,0.35); }
[data-theme="dark"] .nav-center a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
[data-theme="dark"] .nav-center a.active { color: var(--accent); background: rgba(140,156,255,0.12); }
[data-theme="dark"] .nav-resume { background: var(--text-primary); color: #0D0E12; }
[data-theme="dark"] .nav-resume:hover { background: #fff; }
[data-theme="dark"] .mobile-menu { background: rgba(13,14,18,0.97); }
[data-theme="dark"] .mobile-menu-resume { background: var(--text-primary); color: #0D0E12; }

/* hero pills: deep tinted chips with light text in each pill's own hue */
[data-theme="dark"] .floating-pill { box-shadow: 0 10px 26px rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.05); }
[data-theme="dark"] .pill-design-system { background: #231D3B; color: #C6B6FF; }
[data-theme="dark"] .pill-prototype     { background: #132C25; color: #7FD6B1; }
[data-theme="dark"] .pill-research      { background: #33231A; color: #F0A679; }
[data-theme="dark"] .pill-product       { background: #1A2C1A; color: #9BD68C; }
[data-theme="dark"] .pill-ai            { background: #35202B; color: #F29CBF; }
[data-theme="dark"] .floating-pill:hover { box-shadow: 0 16px 32px rgba(0,0,0,0.45); }

/* about */
[data-theme="dark"] .about-photo { border-color: rgba(255,255,255,0.08); background: linear-gradient(135deg, #1F1B33 0%, #182238 100%); }

/* cards */
[data-theme="dark"] .work-card:hover,
[data-theme="dark"] .ov2:hover { box-shadow: 0 24px 50px -18px rgba(0,0,0,0.7); }
[data-theme="dark"] .ov2 { background: #1A1830; border-color: var(--border); }
[data-theme="dark"] .ov-art { filter: brightness(.94); }
[data-theme="dark"] .ov-fade-light::before { background: linear-gradient(180deg, rgba(13,14,18,0) 0%, rgba(13,14,18,0.8) 46%, rgba(13,14,18,0.96) 78%); }
[data-theme="dark"] .ov-fade-light .ov-title { color: #fff; }
[data-theme="dark"] .ov-fade-light .ov-desc { color: #D3D5DD; }
[data-theme="dark"] .ov-btn { color: var(--text-primary); background: rgba(27,30,38,0.85); border-color: rgba(255,255,255,0.1); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
[data-theme="dark"] .soon-badge { background: rgba(13,14,18,0.78); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
[data-theme="dark"] .is-soon:hover { box-shadow: 0 24px 50px -18px rgba(0,0,0,0.5); }
[data-theme="dark"] .vcg-card { border-color: var(--border); }
[data-theme="dark"] .vcg-card:hover { box-shadow: 0 28px 60px -20px rgba(0,0,0,0.75); }
[data-theme="dark"] .vcg-btn { background: var(--text-primary); border-color: transparent; color: #0D0E12; }

/* skills */
[data-theme="dark"] .skill-tag { border: 1px solid var(--border-strong); }
[data-theme="dark"] .skill-tag:hover { background: #232733; box-shadow: 0 10px 22px rgba(0,0,0,0.4); }

/* contact */
[data-theme="dark"] .contact-link { background: var(--bg-card); }

/* case-study popup */
[data-theme="dark"] .cs-overlay { background: rgba(5,6,10,0.72); }
[data-theme="dark"] .cs-modal { background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 40px 90px -30px rgba(0,0,0,0.8); }
[data-theme="dark"] .cs-close { background: rgba(27,30,38,0.92); color: var(--text-primary); box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
[data-theme="dark"] .cs-close:hover { background: #232733; }
[data-theme="dark"] .cs-tag { background: rgba(179,155,255,0.14); color: #C9B9FF; }
[data-theme="dark"] .cs-stat { background: var(--bg-page); }
[data-theme="dark"] .cs-figph { border-color: #3A3456; background: #19172A; color: #A99CD8; }
[data-theme="dark"] .cs-phase-a { background: #211B38; }
[data-theme="dark"] .cs-phase-a .cs-phase-label { color: #BEB2E8; }
[data-theme="dark"] .cs-phase-b { background: #172038; }
[data-theme="dark"] .cs-phase-b .cs-phase-days { color: #8FAEFF; }
[data-theme="dark"] .cs-phase-b .cs-phase-label { color: #A9B6D8; }

/* ============================================================
   DOT-GRID BACKGROUND (whole page, reacts to the pointer — see main.js)
============================================================ */
.dot-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }

/* ============================================================
   SHORT ABOUT
============================================================ */
.about-short { display: flex; align-items: center; gap: 24px; }
.about-short img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--bg-card); }
.about-short p { flex: 1; max-width: 640px; font-size: 20px; line-height: 1.6; color: var(--text-secondary); }
.about-short strong { color: var(--text-primary); font-weight: 600; }
.about-cue { margin-left: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; transition: color .2s; }
.about-cue:hover { color: var(--accent); }
.about-cue svg { width: 16px; height: 16px; animation: cue-bob 2s ease-in-out infinite; }
@keyframes cue-bob { 50% { transform: translateY(4px); } }

/* ============================================================
   WORK CARDS (compact: image, label, title, two-line text)
============================================================ */
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.wcard { position: relative; display: flex; flex-direction: column; padding: 10px; border-radius: 24px; background: var(--bg-card); border: 1px solid var(--border); color: inherit; transition: transform .45s var(--ease-gentle), border-color .3s ease, box-shadow .45s var(--ease-gentle); }
a.wcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 20px 44px -22px color-mix(in srgb, var(--accent) 50%, transparent); }
.wcard-img { position: relative; aspect-ratio: 2 / 1; border-radius: 16px; overflow: hidden; background: var(--bg-page); }
.wcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
a.wcard:hover .wcard-img img { transform: scale(1.05); }
.wcard-badge, .wcard-soon { position: absolute; top: 10px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.wcard-badge { left: 10px; background: var(--purple); color: #fff; }
.wcard-soon { right: 10px; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; background: rgba(250,250,252,0.94); color: #191919; }
.wcard-body { padding: 18px 10px 10px; }
.wcard-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); }
.wcard-body h3 { margin: 8px 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.3; color: var(--text-primary); transition: color .25s ease; }
a.wcard:hover h3 { color: var(--accent); }
.wcard-body p { font-size: 15px; line-height: 1.55; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wcard.is-soon { cursor: default; }
.wcard.is-soon .wcard-img img { filter: grayscale(1); opacity: .85; }
.wcard-game .wcard-img { background: #1C2649; display: grid; place-items: center; padding: 4% 6%; }
.wcard-game .wcard-img img { height: auto; object-fit: contain; }
[data-theme="dark"] .wcard-badge { color: #0D0E12; }
[data-theme="dark"] .wcard-game .wcard-img { background: #161B33; }

@media (max-width: 1023px) {
    .wgrid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 767px) {
    .wgrid { grid-template-columns: 1fr; }
    .about-short { flex-direction: column; text-align: center; gap: 16px; }
    .about-short p { font-size: 17px; }
    .about-cue { margin: 0 auto; align-self: center; }
}
@media (hover: none) { a.wcard:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .about-cue svg { animation: none; } }

/* ============================================================
   HERO — intro on the left, skill tiles on the right
============================================================ */
.hero2 { padding: 168px 0 96px; }
.hero2-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 48px; }
.hero2-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 80%, transparent); font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.hero2-status i { width: 7px; height: 7px; border-radius: 50%; background: #2FBF71; box-shadow: 0 0 0 0 rgba(47,191,113,.5); animation: status-ping 2.4s infinite; }
@keyframes status-ping { 70% { box-shadow: 0 0 0 7px rgba(47,191,113,0); } 100% { box-shadow: 0 0 0 0 rgba(47,191,113,0); } }
.hero2-title { margin: 0 0 18px; font-size: 60px; font-weight: 800; line-height: 1.08; letter-spacing: -2.2px; color: var(--text-primary); }
.hero2-role { display: block; color: var(--purple); white-space: nowrap; }
.hero2-role .tw { display: block; vertical-align: baseline; }
.hero2-role .tw-visible { justify-content: flex-start; }
.hero2-sub { max-width: 480px; font-size: 18px; line-height: 1.6; color: var(--text-secondary); }
.hero2-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 22px; }
.hero2-contact a { font-size: 16px; font-weight: 500; color: var(--accent); transition: color .2s; }
.hero2-contact a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.hero2-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero2-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: 999px; font-size: 15px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-primary); background: color-mix(in srgb, var(--bg-card) 70%, transparent); transition: transform .3s var(--ease-out), border-color .2s, background .2s; }
.hero2-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.hero2-btn svg { width: 16px; height: 16px; }
.hero2-btn-main { background: var(--purple); border-color: transparent; color: #fff; }
.hero2-btn-main:hover { background: var(--accent); border-color: transparent; }
[data-theme="dark"] .hero2-btn-main { color: #0D0E12; }

.hero2-skills { list-style: none; position: relative; height: 460px; }
.sk { --tint: #E5DEFB; --ink: #5B36C9; position: absolute; width: 51%; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 22px; background: var(--bg-card); border: 1px solid var(--border-strong); box-shadow: 0 22px 44px -20px rgba(20,20,50,.35); rotate: var(--r, 0deg); animation: sk-float 6s ease-in-out infinite; transition: border-color .3s ease, box-shadow .4s var(--ease-gentle), translate .5s var(--ease-gentle), rotate .5s var(--ease-gentle); }
.sk:nth-child(1) { left: 0;   top: 0;   --r: -6deg; z-index: 1; }
.sk:nth-child(2) { left: 49%; top: 5%;  --r: 5deg;  z-index: 2; }
.sk:nth-child(3) { left: 2%;  top: 31%; --r: 3deg;  z-index: 3; }
.sk:nth-child(4) { left: 50%; top: 36%; --r: -4deg; z-index: 4; }
.sk:nth-child(5) { left: 1%;  top: 62%; --r: -2deg; z-index: 5; }
.sk:nth-child(6) { left: 48%; top: 66%; --r: 6deg;  z-index: 6; }
.sk:nth-child(2) { animation-delay: -1s; } .sk:nth-child(3) { animation-delay: -2s; } .sk:nth-child(4) { animation-delay: -3s; } .sk:nth-child(5) { animation-delay: -4s; } .sk:nth-child(6) { animation-delay: -5s; }
.sk:hover { z-index: 10; rotate: 0deg; translate: 0 -8px; border-color: color-mix(in srgb, var(--ink) 45%, var(--border)); box-shadow: 0 26px 50px -20px color-mix(in srgb, var(--ink) 55%, transparent); }
.sk-ico { width: 44px; height: 44px; margin-bottom: 10px; border-radius: 13px; display: grid; place-items: center; background: var(--tint); color: var(--ink); transition: transform .4s var(--ease-out); }
.sk:hover .sk-ico { transform: rotate(-8deg) scale(1.06); }
.sk-ico svg { width: 22px; height: 22px; }
.sk b { font-size: 16px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.sk small { font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.sk-ds { --tint: #E5DEFB; --ink: #5B36C9; }
.sk-re { --tint: #FBE6D6; --ink: #C4571A; }
.sk-pr { --tint: #D2EFE2; --ink: #1F7A57; }
.sk-ai { --tint: #FBDCE9; --ink: #B5325E; }
.sk-pd { --tint: #D9EFD2; --ink: #2F7A1F; }
.sk-vd { --tint: #DCE6FD; --ink: #2144F5; }
[data-theme="dark"] .sk-ds { --tint: #231D3B; --ink: #C6B6FF; }
[data-theme="dark"] .sk-re { --tint: #33231A; --ink: #F0A679; }
[data-theme="dark"] .sk-pr { --tint: #132C25; --ink: #7FD6B1; }
[data-theme="dark"] .sk-ai { --tint: #35202B; --ink: #F29CBF; }
[data-theme="dark"] .sk-pd { --tint: #1A2C1A; --ink: #9BD68C; }
[data-theme="dark"] .sk-vd { --tint: #18223F; --ink: #8FAEFF; }
[data-theme="dark"] .sk { box-shadow: 0 24px 48px -18px rgba(0,0,0,.7); }
@keyframes sk-float { 50% { transform: translateY(-5px); } }

@media (max-width: 1023px) {
    .hero2 { padding: 140px 0 72px; }
    .hero2-grid { grid-template-columns: 1fr; gap: 56px; }
    .hero2-title { font-size: 52px; }
    .hero2-skills { max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767px) {
    .hero2 { padding: 116px 0 56px; }
    .hero2-title { font-size: 38px; letter-spacing: -1.4px; }
    .hero2-sub { font-size: 16px; }
    .hero2-skills { height: 420px; }
    .hero2-skills { height: 470px; }
    .sk { width: 52%; padding: 14px; border-radius: 18px; }
    .sk-ico { width: 38px; height: 38px; margin-bottom: 6px; }
    .sk b { font-size: 14.5px; }
    .sk small { font-size: 12px; }
}
@media (max-width: 380px) { .hero2-title { font-size: 33px; } }
@media (prefers-reduced-motion: reduce) { .sk, .hero2-status i { animation: none; } }

/* hero: skills orbiting the photo (the track spins, each pill counter-spins to stay upright) */
.orbit { --R: 196px; --spin: 60s; position: relative; width: 100%; max-width: 500px; aspect-ratio: 1; margin: 0 auto; }
.orbit-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.orbit-ring-out { width: calc(var(--R) * 2); height: calc(var(--R) * 2); border: 1px dashed var(--border-strong); }
.orbit-ring-in { width: calc(var(--R) * 1.2); height: calc(var(--R) * 1.2); border: 1px solid var(--border); background: radial-gradient(circle, color-mix(in srgb, var(--purple) 16%, transparent) 0%, transparent 70%); }
.orbit-photo { position: absolute; left: 50%; top: 50%; width: 176px; height: 176px; border-radius: 50%; object-fit: cover; transform: translate(-50%, -50%); border: 4px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-strong), 0 20px 60px -10px color-mix(in srgb, var(--purple) 45%, transparent); background: var(--bg-card); }
.orbit-track { list-style: none; position: absolute; inset: 0; animation: orbit-spin var(--spin) linear infinite; }
.orbit:hover .orbit-track, .orbit:hover .op-in { animation-play-state: paused; }
.op { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--R)) rotate(calc(var(--a) * -1)); }
.op-in { position: absolute; left: 0; top: 0; translate: -50% -50%; display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; border-radius: 999px; white-space: nowrap; font-size: 14.5px; font-weight: 700; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-strong); box-shadow: 0 14px 30px -14px rgba(20,20,50,.4); animation: orbit-spin var(--spin) linear infinite reverse; transition: border-color .3s ease, box-shadow .3s ease, scale .3s var(--ease-out); }
.op-in:hover { scale: 1.06; border-color: color-mix(in srgb, var(--ink) 50%, var(--border)); box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--ink) 60%, transparent); }
.op .sk-ico { width: 32px; height: 32px; margin: 0; border-radius: 50%; }
.op .sk-ico svg { width: 17px; height: 17px; }
[data-theme="dark"] .op-in { box-shadow: 0 14px 30px -12px rgba(0,0,0,.7); }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) {
    .orbit { --R: 116px; max-width: 320px; }
    .orbit-photo { width: 116px; height: 116px; border-width: 3px; }
    .op-in { font-size: 12.5px; gap: 7px; padding: 5px 12px 5px 5px; }
    .op .sk-ico { width: 26px; height: 26px; }
    .op .sk-ico svg { width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) { .orbit-track, .op-in { animation: none; } }

/* ---- hero v3: photo beside the full name, softer type, pills in staggered rows ---- */
.hero2-id { display: flex; align-items: center; gap: 20px; }
.hero2-id img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-strong), 0 12px 32px -10px color-mix(in srgb, var(--purple) 45%, transparent); background: var(--bg-card); }
.hero2-title { margin: 0; font-size: 42px; font-weight: 600; line-height: 1.15; letter-spacing: -0.8px; }
.hero2-hi { display: block; font-size: 18px; font-weight: 400; letter-spacing: 0; color: var(--text-secondary); margin-bottom: 2px; }
p.hero2-role { display: block; margin: 18px 0 14px; font-size: 38px; font-weight: 500; letter-spacing: -0.4px; line-height: 1.2; color: var(--purple); }
p.hero2-role .tw { display: block; }
.section-title { font-weight: 600; letter-spacing: -0.5px; }

.pills { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pills-row { display: flex; gap: 16px; }
.pills-row-1 { translate: -34px 0; }
.pills-row-2 { translate: 30px 0; }
.pills-row-3 { translate: -12px 0; }
.pills .op-in { position: static; translate: none; animation: pill-float 6s ease-in-out infinite; font-size: 16px; font-weight: 600; padding: 9px 22px 9px 9px; gap: 12px; }
.pills .sk-ico { width: 40px; height: 40px; margin: 0; border-radius: 50%; }
.pills .sk-ico svg { width: 19px; height: 19px; }
.pills .sk-pr { animation-delay: -1.5s; } .pills .sk-ds { animation-delay: -3s; } .pills .sk-ai { animation-delay: -4.5s; } .pills .sk-vd { animation-delay: -2.2s; } .pills .sk-pd { animation-delay: -5.2s; }
@keyframes pill-float { 50% { transform: translateY(-6px); } }
@media (max-width: 767px) {
    .hero2-id { gap: 14px; }
    .hero2-id img { width: 64px; height: 64px; }
    .hero2-title { font-size: 30px; letter-spacing: -0.5px; }
    .hero2-hi { font-size: 15px; }
    p.hero2-role { font-size: 29px; }
    .pills { gap: 12px; }
    .pills-row { gap: 10px; }
    .pills-row-1, .pills-row-2, .pills-row-3 { translate: 0 0; }
    .pills .op-in { font-size: 13.5px; padding: 6px 14px 6px 6px; gap: 8px; }
    .pills .sk-ico { width: 30px; height: 30px; }
    .pills .sk-ico svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) { .pills .op-in { animation: none; } }

/* ---- hero skills: tossed, tilted, draggable stickers ---- */
.toss { list-style: none; position: relative; height: 440px; }
.toss .op-in { position: absolute; translate: none; rotate: var(--r); font-size: 16px; font-weight: 600; padding: 9px 22px 9px 9px; gap: 12px; cursor: grab; touch-action: none; user-select: none; animation: toss-wobble 4.5s ease-in-out infinite var(--d, 0s); }
.toss .op-in.is-dragging { cursor: grabbing; animation-play-state: paused; scale: 1.08; rotate: 0deg; box-shadow: 0 24px 44px -14px color-mix(in srgb, var(--ink) 60%, transparent); border-color: color-mix(in srgb, var(--ink) 55%, var(--border)); transition: scale .2s var(--ease-out), rotate .2s var(--ease-out); }
.toss .sk-ico { width: 40px; height: 40px; margin: 0; border-radius: 50%; }
.toss .sk-ico svg { width: 19px; height: 19px; }
.toss .sk-ds { font-size: 18px; padding: 11px 26px 11px 11px; }
.toss .sk-ds .sk-ico { width: 46px; height: 46px; }
@keyframes toss-wobble { 0%, 100% { rotate: calc(var(--r) - 2deg); translate: 0 0; } 50% { rotate: calc(var(--r) + 2deg); translate: 0 -5px; } }
@media (max-width: 767px) {
    .toss { height: 300px; }
    .toss .op-in { font-size: 13.5px; padding: 6px 14px 6px 6px; gap: 8px; }
    .toss .sk-ds { font-size: 15px; padding: 7px 16px 7px 7px; }
    .toss .sk-ico, .toss .sk-ds .sk-ico { width: 30px; height: 30px; }
    .toss .sk-ico svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) { .toss .op-in { animation: none; } }

/* case study: play-the-game shortcut */
.cs-play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px !important; }
.cs-play-row span { font-size: 14px; color: var(--text-tertiary); }
.cs-play { display: inline-flex; align-items: center; gap: 8px; padding: 11px 28px 11px 22px; border-radius: 50px; background: var(--text-primary); color: var(--bg-page) !important; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .2s, transform .2s; }
.cs-play:hover { background: #fff; transform: translateY(-1px); }
[data-theme="light"] .cs-play:hover { background: #000; }
.cs-play svg { width: 15px; height: 15px; }
.cs-stat > span:first-child { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); }
.cs-stat b.cs-stat-txt { font-size: 15px; font-weight: 600; line-height: 1.35; }
.cs-stats.cs-stats-2 { grid-template-columns: repeat(2, 1fr); }

/* ---- hero visual: tossed draggable pills on desktop, the photo orbit on phones ---- */
.orbit { display: none; }

/* ---- mobile hero: the photo orbit on top, intro centred underneath ---- */
@media (max-width: 767px) {
    .hero2 { padding: 96px 0 48px; overflow-x: clip; }   /* the spinning pills never push the page sideways */
    .hero2-grid { display: flex; flex-direction: column; gap: 24px; }
    .toss { display: none; }
    .orbit { display: block; order: -1; --R: 100px; max-width: 280px; }
    /* phones: no small photo (it is in the orbit), "Hi, I'm" and the name on one line */
    .hero2-id { display: block; }
    .hero2-id img { display: none; }
    .hero2-title .hero2-hi { display: inline; font-size: inherit; font-weight: 400; letter-spacing: inherit; color: var(--text-secondary); margin: 0; }
    .orbit-photo { width: 104px; height: 104px; }
    .op-in { font-size: 11.5px; gap: 6px; padding: 4px 10px 4px 4px; }
    .op .sk-ico { width: 24px; height: 24px; }
    .op .sk-ico svg { width: 13px; height: 13px; }
    .hero2-text { text-align: center; }
    .hero2-title { font-size: 24px; letter-spacing: -0.4px; }
    p.hero2-role { font-size: 23px; margin: 10px 0 10px; }
    .hero2-role .tw-visible { justify-content: center; }
    .hero2-sub { font-size: 14.5px; max-width: 340px; margin: 0 auto; }
    .hero2-contact { align-items: center; gap: 4px; margin-top: 16px; }
    .hero2-contact a { font-size: 14.5px; }
    .hero2-cta { justify-content: center; margin-top: 20px; }
    .hero2-btn { height: 44px; padding: 0 20px; font-size: 14px; }
}
