/* =====================================================================
   Aylin Arvin — portfolio
   Plain HTML + CSS (+ a little vanilla JS for interaction).
   Minimal blue & white · deep-navy dark mode · one accent, hairline
   borders, no glass/glow. Sections: 1 Fonts · 2 Tokens · 3 Base · 4 Layout
   5 Atoms · 6 Nav · 7 Hero + stage · 8 Marquee/Stats · 9 Services
   10 Skills · 11 Work · 12 Education · 13 Contact · 14 Footer · 15 RWD/a11y
   ===================================================================== */

/* ---------- 1. Fonts (Persian: self-hosted Peyda) ---------- */
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Thin.woff') format('woff');       font-weight: 100; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-ExtraLight.woff') format('woff'); font-weight: 200; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Light.woff') format('woff');      font-weight: 300; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Regular.woff') format('woff');    font-weight: 400; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Medium.woff') format('woff');     font-weight: 500; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-SemiBold.woff') format('woff');   font-weight: 600; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Bold.woff') format('woff');       font-weight: 700; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-ExtraBold.woff') format('woff');  font-weight: 800; font-display: swap; }
@font-face { font-family: 'Peyda'; src: url('../assets/fonts/Peyda-Black.woff') format('woff');      font-weight: 900; font-display: swap; }

/* ---------- 2. Design tokens ---------- */
:root {
  --bg: #0a0f1c;
  --surface: #0e1425;
  --surface-2: #121a2e;
  --text: #eef3fb;
  --muted: #98a8c2;
  --dim: #66778f;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --nav-bg: rgba(10, 15, 28, .8);

  --accent: #5b9bff;
  --accent-soft: rgba(91, 155, 255, .12);
  --btn: #2f6df0;
  --on-btn: #ffffff;
  --glow: rgba(91, 155, 255, .22);
  --ring-track: rgba(255, 255, 255, .1);
  --shadow: 0 24px 48px -32px rgba(0, 0, 0, .7);

  --r: 16px;
  --r-sm: 10px;
  --nav-h: 72px;

  --ff: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-mono: 'JetBrains Mono', 'Peyda', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .75, .2, 1);

  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #f6f9fe;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --text: #0b1730;
  --muted: #55647e;
  --dim: #8794aa;
  --line: rgba(11, 23, 48, .09);
  --line-2: rgba(11, 23, 48, .18);
  --nav-bg: rgba(246, 249, 254, .84);
  --accent: #1f6bff;
  --accent-soft: rgba(31, 107, 255, .1);
  --btn: #1f6bff;
  --glow: rgba(31, 107, 255, .2);
  --ring-track: rgba(11, 23, 48, .09);
  --shadow: 0 24px 40px -30px rgba(20, 50, 110, .25);
  color-scheme: light;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.65 var(--ff);
  font-feature-settings: 'cv11', 'ss03';
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
}
html[lang='fa'] body, html[lang='fa'] .btn, html[lang='fa'] button { font-family: 'Peyda', var(--ff); }
html[lang='fa'] * { letter-spacing: 0 !important; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.mono { font-family: var(--ff-mono); }
.ltr { direction: ltr; unicode-bidi: isolate; }
.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip { position: fixed; inset-inline-start: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 8px; background: var(--btn); color: var(--on-btn); transition: top .2s; }
.skip:focus { top: 12px; }

.scroll-progress { position: fixed; top: 0; inset-inline: 0; height: 2px; z-index: 120; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--accent); }
html[dir='rtl'] .scroll-progress { transform-origin: 100% 50%; }

/* one quiet light source at the top of the page — the only "atmosphere" */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 50% -12%, var(--accent-soft), transparent 70%); }

