/* ==========================================================================
   Harsh Shukla — portfolio
   Professional layout: warm paper background, Satoshi + Cabinet Grotesk,
   bordered cards, timeline, restrained motion. Plain CSS, no build step.
   Light by default; dark via system preference or the header toggle.
   ========================================================================== */

:root {
  --font: 'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #F6F5F1; --bg-alt: #EFEDE6; --surface: #FFFFFF; --text: #15171A; --text-2: #3D4148; --muted: #62666D;
  --border: #E3E0D7; --border-2: #CFCBBF; --accent: #0E6B53; --accent-hover: #0A5341; --accent-soft: #E1EFE8; --accent-text: #0C5F4A;
  --on-accent: #FFFFFF; --highlight: #E8A33D; --ring: rgba(14, 107, 83, .35);
  --wave-1: #E4EFE9; --wave-2: #CFE3D9; --wave-3: #B7D5C6;
  --success: #15803d; --shadow-sm: 0 1px 2px rgba(21, 23, 26, .05), 0 1px 3px rgba(21, 23, 26, .06); --shadow-md: 0 10px 28px rgba(21, 23, 26, .09);
  --radius: 14px;
  --container: 1120px;
  --header-h: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0F1211; --bg-alt: #131715; --surface: #171C1A; --text: #ECEEEA; --text-2: #C6CBC6; --muted: #949B96;
  --border: #262C2A; --border-2: #353D3A; --accent: #56C79B; --accent-hover: #74D3AC; --accent-soft: #16302A; --accent-text: #7BD8B3;
  --on-accent: #0B1F17; --highlight: #F0B455; --ring: rgba(86, 199, 155, .4);
  --wave-1: #141B18; --wave-2: #17231E; --wave-3: #1B2D25;
  --success: #4ade80; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 12px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; color: var(--text); font-family: var(--display); }
h1 { font-size: clamp(2.6rem, 1.8rem + 2.8vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.3vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.18rem; font-weight: 700; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); font-size: .82rem; letter-spacing: .01em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 32px; max-width: 640px; }
.section-head h2 { margin-bottom: 8px; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- Icons ---------- */
.icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Cards, buttons, chips ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1; padding: 12px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s, box-shadow .2s, translate .15s; }
.btn:hover { text-decoration: none; }
.btn:active { translate: 0 1px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-sm { padding: 9px 14px; font-size: .88rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .8rem; font-weight: 500; color: var(--text-2); background: var(--bg-alt); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; line-height: 1.4; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); transition: box-shadow .25s; }
.site-header.scrolled { box-shadow: 0 4px 16px rgba(11, 18, 32, .06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 700; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: .98rem; }
.brand-sub { font-size: .72rem; color: var(--muted); }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: .92rem; }
.site-nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.site-nav a.active { color: var(--accent-text); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.theme-btn .icon { width: 16px; height: 16px; }
.icon-moon, .icon-close { display: none; }
.theme-btn[aria-pressed="true"] .icon-sun { display: none; }
.theme-btn[aria-pressed="true"] .icon-moon { display: block; }
.nav-toggle { display: none; }
.nav-open .icon-menu { display: none; }
.nav-open .icon-close { display: block; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 56px; align-items: start; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 500; color: var(--text-2); background: var(--bg-alt); border: 1px solid var(--border); padding: 6px 12px 6px 10px; border-radius: 999px; margin-bottom: 22px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.hero h1 { margin-bottom: 14px; }
.tagline { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); font-weight: 500; line-height: 1.4; color: var(--text); max-width: 34ch; margin-bottom: 16px; }
.summary { color: var(--text-2); font-size: 1.05rem; max-width: 60ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero-links { display: grid; gap: 8px; }
.hero-links a { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .95rem; }
.hero-links a:hover { color: var(--accent-text); }
.hero-side { display: grid; gap: 18px; }
.photo { margin: 0; width: min(100%, 400px); aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); background: var(--bg-alt); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.facts { margin: 0; padding: 6px 20px; width: min(100%, 400px); }
.facts div { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.facts div:last-child { border-bottom: 0; }
.facts dt { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.facts dt .icon { color: var(--accent-text); }
.facts dd { margin: 0; font-weight: 500; font-size: .95rem; }

/* ---------- Metrics ---------- */
.metrics { padding: 24px 0 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.metric { padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 4px; }
.metric strong { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.metric-label { font-weight: 600; font-size: .95rem; margin-top: 4px; }
.metric-desc { color: var(--muted); font-size: .85rem; line-height: 1.4; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.prose p { font-size: 1.05rem; color: var(--text-2); }
.competencies { padding: 22px 24px; }
.competencies h3 { margin-bottom: 14px; font-size: 1rem; }
.checklist { display: grid; gap: 12px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: var(--text-2); }
.checklist .icon { color: var(--success); margin-top: .2em; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 22px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-2); }
.tl-item { position: relative; }
.tl-marker { position: absolute; left: -28px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-alt); box-shadow: 0 0 0 2px var(--accent); }
.tl-card { padding: 24px 26px; }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-bottom: 16px; }
.tl-org { color: var(--text-2); font-weight: 500; margin: 4px 0 0; }
.tl-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.bullets { display: grid; gap: 10px; margin-bottom: 18px; }
.bullets li { position: relative; padding-left: 20px; color: var(--text-2); }
.bullets li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .7; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project { display: flex; flex-direction: column; overflow: hidden; transition: translate .2s, box-shadow .2s, border-color .2s; }
.project:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }
.project.featured { grid-column: span 2; flex-direction: row; }
.project.featured .cover { width: 46%; flex: none; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--border); }
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-size: 1.12rem; }
.project-body p { color: var(--text-2); margin: 0; flex: 1; font-size: .95rem; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.cover-link { display: block; }
.cover-img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.cover { position: relative; aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 24px; color: #fff; border-bottom: 1px solid var(--border); overflow: hidden; }
.cover::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 28px 28px; }
.cover-thinkexam { background: linear-gradient(135deg, #0B4A3A 0%, #0E6B53 60%, #1B8A6B 100%); }
.cover-mern { background: linear-gradient(135deg, #3A2E1E 0%, #6B4A1F 55%, #A8701E 100%); }
.cover > * { position: relative; }
.cover-badge { position: absolute; top: 16px; left: 20px; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.cover-title { font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.cover-sub { font-size: .95rem; opacity: .9; margin-top: 4px; }
.cover-stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cover-stack li { font-family: var(--mono); font-size: .74rem; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.project.featured .cover-title { font-size: 2.4rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.skill-group { padding: 20px 22px; }
.skill-group h3 { font-size: .95rem; margin-bottom: 12px; }
.skill-group:nth-child(4) { grid-column: span 2; }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.edu { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 22px 24px; }
.edu-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.edu-icon .icon { width: 22px; height: 22px; }
.edu h3 { margin-bottom: 2px; }
.edu .tl-org { margin: 0 0 6px; }
.edu p:last-child { margin: 8px 0 0; color: var(--text-2); font-size: .95rem; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 36px 40px; }
.contact h2 { margin-bottom: 8px; }
.contact p { color: var(--text-2); margin: 0; max-width: 46ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-2); font-weight: 500; }

.back-top { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow-md); display: grid; place-items: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s; }
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top .icon { width: 18px; height: 18px; }

/* ---------- Motion & interaction layer ----------
   Nothing here hides content by default. GSAP (loaded from a CDN) animates
   elements FROM hidden states at runtime, so if the CDN or JS fails the page
   is simply static and fully visible. ---------------------------------------- */

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--highlight)); z-index: 300; pointer-events: none; }

/* cursor-lit dot grid behind the hero */
.hero { position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  --dot: color-mix(in srgb, var(--accent) 45%, transparent);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(420px circle at var(--mx, 70%) var(--my, 35%), rgba(0,0,0,.9), rgba(0,0,0,.18) 45%, transparent 75%);
  mask-image: radial-gradient(420px circle at var(--mx, 70%) var(--my, 35%), rgba(0,0,0,.9), rgba(0,0,0,.18) 45%, transparent 75%);
  transition: -webkit-mask-position .2s, mask-position .2s; }
.hero .container { position: relative; z-index: 1; }

/* split text */
.split-chars .ch, .split-words .wd { display: inline-block; white-space: pre; }
.split-chars .wrd, .split-words .wrd { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .12em; margin-bottom: -.12em; }

/* photo: 3D tilt + shine */
.photo { position: relative; transform-style: preserve-3d; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s ease, box-shadow .4s ease; will-change: transform; }
.photo:hover { box-shadow: 0 20px 50px rgba(11, 18, 32, .16); }
.photo .shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(360px circle at var(--sx, 50%) var(--sy, 50%), rgba(255,255,255,.28), transparent 60%); }
.photo:hover .shine { opacity: 1; }

/* status dot pulse */
.status-dot { position: relative; }
.status-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: .6; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }

/* sliding nav indicator */
.site-nav ul { position: relative; }
.nav-indicator { position: absolute; top: 0; left: 0; height: 100%; width: 0; border-radius: 8px; background: var(--accent-soft); opacity: 0; transition: left .35s cubic-bezier(.22,.61,.36,1), width .35s cubic-bezier(.22,.61,.36,1), opacity .25s; pointer-events: none; }
.nav-indicator.on { opacity: 1; }
.site-nav a { position: relative; z-index: 1; background: transparent !important; }

/* section headings draw an underline */
.section-head h2 { position: relative; display: inline-block; padding-bottom: 8px; }
.section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; border-radius: 2px; background: var(--accent); transition: width .7s cubic-bezier(.22,.61,.36,1); }
.section-head.in h2::after { width: 56px; }

/* spotlight cards (cursor-following highlight + lift) */
.spot { position: relative; overflow: hidden; }
.spot::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%); }
.spot:hover::after { opacity: 1; }
.metric, .skill-group { transition: translate .25s, box-shadow .25s, border-color .25s; }
.metric:hover, .skill-group:hover { translate: 0 -3px; box-shadow: var(--shadow-md); border-color: var(--border-2); }
.project.tilt { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s ease, translate .3s ease, box-shadow .3s, border-color .3s; }
.project:hover { translate: 0 -4px; }

/* screenshots pan slowly on hover */
.cover-link { overflow: hidden; display: block; }
.cover-img { transition: transform 3.5s cubic-bezier(.2,.6,.2,1); transform-origin: top center; }
.project:hover .cover-img { transform: scale(1.06) translateY(-3%); }
.cover::before { animation: gridDrift 18s linear infinite; }
@keyframes gridDrift { to { background-position: 28px 28px; } }

/* chips + checks */
.chips li { transition: translate .2s, background .2s, color .2s, border-color .2s; }
.chips li:hover { translate: 0 -2px; border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.checklist .icon { stroke-dasharray: 30; stroke-dashoffset: 0; }

/* timeline line drawn by scroll */
.timeline::before { display: none; }
.tl-line { position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--border-2)); transform-origin: top; border-radius: 2px; }
.tl-card { transition: translate .25s, box-shadow .25s; }
.tl-card:hover { translate: 4px 0; box-shadow: var(--shadow-md); }

/* buttons: sheen sweep + magnetic */
.btn { position: relative; overflow: hidden; }
.btn::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg) translateX(-120%); transition: transform .7s ease; }
.btn:hover::before { transform: skewX(-20deg) translateX(400%); }
.btn-secondary::before { background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 12%, transparent), transparent); }
.magnetic { transition: transform .25s cubic-bezier(.22,.61,.36,1), background .2s, color .2s, border-color .2s, box-shadow .2s; }

/* link arrow nudge */
.link .icon, .hero-links .icon { transition: transform .25s; }
.link:hover .icon { transform: translate(2px, -2px); }
.hero-links a:hover .icon { transform: translateX(3px); }

/* back-to-top with progress ring */
.back-top { width: 48px; height: 48px; border-radius: 50%; overflow: visible; }
.back-top .ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); }
.ring-track, .ring-fill { fill: none; stroke-width: 2.5; }
.ring-track { stroke: var(--border); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 125.66; stroke-dashoffset: 125.66; transition: stroke-dashoffset .15s linear; }
.back-top:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* theme change: circular wipe via the View Transitions API */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status-dot::after, .cover::before { animation: none; }
  .btn::before { display: none; }
  .cover-img, .photo, .project, .project.tilt, .tl-card, .chips li, .metric, .skill-group, .nav-indicator, .section-head h2::after, .ring-fill, .toast, .magnetic, .btn { transition: none; }
}