/* ---------- 4. Layout ---------- */
.container { width: min(1160px, 100% - 48px); margin-inline: auto; }
.container--narrow { width: min(780px, 100% - 48px); }
.section { position: relative; padding: clamp(72px, 10vw, 128px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section__head { max-width: 700px; margin-bottom: clamp(32px, 5vw, 56px); }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.eyebrow b { font-weight: 500; color: var(--dim); }
.eyebrow b::after { content: ''; display: inline-block; width: 24px; height: 1px; margin-inline-start: 12px; vertical-align: middle; background: var(--line-2); }
.eyebrow--center { justify-content: center; }
.section__title { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.08; font-weight: 600; letter-spacing: -.03em; }
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid > .reveal > .card, .grid > .reveal > .project { height: 100%; }

/* scroll reveal (only when JS is on) */
.js .reveal { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .75s var(--ease), transform .75s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 5. UI atoms ---------- */
.grad { color: var(--accent); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap; background: transparent; color: var(--text);
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s, box-shadow .25s; }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--lg { padding: 16px 26px; font-size: 16px; }
.btn--primary { color: var(--on-btn); background: var(--btn); border-color: var(--btn); }
.btn--primary:hover { background: color-mix(in srgb, var(--btn) 86%, #000); border-color: color-mix(in srgb, var(--btn) 86%, #000); box-shadow: 0 12px 24px -14px var(--glow); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:hover { transform: translateY(-1px); }
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translate(2px, -2px); }
html[dir='rtl'] .btn:hover .ico { transform: translate(-2px, -2px); }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: transparent; border: 1px solid var(--line); transition: border-color .25s, color .25s, background .25s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn--text { font: 600 12.5px var(--ff-mono); letter-spacing: .06em; }
#themeBtn .ico--sun { display: none; }
html[data-theme='light'] #themeBtn .ico--moon { display: none; }
html[data-theme='light'] #themeBtn .ico--sun { display: block; }

.badge { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 12.5px var(--ff-mono); color: var(--muted); margin-bottom: 26px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: pulse 2.2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.socials { display: flex; gap: 8px; }
.socials a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--muted); transition: border-color .25s, color .25s, transform .25s var(--ease); }
.socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); }

/* panel surface — on a pseudo so children can translateZ without clipping */
.card, .stat, .project { position: relative; border-radius: var(--r); }
.card::before, .project::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.card:hover::before, .project:hover::before { border-color: var(--line-2); box-shadow: var(--shadow); }

/* 3D tilt (JS sets --tx/--ty/--gx/--gy/--go); the 1px border lights up under the cursor */
.tilt { transform-style: preserve-3d; transform: perspective(1100px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform .35s var(--ease); will-change: transform; }
.tilt::after { content: ''; position: absolute; inset: -1px; z-index: 3; border-radius: inherit; padding: 1px; pointer-events: none; opacity: var(--go, 0); transition: opacity .35s;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), var(--accent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.tilt.is-active { transition: transform .08s linear; }

/* ---------- 6. Nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s, height .3s; }
.nav.is-scrolled { background: var(--nav-bg); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-color: var(--line); height: 62px; }
.nav__inner { display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand__mark { border-radius: 0; }
.nav__links { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav__links a { position: relative; padding: 8px 14px; border-radius: 8px; font-size: 14.5px; color: var(--muted); transition: color .25s; }
.nav__links a::after { content: ''; position: absolute; inset-inline: 14px; bottom: 4px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s var(--ease); }
html[dir='rtl'] .nav__links a::after { transform-origin: 100% 50%; }
.nav__links a:hover, .nav__links a[aria-current='true'] { color: var(--text); }
.nav__links a[aria-current='true']::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.nav__cta { margin-inline-start: 4px; }
.burger { display: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger span { width: 18px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease); }
.burger[aria-expanded='true'] span:first-child { transform: translateY(3.8px) rotate(45deg); }
.burger[aria-expanded='true'] span:last-child { transform: translateY(-3.8px) rotate(-45deg); }

/* ---------- 7. Hero + 3D stage ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: calc(var(--nav-h) + 24px) 0 80px; overflow-x: clip; }
/* faint dot grid, fading out towards the edges */
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1.5px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000, transparent 72%); mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000, transparent 72%); }
/* name rises word by word on load / language switch */
.hero__title .w { display: inline-block; overflow: hidden; padding: .25em .06em 0; margin: -.25em -.06em 0; vertical-align: top; }
.hero__title .w > span { display: inline-block; transform: translateY(110%); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes rise { to { transform: none; } }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: center; }
.hero__grid > * { min-width: 0; }
.hero__title { font-weight: 700; line-height: 1; letter-spacing: -.04em; margin-bottom: 20px; }
.hero__hi { display: block; font-size: clamp(17px, 1.7vw, 22px); font-weight: 500; letter-spacing: -.01em; color: var(--muted); margin-bottom: 10px; }
.hero__title .grad { display: block; font-size: clamp(44px, 6vw, 84px); color: var(--text); padding-bottom: .06em; }
/* room above the line for Persian marks (madda on آ, dots) */
html[lang='fa'] .hero__title { line-height: 1.15; }
html[lang='fa'] .hero__title .grad { padding-top: .22em; margin-top: -.12em; padding-bottom: .12em; }
.hero__role { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: clamp(15px, 1.5vw, 19px); color: var(--accent); margin-bottom: 22px; direction: ltr; justify-content: flex-start; }
html[dir='rtl'] .hero__role { direction: rtl; }
.hero__prompt { color: var(--dim); }
.caret { width: 2px; height: 1.15em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { max-width: 52ch; font-size: clamp(15.5px, 1.25vw, 17.5px); color: var(--muted); margin-bottom: 32px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }

/* stage: layers are absolutely centred so RTL/LTR and narrow screens can't push them sideways */
.stage { position: relative; min-height: 600px; perspective: 1500px; perspective-origin: 50% 42%; }
.stage > .scene, .stage > .flat { position: absolute; left: 50%; top: 50%; width: 440px; height: 540px; margin: -270px 0 0 -220px; pointer-events: none; }
.scene { transform-style: preserve-3d; transform: translate3d(0, var(--sy, 0px), 0) rotateX(calc(var(--rx, 0deg) + var(--sr, 0deg))) rotateY(var(--ry, 0deg)); }
.stage > .scene--back { z-index: 1; }
.stage > .flat { z-index: 3; }
.stage > .scene:not(.scene--back) { z-index: 2; }
.layer { position: absolute; transform: translateZ(var(--z, 0px)); transform-style: preserve-3d; }

.ring { inset: 14px -34px auto -34px; height: 500px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 50%; opacity: .45;
  transform: translateZ(var(--z)) rotateX(74deg); animation: ring 26s linear infinite; }
@keyframes ring { to { transform: translateZ(var(--z)) rotateX(74deg) rotateZ(360deg); } }
.ring__dot { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px 2px var(--glow); }

.portrait { position: absolute; left: 70px; top: 58px; width: 300px; height: 400px; border-radius: 22px; }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.portrait::before { content: ''; position: absolute; inset: -1px; z-index: 0; border-radius: 23px; box-shadow: var(--shadow);
  background: conic-gradient(from var(--a), transparent 0 62%, var(--accent) 80%, transparent 96%) border-box, var(--line-2);
  animation: sweep 7s linear infinite; }
@keyframes sweep { to { --a: 360deg; } }
.portrait img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
.portrait__tag { position: absolute; z-index: 3; inset-inline-start: 16px; bottom: 16px; padding: 7px 11px; border-radius: 8px; font-size: 12px; color: #fff; background: rgba(8, 12, 24, .62); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); direction: ltr; text-align: left; }

.code { left: -56px; bottom: -64px; width: 262px; border-radius: 12px; background: #0b1120; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 30px 50px -26px rgba(0, 0, 0, .8); direction: ltr; text-align: left; color: #d7dbf5;
  transform: translateZ(var(--z)) rotateY(8deg) rotateX(-2deg); }
html[data-theme='light'] .code { border-color: rgba(11, 23, 48, .2); box-shadow: 0 30px 50px -26px rgba(20, 50, 110, .5); }
.code__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 11px; color: #7f8aa3; }
.code__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.code__bar span { margin-inline-start: 6px; }
.code__body { margin: 0; padding: 12px 14px 14px; font-size: 11.5px; line-height: 1.7; white-space: pre; overflow: hidden; }
/* lines are "typed" in one after another; a cursor blinks at the end */
.code__body .ln { display: block; opacity: 0; transform: translateX(-6px); animation: ln .5s var(--ease) forwards; animation-delay: calc(var(--i) * 160ms + 600ms); }
@keyframes ln { to { opacity: 1; transform: none; } }
.code__body .ln:last-child::after { content: ''; display: inline-block; width: 6px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.code .k { color: #8ab6ff; } .code .v { color: #eef3fb; } .code .p { color: #9fb0c9; } .code .s { color: #7fdbca; }

/* ---------- 8. Marquee + Stats ---------- */
.marquee { position: relative; overflow: hidden; direction: ltr; padding: 16px 0; border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: 10px; padding-inline: 22px; font: 500 12.5px var(--ff-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.marquee__item img { width: 18px; height: 18px; object-fit: contain; opacity: .85; }
.marquee__item::after { content: ''; width: 4px; height: 4px; border-radius: 50%; margin-inline-start: 22px; background: var(--line-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

.stats { padding: clamp(40px, 6vw, 72px) 0 0; }
.stats__grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.stat { padding: 30px 32px; display: grid; gap: 6px; border-radius: 0; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat__num { font-size: clamp(36px, 4vw, 54px); font-weight: 600; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; display: inline-block; justify-self: start; direction: ltr; }
.stat__label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- 9. Services ---------- */
.svc { padding: 30px 28px 28px; display: grid; gap: 14px; align-content: start; min-height: 300px; }
.svc__idx { position: absolute; top: 24px; inset-inline-end: 26px; font-size: 12px; color: var(--dim); letter-spacing: .1em; }
.svc__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 22px; transform: translateZ(30px); }
.svc h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; transform: translateZ(18px); }
.svc p { color: var(--muted); font-size: 15.5px; transform: translateZ(10px); }
.svc .tags { margin-top: 4px; transform: translateZ(14px); }

/* ---------- 10. Skills — all visible at once ---------- */
@property --v { syntax: '<number>'; inherits: false; initial-value: 0; }
.skills-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.skills-grid > .reveal { flex: 0 1 calc(25% - 15px); min-width: 220px; }
.skill { height: 100%; min-height: 280px; padding: 20px 22px 22px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; }
.skill > * { position: relative; }
.skill__top { display: flex; justify-content: space-between; align-items: center; transform: translateZ(10px); }
.skill__idx { font-size: 12px; color: var(--dim); letter-spacing: .1em; }
.skill__tag { font-size: 10.5px; letter-spacing: .14em; padding: 3px 9px; border-radius: 999px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); direction: ltr; }

.skill__plate { justify-self: start; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); transform: translateZ(34px); transition: transform .45s var(--ease), border-color .3s; }
.skill:hover .skill__plate { border-color: var(--line-2); transform: translateZ(48px); }
.skill__plate img { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }

.skill__name { align-self: end; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; transform: translateZ(20px); }

.skill__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); transform: translateZ(14px); }
.skill__lv { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.skill__lvl { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: .16em; color: var(--dim); }

/* gauge: the ring lives on ::before so its mask doesn't also hide the number */
.skill__ring { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; direction: ltr; }
.skill__ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; --v: 0;
  background: conic-gradient(from -90deg, var(--accent) calc(var(--v) * 1%), var(--ring-track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  transition: --v 1.6s var(--ease) .3s; }
.reveal.in .skill__ring::before { --v: var(--p); }
.skill__ring b { position: relative; z-index: 1; font-size: 14px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }

/* ---------- 11. Work ---------- */
.project { display: grid; gap: 0; padding: 10px; }
.browser { position: relative; transform-style: preserve-3d; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.browser__bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.browser__url { flex: 1; margin-inline-start: 8px; padding: 4px 10px; border-radius: 6px; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); direction: ltr; text-align: left; }
.shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #111; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .9s var(--ease); }
.project:hover .shot img { transform: scale(1.025); }
.project__meta { position: relative; display: grid; gap: 8px; padding: 22px 12px 12px; transform: translateZ(18px); }
.project__cat { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.project h3 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.project p { color: var(--muted); font-size: 15.5px; }
.project__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--text); }
.project__link .ico { transition: transform .25s var(--ease); }
.project:hover .project__link .ico { transform: translate(3px, -3px); }
html[dir='rtl'] .project__link .ico { transform: scaleX(-1); }
html[dir='rtl'] .project:hover .project__link .ico { transform: translate(-3px, -3px) scaleX(-1); }

/* ---------- 12. Education — a quiet list ---------- */
.timeline { position: relative; display: grid; padding-inline-start: 36px; }
.timeline::before { content: ''; position: absolute; inset-block: 18px; inset-inline-start: 6px; width: 1px; background: var(--line-2); }
.tl { position: relative; }
.tl__node { position: absolute; inset-inline-start: -36px; top: 26px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-2); }
.tl__node::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--dim); }
.tl--now .tl__node { border-color: var(--accent); }
.tl--now .tl__node::after { background: var(--accent); }
.tl__card { padding: 20px 4px; display: grid; gap: 6px; border-radius: 0; }
.tl__card::before { display: none; }
.tl + .tl .tl__card { border-top: 1px solid var(--line); }
.tl__when { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .1em; color: var(--accent); }
.tl--now .tl__when .pulse { width: 6px; height: 6px; }
.tl__card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }

/* ---------- 13. Contact ---------- */
.cta { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; padding: clamp(56px, 8vw, 100px) 24px; text-align: center; border: 1px solid var(--line); background: var(--surface); }
.cta::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(640px 320px at 50% 0%, var(--accent-soft), transparent 70%); }
.cta__content { position: relative; display: grid; justify-items: center; gap: 16px; }
.cta__title { max-width: 16ch; font-size: clamp(30px, 4.6vw, 58px); line-height: 1.05; font-weight: 600; letter-spacing: -.035em; }
.cta__lead { max-width: 46ch; color: var(--muted); font-size: clamp(15.5px, 1.3vw, 17.5px); }
.cta__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }

/* ---------- 14. Footer ---------- */
.footer { padding: 40px 0 32px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 20px; font-size: 12px; color: var(--dim); }

/* theme switch: the new theme sweeps out from the toggle (View Transitions; JS sets --vx/--vy) */
html.vt body, html.vt .nav { transition: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-image-pair(root) { isolation: auto; }
::view-transition-new(root) { z-index: 2; clip-path: circle(0 at var(--vx, 50%) var(--vy, 0)); animation: sweep-in .65s var(--ease) forwards; }
@keyframes sweep-in { to { clip-path: circle(160% at var(--vx, 50%) var(--vy, 0)); } }

/* ---------- 15. Responsive + a11y ---------- */
@media (max-width: 1080px) {
  /* single column: badge + name, then the photo, then the rest of the intro */
  .hero { padding-top: calc(var(--nav-h) + 8px); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero__copy { display: contents; }
  .hero__copy > .badge { order: 0; justify-self: start; }
  .hero__copy > .hero__title { order: 1; margin-bottom: 0; }
  .hero__grid > .stage { order: 2; margin: 0 0 14px; }
  .hero__copy > .hero__role { order: 3; }
  .hero__copy > .hero__lead { order: 4; }
  .hero__copy > .hero__cta { order: 5; }
  .hero__copy > .socials { order: 6; }
  .stage { width: 100%; min-height: 520px; }
  .scene, .flat { scale: .88; }
  .code { left: -24px; bottom: -40px; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .skills-grid > .reveal { flex-basis: calc(33.333% - 14px); }
}
@media (max-width: 900px) {
  .nav__cta { display: none; }
  .burger { display: flex; }
  .nav__links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 12px 24px 20px; background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .3s var(--ease); }
  .nav__links a { padding: 13px 12px; font-size: 16px; }
  .nav__links a::after { display: none; }
  .nav.is-open .nav__links { transform: none; opacity: 1; visibility: visible; }
  .nav__actions { margin-inline-start: auto; }
  .stats__grid, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .stat + .stat { border-inline-start: 0; border-top: 1px solid var(--line); }
  .stat { padding: 22px 24px; }
  .skills-grid { gap: 12px; }
  .skills-grid > .reveal { flex-basis: calc(50% - 6px); min-width: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .container, .container--narrow { width: min(1160px, 100% - 32px); }
  .hero { padding-bottom: 56px; }
  .stage { min-height: 384px; }
  .scene, .flat { scale: .7; }
  .code { display: none; }
  .btn { padding: 12px 18px; }
  .skill { min-height: 250px; padding: 16px 14px; }
  .skill__plate { width: 54px; height: 54px; border-radius: 14px; }
  .skill__plate img { width: 32px; height: 32px; }
  .skill__name { font-size: 18px; }
  .skill__ring { width: 56px; height: 56px; }
  .skill__ring b { font-size: 12.5px; }
  .skill__lv { font-size: 13px; }
  .svc { min-height: 0; }
  .project h3 { font-size: 21px; }
}
@media (hover: none) { .tilt::after { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .hero__title .w > span, .code__body .ln { animation: none; transform: none; opacity: 1; }
}

/* hero: the agency line is the one thing in the lead that should jump out */
.hero__org { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; transition: color .25s; }
.hero__org:hover { color: var(--accent); }