/* ---------- Intro loader (only shown when JS + GSAP run) ---------- */
.loader { display: none; }
.js.anim .loader { display: flex; position: fixed; inset: 0; z-index: 1000; background: var(--text); color: var(--bg); align-items: center; justify-content: center; }
.loader-inner { display: flex; align-items: baseline; gap: 18px; font-weight: 700; }
.loader-mark { font-size: 1rem; letter-spacing: .2em; opacity: .7; }
.loader-count { font-family: var(--mono); font-size: clamp(3rem, 8vw, 6rem); font-weight: 500; font-variant-numeric: tabular-nums; min-width: 3ch; }
.loader-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }

/* ---------- Custom cursor (fine pointers only) ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 999; pointer-events: none; }
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-ring { width: 34px; height: 34px; border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent); display: grid; place-items: center; transition: width .3s cubic-bezier(.22,.61,.36,1), height .3s cubic-bezier(.22,.61,.36,1), background .3s, border-color .3s; }
.cursor-ring em { font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-accent); opacity: 0; transition: opacity .2s; }
.cursor.hover .cursor-ring { width: 54px; height: 54px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cursor.label .cursor-ring { width: 84px; height: 84px; background: var(--accent); border-color: var(--accent); }
.cursor.label .cursor-ring em { opacity: 1; }
.cursor.label .cursor-dot { opacity: 0; }
.cursor.down .cursor-ring { width: 26px; height: 26px; }
.has-cursor .cover-link { cursor: none; }

/* heading word rise */
.section-head h2 .hw { display: inline-block; overflow: hidden; vertical-align: bottom; }
.section-head h2 .hw > span { display: inline-block; }
/* project image wipe */
.cover-link, .project .cover { will-change: clip-path; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- Layered wave behind the hero (Haikei-style SVG) ---------- */
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(90px, 14vw, 190px); z-index: 0; pointer-events: none; display: block; }
.hero-wave .w1 { fill: var(--wave-1); } .hero-wave .w2 { fill: var(--wave-2); } .hero-wave .w3 { fill: var(--wave-3); }
.hero { padding-bottom: clamp(100px, 13vw, 180px); }
.metrics { background: var(--wave-3); padding-top: 4px; padding-bottom: 36px; }
.contact { position: relative; overflow: hidden; }
.contact-blob { position: absolute; right: -80px; top: -90px; width: 340px; height: 340px; z-index: 0; pointer-events: none; }
.contact-blob path { fill: var(--accent-soft); }
.contact > *:not(.contact-blob) { position: relative; z-index: 1; }

/* ---------- Tech marquee (Magic UI-style) ---------- */
.stack-strip { padding: 40px 0 0; }
.stack-label { text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 12px; padding-right: 12px; }
.marquee li { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .95rem; color: var(--text-2); }
.marquee li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.marquee li:nth-child(3n)::before { background: var(--highlight); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Border beam on the featured project (Magic UI-style) ---------- */
@property --beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.project.featured { position: relative; isolation: isolate; }
.project.featured::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 3; pointer-events: none;
  background: conic-gradient(from var(--beam), transparent 0deg, transparent 290deg, var(--highlight) 320deg, var(--accent) 345deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 6s linear infinite; }
@keyframes beam { to { --beam: 360deg; } }

/* ---------- Theme switch (Uiverse-style) ---------- */
.theme-btn { gap: 10px; padding: 0 12px 0 6px; }
.theme-btn > .icon { display: none !important; }
.theme-track { position: relative; width: 50px; height: 28px; border-radius: 999px; background: linear-gradient(180deg, #CFE6F5, #F6E7C1); box-shadow: inset 0 1px 3px rgba(0,0,0,.15); transition: background .4s; flex: none; }
.theme-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #F2B437; box-shadow: 0 1px 3px rgba(0,0,0,.25); display: grid; place-items: center; transition: transform .45s cubic-bezier(.68,-0.35,.27,1.35), background .4s; }
.theme-knob .icon { width: 13px; height: 13px; color: #7A4A00; }
.theme-btn[aria-pressed="true"] .theme-track { background: linear-gradient(180deg, #1B2A3A, #2C2448); }
.theme-btn[aria-pressed="true"] .theme-knob { transform: translateX(22px); background: #E9EEF5; }
.theme-btn[aria-pressed="true"] .theme-knob .icon { color: #39465A; }
.theme-track .stars { position: absolute; left: 9px; top: 7px; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 6px 8px 0 -0.5px #fff, 1px 13px 0 -1px #fff; opacity: 0; transition: opacity .4s; }
.theme-btn[aria-pressed="true"] .stars { opacity: .9; }

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .project.featured::before { animation: none; }
  .theme-knob { transition: none; }
}

/* ==========================================================================
   Interaction pass inspired by 21st.dev patterns (rebuilt in plain CSS/JS)
   ========================================================================== */

/* ---- Kinetic grid canvas behind the hero ---- */
.kinetic { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.has-kinetic .hero-bg { display: none; }

/* ---- Word rotate line ---- */
.rotator { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4em; font-family: var(--display); font-weight: 700; font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); color: var(--text-2); margin: -4px 0 14px; }
.rot-wrap { position: relative; display: inline-grid; overflow: hidden; vertical-align: bottom; color: var(--accent-text); padding: 0 .1em; }
.rot-wrap::after { content: ""; position: absolute; left: 0; right: 0; bottom: .08em; height: .32em; background: color-mix(in srgb, var(--highlight) 38%, transparent); z-index: -1; border-radius: 3px; }
.rot-word { grid-area: 1 / 1; white-space: nowrap; }
.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; }

/* ---- Marker highlight ---- */
.hl { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--highlight) 45%, transparent) 58%) no-repeat 0 0 / 0% 100%; color: inherit; padding: 0 .08em; transition: background-size 1.1s cubic-bezier(.22,.61,.36,1); }
.hl.on, .no-anim .hl { background-size: 100% 100%; }

/* ---- Floating pill navbar on scroll ---- */
.site-header { transition: background .35s, border-color .35s, box-shadow .35s; }
.header-inner { transition: max-width .45s cubic-bezier(.22,.61,.36,1), height .35s, margin .35s, padding .35s, border-radius .45s, background .35s, box-shadow .35s, border-color .35s; border: 1px solid transparent; }
@media (min-width: 801px) {
  .site-header.scrolled { background: transparent; border-bottom-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-header.scrolled .header-inner { max-width: 1000px; height: 56px; margin-top: 10px; padding: 0 8px 0 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 82%, transparent); border-color: var(--border); box-shadow: 0 10px 30px rgba(21, 23, 26, .10);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
  .site-header.scrolled .brand-sub { display: none; }
  .site-header.scrolled .brand-mark { border-radius: 50%; }
  .site-header.scrolled .theme-btn, .site-header.scrolled .header-cta { border-radius: 999px; }
}

/* ---- Letter swap on nav links ---- */
.ls { display: inline-flex; flex-direction: column; height: 1.25em; line-height: 1.25em; overflow: hidden; vertical-align: top; }
.ls-row { display: inline-flex; }
.ls-row span { display: inline-block; transition: transform .38s cubic-bezier(.22,.61,.36,1); transition-delay: calc(var(--i) * 18ms); white-space: pre; }
.site-nav a:hover .ls-row span, .site-nav a:focus-visible .ls-row span { transform: translateY(-100%); }

/* ---- Flow buttons: direction-aware fill ---- */
.btn { isolation: isolate; }
.btn::after { content: ""; position: absolute; left: var(--fx, 50%); top: var(--fy, 50%); width: 0; height: 0; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--fill, var(--accent)); z-index: -1; transition: width .5s cubic-bezier(.22,.61,.36,1), height .5s cubic-bezier(.22,.61,.36,1); pointer-events: none; }
.btn:hover::after, .btn:focus-visible::after { width: 260%; height: 600%; }
.btn-secondary:hover, .btn-secondary:focus-visible { color: var(--on-accent); border-color: var(--accent); }
.btn-primary { --fill: var(--accent-hover); }
.btn .icon { transition: transform .35s cubic-bezier(.22,.61,.36,1); }
.btn:hover .icon { transform: translateX(2px) rotate(-8deg); }

/* ---- Stacking project cards (desktop) ---- */
@media (min-width: 1025px) {
  .stack .project-grid { display: block; }
  .stack .project { scale: var(--s, 1); filter: brightness(var(--b, 1)); position: sticky; top: calc(var(--header-h) + 18px + var(--i, 0) * 18px); flex-direction: row; min-height: 360px; margin: 0 0 32px; transform-origin: 50% 0;
    box-shadow: 0 18px 40px rgba(21, 23, 26, .10); }
  .stack .project > .cover, .stack .project > .cover-link { width: 46%; flex: none; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--border); }
  .stack .project > .cover-link .cover-img, .stack .project > .cover-link picture, .stack .project > .cover-link img { height: 100%; aspect-ratio: auto; border-bottom: 0; }
  .stack .project-body { padding: 28px 30px; justify-content: center; }
  .stack .project-body h3 { font-size: 1.5rem; }
  .stack .project:last-child { margin-bottom: 0; }
}

/* ---- Velocity marquee (JS-driven) ---- */
.marquee-track.js-driven { animation: none; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .hl { background-size: 100% 100%; transition: none; }
  .ls-row span, .btn::after, .header-inner { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project.featured { flex-direction: column; }
  .project.featured .cover { width: auto; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--border); }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-group:nth-child(4) { grid-column: auto; }
  .skill-group:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .photo { width: 100%; max-width: 320px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding: 28px; }
  .contact-actions { justify-content: flex-start; }
}
@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .theme-btn #theme-label { display: none; }
  .theme-btn { padding: 0 8px; justify-content: center; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 8px 16px 14px; display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { padding: 12px 12px; font-size: 1.02rem; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 60px 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hero-side { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .project.featured { grid-column: auto; }
  .edu-grid { grid-template-columns: 1fr; }
  .tl-meta { align-items: flex-start; text-align: left; }
  .hero-actions .btn, .contact-actions .btn { width: 100%; justify-content: center; }
  .timeline { padding-left: 24px; }
  .tl-marker { left: -24px; }
  .tl-card { padding: 20px; }
  .brand-sub { display: none; }
}
