/* =========================================================
   Mehdi Shafiei — personal home
   Light-first editorial layout · RTL · hand-written CSS
   ========================================================= */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/vazirmatn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-italic.woff2") format("woff2");
}

/* ---------- Tokens (light is the default) ---------- */
:root {
  --font-sans: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-serif: "EB Garamond", Georgia, serif;

  --rail: 84px;
  --user-col: 108px;
  --container: 1040px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* light */
  --bg: #ebebeb;
  --bg-2: #e4e4e4;
  --surface: #f5f5f5;
  --surface-2: #ffffff;
  --text: #0f0f0f;
  --text-2: rgba(15, 15, 15, 0.62);
  --text-3: rgba(15, 15, 15, 0.6);
  --line: rgba(15, 15, 15, 0.1);
  --line-2: rgba(15, 15, 15, 0.2);

  --accent: #00de51;
  --accent-2: #00bf43;
  --accent-text: color-mix(in srgb, var(--accent) 45%, #0f0f0f);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 48%, transparent);
  --on-accent: #06160c;
  --error: #b3261e;

  --shadow: 0 24px 60px -40px rgba(15, 15, 15, 0.5);
  --shadow-lg: 0 40px 80px -50px rgba(15, 15, 15, 0.55);

  color-scheme: light;
}


/* dark mode */
html[data-mode="dark"] {
  --bg: #0f0f0f;
  --bg-2: #131313;
  --surface: #171717;
  --surface-2: #1e1e1e;
  --text: #f4f4f4;
  --text-2: rgba(244, 244, 244, 0.66);
  --text-3: rgba(244, 244, 244, 0.5);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.2);
  --accent-text: color-mix(in srgb, var(--accent) 78%, #ffffff);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --on-accent: #06160c;
  --error: #ff8a8a;
  --shadow: 0 30px 70px -44px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 44px 90px -52px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

/* ---------- First paint (English is the default language) ----------
   The markup carries the Persian copy and the language pack swaps it out on
   load. Hold the first paint until that swap has happened, so Persian never
   flashes. `html.js` is added by the head bootstrap, so users without
   JavaScript still see the content immediately, and a timeout in the same
   bootstrap un-hides the page if the language pack ever fails to load. */
html.js.i18n-pending body { visibility: hidden; }

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 40px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(760px 520px at 88% -10%, var(--accent-soft), transparent 62%),
    radial-gradient(680px 480px at 0% 104%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-mode="dark"] body::after { mix-blend-mode: screen; opacity: 0.035; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 6px;
}

/* icon defaults */
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.socials-v a[aria-label="کانال تلگرام"] svg { fill: currentColor; stroke: none; }
.socials-v a[aria-label="گیت‌هاب"] svg { stroke-width: 1.5; }

/* ---------- SVG sprite ---------- */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Shared ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 44px);
}

.d-lg { display: none; }
@media (min-width: 992px) { .d-lg { display: inline; } }

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85rem;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.scroll-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.1s linear;
}
html[dir="rtl"] .scroll-progress span { transform-origin: right; }
html[dir="ltr"] .scroll-progress span { transform-origin: left; }

.mini-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-3);
}

.status-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: none;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease),
    border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-line { border-color: var(--line-2); color: var(--text); }
.btn-line:hover { border-color: var(--text); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), gap 0.3s var(--ease);
}
.link-arrow svg { width: 16px; height: 16px; }
.link-arrow:hover { color: var(--accent-text); border-color: var(--accent-text); gap: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 0.7rem;
  color: var(--text-2);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

/* =========================================================
   RIGHT RAIL (navigation)
   ========================================================= */
.rail {
  position: fixed;
  inset-block-start: 50%;
  inset-inline-start: 14px;
  transform: translateY(-50%);
  z-index: 60;
  width: 64px;
  max-height: calc(100svh - 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 6px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: visible;
}

.rail-link,
.rail-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--text-3);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.rail-link svg,
.rail-btn svg { width: 20px; height: 20px; }
.rail-link:hover,
.rail-btn:hover { color: var(--text); background: var(--surface); }
.rail-link.is-active {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 8px 20px -10px var(--accent);
}
.rail-link.is-active:hover { color: var(--on-accent); background: var(--accent); }

.rail-link[data-tip]::after,
.rail-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  inset-inline-start: calc(100% + 12px);
  top: 50%;
  z-index: 5;
  --tip-shift: -6px;
  transform: translateY(-50%) translateX(var(--tip-shift));
  padding: 6px 11px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.rail-link[data-tip]:hover::after,
.rail-btn[data-tip]:hover::after,
.rail-link[data-tip]:focus-visible::after,
.rail-btn[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.rail-line {
  width: 20px;
  height: 1px;
  margin: 8px 0;
  background: var(--line-2);
}

/* theme buttons: moon in light, sun in dark */
.i-sun { display: none; }
html[data-mode="dark"] .i-moon { display: none; }
html[data-mode="dark"] .i-sun { display: block; }

/* =========================================================
   LEFT USER COLUMN
   ========================================================= */
.user-col {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 55;
  width: var(--user-col);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 22px;
  pointer-events: none;
}
.user-col > * { pointer-events: auto; }
.user-col::before {
  content: "";
  position: absolute;
  inset-block: 96px 104px;
  inset-inline-start: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-2) 10%, var(--line-2) 90%, transparent);
}

.clock {
  position: relative;
  z-index: 1;
  min-width: 76px;
  padding: 9px 10px;
  text-align: center;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.clock-time {
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.clock-date { font-size: 0.62rem; color: var(--text-3); }

.user-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-block: 8px;
  background: var(--bg);
}

.logo-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: #0b1730;
  box-shadow: 0 18px 34px -18px rgba(3, 8, 20, 0.6);
  transition: transform 0.4s var(--ease);
}
.logo-tile img { width: 74%; height: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35)); }
.logo-tile::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  pointer-events: none;
}
.logo-tile::before {
  content: "";
  position: absolute;
  inset-block-start: -11px;
  inset-inline-end: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.user-card:hover .logo-tile { transform: translateY(-2px); }

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: #0b1730;
  overflow: hidden;
}
.avatar img { width: 76%; height: auto; }
.avatar--sm { width: 34px; height: 34px; border-radius: 10px; }

.available {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}
.available-text {
  writing-mode: vertical-rl;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.8;
  text-align: center;
}

.socials-v {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.socials-v a {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-3);
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.socials-v a svg { width: 18px; height: 18px; }
.socials-v a:hover { color: var(--text); background: var(--surface); }
.socials-v a[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: calc(100% + 12px);
  z-index: 5;
  --tip-shift: 6px;
  transform: translateY(-50%) translateX(var(--tip-shift));
  padding: 6px 11px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.socials-v a[data-tip]:hover::after,
.socials-v a[data-tip]:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
html[dir="rtl"] .rail-link[data-tip]::after,
html[dir="rtl"] .rail-btn[data-tip]::after { --tip-shift: 6px; }
html[dir="rtl"] .socials-v a[data-tip]::after { --tip-shift: -6px; }

.socials-v a[aria-label="لینکدین"] svg { fill: currentColor; stroke: none; }

/* LinkedIn resume link under the hero CTA */
.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 18px;
  padding-bottom: 4px;
  font-size: 0.8rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), gap 0.3s var(--ease);
}
.resume-link svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.resume-link span { color: var(--accent-text); }
.resume-link:hover { color: var(--accent-text); border-color: var(--accent-text); gap: 12px; }

/* =========================================================
   MOBILE
   ========================================================= */
.mobile-bar {
  display: none;
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 70;
  height: 62px;
  align-items: center;
  justify-content: space-between;
  padding-inline: 18px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-brand { display: flex; align-items: center; gap: 10px; }
.mobile-name { font-size: 0.88rem; font-weight: 700; }
.mobile-bar .rail-btn { width: 40px; height: 40px; color: var(--text-2); }
.mobile-actions { display: flex; align-items: center; gap: 6px; }

.lang-btn { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; }
.lang-btn span { line-height: 1; }

html[lang="en"] .hero-title,
html[lang="en"] .hero-statement,
html[lang="en"] .s-title,
html[lang="en"] .about-quote blockquote,
html[lang="en"] .footer-quote blockquote {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}
html[lang="en"] .hero-title {
  font-size: clamp(2.15rem, 4.7vw, 4.2rem);
  line-height: 1.12;
}
html[lang="en"] .hero-statement { line-height: 1.18; }
html[lang="en"] .s-title { line-height: 1.32; }
html[lang="en"] .tech-name small { display: none; }
html[lang="en"] .circular text { letter-spacing: 0.26em; }

.mobile-dock {
  display: none;
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 70;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-dock { grid-template-columns: repeat(5, 1fr); }
.dock-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--text-3);
  font-size: 0.6rem;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.dock-link svg { width: 20px; height: 20px; }
.dock-link.is-active { color: var(--text); background: var(--surface); }


/* =========================================================
   PAGE
   ========================================================= */
.page { margin-inline: var(--rail) var(--user-col); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 72px 0;
}
.hero .container { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
/* `inline` (not inline-flex) so the rotating word may break onto its own line:
   in English the phrases are long enough to overflow the hero column. */
.line--rotator { display: inline; }
.rotator {
  display: inline-grid;
  vertical-align: bottom;
  color: var(--accent-text);
  overflow: hidden;
  padding-block: 0.16em;
  margin-block: -0.16em;
}
.rot-word {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(105%);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.rot-word.is-active { opacity: 1; transform: none; }
.rot-word.is-leaving { opacity: 0; transform: translateY(-105%); }

.hero-sub {
  max-width: 48ch;
  margin-top: 22px;
  color: var(--text-2);
  font-size: clamp(0.96rem, 1.3vw, 1.08rem);
  line-height: 2.1;
}
.hero-lead {
  margin-top: 30px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-3);
}
.hero-lead + .hero-cta { margin-top: 12px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* circular badge */
.hero-badge {
  position: relative;
  width: clamp(170px, 19vw, 230px);
  aspect-ratio: 1;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.circular {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--text-3);
  animation: spin 34s linear infinite;
}
.circular text {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.32em;
  fill: currentColor;
  stroke: none;
}
/* ring text follows the page language */
html[lang="fa"] .ring-en { display: none; }
html[lang="en"] .ring-fa { display: none; }
.circular text.ring-fa {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

/* centre of the badge: logo today, photo later — same box, so only the src changes */
.badge-media {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.badge-core .badge-logo {
  width: 62%;
  height: auto;
  object-fit: contain;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge-core {
  display: grid;
  place-items: center;
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #16274a, #0b1730 68%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 60px -28px rgba(4, 10, 24, 0.55);
}
.badge-logo { width: 62%; height: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45)); }

.hero-statement {
  margin-top: clamp(34px, 5vw, 58px);
  max-width: 22ch;
  font-size: clamp(1.9rem, 4.8vw, 4rem);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.03em;
}
.hero-statement em { font-style: normal; color: var(--accent-text); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(38px, 5vw, 62px);
  padding-block: 24px;
  border-block: 1px solid var(--line);
}
.stat-num {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-plus { color: var(--accent-text); font-weight: 500; }
.stat-label { margin-top: 10px; font-size: 0.76rem; color: var(--text-3); }

.hero-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 20px;
}
.strip-label { font-size: 0.66rem; letter-spacing: 0.14em; color: var(--text-3); }
.strip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.strip-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-2);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.strip-links a:hover { color: var(--text); border-color: var(--text); }
.strip-links a span { color: var(--accent-text); }

.marquee {
  padding-block: 13px;
  border-block: 1px solid var(--line);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.marquee-set {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-inline-end: 26px;
  font-size: 0.8rem;
  color: var(--text-3);
  white-space: nowrap;
}
.marquee-set i { font-style: normal; color: var(--accent-text); font-size: 0.68rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  padding-block: clamp(68px, 8vw, 118px);
  border-top: 1px solid var(--line);
}

.sect-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--text-2);
}
.sect-tag i {
  display: block;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.s-title {
  margin-top: 18px;
  max-width: 26ch;
  font-size: clamp(1.7rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.02em;
}
.s-desc {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 0.96rem;
  line-height: 2.1;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(26px, 4vw, 54px);
  margin-top: clamp(30px, 4vw, 48px);
  align-items: start;
}
.about-text p {
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 2.2;
  margin-bottom: 18px;
}
.about-text strong { color: var(--text); font-weight: 700; }
.about-text .link-arrow { margin-top: 8px; }

.now-card {
  position: sticky;
  top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.now-list { margin-top: 14px; }
.now-list li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-block: 11px;
  border-bottom: 1px solid var(--line);
}
.now-list li:last-child { border-bottom: 0; }
.now-key { font-size: 0.64rem; letter-spacing: 0.08em; color: var(--accent-text); }
.now-val { font-size: 0.88rem; }
.now-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--text-3);
}

.about-quote {
  margin-top: clamp(40px, 6vw, 68px);
  padding-inline-start: 24px;
  border-inline-start: 2px solid var(--accent);
  max-width: 720px;
}
.about-quote blockquote {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.95;
  font-weight: 500;
}
.about-quote figcaption { margin-top: 12px; font-size: 0.76rem; color: var(--text-3); }

/* ---------- Certifications ---------- */
.cert-block {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.cert-title-main { font-size: 1.02rem; font-weight: 700; }
.cert-list { margin-top: 14px; border-top: 1px solid var(--line); }
.cert-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.cert-year {
  font-size: 0.72rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cert-title { font-size: 0.92rem; font-weight: 600; }
.cert-issuer {
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--text-3);
}
/* EB Garamond has no Persian glyphs, so Persian issuer names fell back to a
   system serif and looked out of place. Serif only where it can render. */
html[lang="en"] .cert-issuer { font-family: var(--font-serif); }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: clamp(36px, 5vw, 58px); }
.timeline::before {
  content: "";
  position: absolute;
  inset-block: 10px;
  inset-inline-start: 131px;
  width: 1px;
  background: var(--line-2);
}
/* scroll-driven progress line: --tl-h is written by main.js */
.timeline::after {
  content: "";
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 131px;
  width: 1px;
  height: var(--tl-h, 0px);
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-line);
  transition: height 0.12s linear;
}
.tl-dot { transition: background-color 0.4s var(--ease), box-shadow 0.5s var(--ease), transform 0.4s var(--ease); }
.tl-item.is-lit .tl-dot {
  background: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 0 0 5px var(--surface-2), 0 0 0 8px var(--accent-line);
}
.tl-item {
  display: grid;
  grid-template-columns: 104px 22px minmax(0, 1fr);
  gap: 22px;
  padding-block: 22px;
  align-items: start;
}
.tl-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  text-align: end;
}
.tl-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 5px var(--surface-2);
}
.tl-item--accent .tl-dot { background: var(--accent); }
.tl-body h3 { font-size: 1.06rem; font-weight: 700; }
.tl-body p {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 2.05;
  max-width: 60ch;
}
.tl-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.63rem;
  color: var(--text-3);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ---------- Work ---------- */
.section--work { background: var(--bg-2); }

.work-list { display: grid; gap: 24px; margin-top: clamp(32px, 4vw, 48px); }
.work-card {
  position: sticky;
  top: calc(24px + var(--i) * 12px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 372px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.work-cover {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 82% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 56%),
    radial-gradient(110% 110% at 0% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, #17181a, #0a0b0c);
}
.work-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(90% 90% at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(90% 90% at 50% 45%, #000 20%, transparent 78%);
}
.work-cover::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 74%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.8s var(--ease), border-color 0.5s var(--ease);
}
.work-card:hover .work-cover::after {
  transform: translate(-50%, -50%) scale(1.07);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}
.work-cover.is-empty {
  background: linear-gradient(150deg, var(--surface-2), var(--bg-2));
}
html[data-mode="dark"] .work-cover.is-empty {
  background: linear-gradient(150deg, #1b1b1b, #101010);
}
.work-cover.is-empty::before {
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: none;
  -webkit-mask-image: none;
}
.work-cover.is-empty::after { display: none; }
.work-cover.is-empty .cover-no { color: var(--text-3); opacity: 1; }
.work-cover.is-empty .cover-meta { color: var(--text-3); }

.work-cover.has-img { background: #0b1730; }
.work-cover.has-img::before {
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.5), transparent 30%, transparent 66%, rgba(6, 10, 18, 0.55));
  mask-image: none;
  -webkit-mask-image: none;
  z-index: 2;
}
.work-cover.has-img .cover-no,
.work-cover.has-img .cover-meta { z-index: 3; }
.work-cover.has-img::after { display: none; }
.work-cover.has-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.9s var(--ease);
}
.work-card:hover .work-cover.has-img img { transform: scale(1.04); }
.work-cover.has-img .cover-no { color: #fff; opacity: 0.92; }
.work-cover.has-img .cover-meta { color: rgba(255, 255, 255, 0.86); }

.cover--2 {
  background:
    radial-gradient(120% 130% at 20% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 58%),
    linear-gradient(160deg, #141618, #08090a);
}
.cover--3 {
  background:
    radial-gradient(130% 130% at 50% -10%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 55%),
    linear-gradient(160deg, #101316, #070808);
}
.cover--4 {
  background:
    radial-gradient(120% 130% at 80% 100%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 58%),
    linear-gradient(160deg, #15171a, #080a0b);
}
.cover--5 {
  background:
    radial-gradient(130% 120% at 15% 10%, color-mix(in srgb, var(--accent) 52%, transparent), transparent 52%),
    linear-gradient(200deg, #16181b, #070808);
}
.cover-no {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-end: 24px;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
}
.cover-meta {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-start: 24px;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
}
.cover-word {
  position: absolute;
  inset-block-end: 24px;
  inset-inline-start: 24px;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.work-body { display: flex; flex-direction: column; padding: clamp(22px, 3vw, 36px); }
.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.work-head h3 { font-size: clamp(1.15rem, 1.9vw, 1.5rem); font-weight: 700; }
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.work-link svg { width: 15px; height: 15px; }
.work-link:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.work-link.is-static {
  cursor: default;
  color: var(--text-3);
  border-style: dashed;
}
.work-link.is-static:hover { color: var(--text-3); background: none; border-color: var(--line); }

.work-body p {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 2.1;
  max-width: 46ch;
}
.work-meta {
  margin-top: auto;
  padding-top: 22px;
  display: grid;
  gap: 0;
}
.work-meta > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-block: 10px;
  border-top: 1px solid var(--line);
}
.work-meta dt { font-size: 0.68rem; color: var(--text-3); }
.work-meta dd { font-size: 0.8rem; color: var(--text); }

/* ---------- Services ---------- */
.accordion { margin-top: clamp(30px, 4vw, 48px); border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  padding-block: 20px;
  cursor: pointer;
  list-style: none;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-no { font-size: 0.64rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.acc-title {
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  font-weight: 700;
  line-height: 1.6;
  transition: color 0.3s var(--ease);
}
.acc-item summary:hover .acc-title { color: var(--accent-text); }
.acc-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease),
    transform 0.4s var(--ease);
}
.acc-icon::before,
.acc-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 11px;
  height: 1.5px;
  background: var(--text-2);
  transition: transform 0.4s var(--ease), background-color 0.3s var(--ease);
}
.acc-icon::after { transform: rotate(90deg); }
.acc-item[open] .acc-icon { background: var(--accent); border-color: var(--accent); transform: rotate(180deg); }
.acc-item[open] .acc-icon::before,
.acc-item[open] .acc-icon::after { background: var(--on-accent); }
.acc-item[open] .acc-icon::after { transform: rotate(0deg); }

.acc-body { padding: 0 56px 24px 0; max-width: 760px; }
.acc-body p { color: var(--text-2); font-size: 0.92rem; line-height: 2.15; }
.acc-body .tags { margin-top: 16px; }

/* ---------- Tech ---------- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(20px, 4vw, 52px);
  margin-top: clamp(30px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.tech-item {
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-block: 17px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.3s var(--ease), background-color 0.3s var(--ease);
}
.tech-item:hover { padding-inline: 12px; background: var(--surface-2); }
.tech-no { font-size: 0.6rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tech-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand) 11%, var(--surface-2));
  color: var(--brand);
}
html[data-mode="dark"] .tech-logo { color: color-mix(in srgb, var(--brand) 76%, #ffffff); }
.tech-logo svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.tech-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  flex-wrap: wrap;
}
.tech-name small {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-3);
}
.tech-cat {
  font-size: 0.6rem;
  color: var(--text-3);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.tech-item:hover .tech-name { color: var(--accent-text); }

/* ---------- Notes ---------- */
.notes-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.notes-nav { display: flex; gap: 8px; flex: none; }
.notes-nav .rail-btn { border: 1px solid var(--line); color: var(--text-2); }

.notes-slider {
  display: flex;
  gap: 16px;
  margin-top: clamp(28px, 4vw, 42px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.notes-slider::-webkit-scrollbar { display: none; }
.note-card {
  flex: 0 0 min(410px, 82%);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.note-card:hover { border-color: var(--accent-line); transform: translateY(-4px); }
.note-cat {
  width: fit-content;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  padding: 4px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
}
.note-card h3 { margin-top: 16px; font-size: 1.2rem; font-weight: 700; line-height: 1.75; }
.note-card p { margin-top: 12px; color: var(--text-2); font-size: 0.9rem; line-height: 2.05; }
.note-meta {
  margin-top: auto;
  padding-top: 20px;
  display: inline-flex;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.note-meta span { color: var(--accent-text); }
.note-card:hover .note-meta { color: var(--accent-text); }
.notes-foot { margin-top: 28px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(26px, 4vw, 52px);
  margin-top: clamp(30px, 4vw, 48px);
  align-items: start;
}
.contact-form {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 8px; font-size: 0.75rem; color: var(--text-2); }
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.7;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form-note { font-size: 0.68rem; color: var(--text-3); max-width: 32ch; }
.form-status { margin-top: 14px; min-height: 1.4em; font-size: 0.82rem; color: var(--accent-text); }
.form-status.is-error { color: var(--error); }

.contact-side { display: flex; flex-direction: column; }
.contact-link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-block: 17px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.3s var(--ease);
}
.contact-link:first-child { border-top: 1px solid var(--line); }
.contact-key { font-size: 0.7rem; color: var(--text-3); }
.contact-val { font-size: 0.88rem; direction: ltr; text-align: start; }
.contact-arrow { color: var(--accent-text); font-size: 0.9rem; transition: transform 0.3s var(--ease); }
.contact-link:hover { padding-inline-start: 6px; }
.contact-link:hover .contact-val { color: var(--accent-text); }
.contact-link:hover .contact-arrow { transform: translate(2px, -2px); }

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 0.78rem;
  color: var(--text-2);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(56px, 7vw, 88px) 26px;
  overflow: hidden;
}
.footer-quote { max-width: 720px; margin-inline: auto; text-align: center; }
.footer-quote blockquote { font-size: clamp(1.15rem, 2.2vw, 1.75rem); line-height: 1.95; font-weight: 500; }
.footer-quote figcaption { margin-top: 14px; font-size: 0.78rem; color: var(--text-3); }

.footer-mark {
  position: relative;
  margin-top: clamp(42px, 6vw, 74px);
  text-align: center;
  font-size: clamp(4.6rem, 16vw, 14rem);
  font-weight: 900;
  line-height: 1.05;
  padding-bottom: 0.06em;
  letter-spacing: -0.04em;
  user-select: none;
}
.footer-mark { --mx: 50%; --my: 50%; }
.mark-fill {
  display: block;
  color: var(--text);
  opacity: 0.07;
  filter: blur(5px);
  transition: filter 0.45s var(--ease), opacity 0.45s var(--ease);
}
/* a sharp copy, visible only through a soft spotlight that follows the pointer */
.mark-sharp {
  position: absolute;
  inset: 0;
  color: var(--text);
  opacity: 0;
  -webkit-mask-image: radial-gradient(circle 130px at var(--mx) var(--my), #000 0 38%, transparent 76%);
  mask-image: radial-gradient(circle 130px at var(--mx) var(--my), #000 0 38%, transparent 76%);
  transition: opacity 0.3s var(--ease);
}
.footer-mark:hover .mark-sharp,
.footer-mark.is-touched .mark-sharp { opacity: 0.5; }
.footer-mark:hover .mark-fill,
.footer-mark.is-touched .mark-fill { filter: blur(0); opacity: 0.12; }
.mark-outline {
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(24px, 4vw, 40px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--text-3);
}
.footer-top { color: var(--text-2); transition: color 0.3s var(--ease); }
.footer-top:hover { color: var(--accent-text); }

/* =========================================================
   MOTION
   ========================================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-height: 700px) {
  .rail { gap: 1px; padding: 7px 5px; }
  .rail-link,
  .rail-btn { width: 36px; height: 36px; }
  .rail-link svg,
  .rail-btn svg { width: 18px; height: 18px; }
}

@media (max-width: 1180px) {
  :root { --rail: 80px; --user-col: 96px; }
}

@media (max-width: 980px) {
  :root { --rail: 0px; --user-col: 0px; }
  .rail,
  .user-col { display: none; }
  .mobile-bar { display: flex; }
  .mobile-dock { display: grid; }
  .page { margin-inline: 0; padding-block: 62px 74px; }
  .hero { min-height: auto; padding-block: 40px 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 20px; }
  .hero-badge { width: 160px; }
  .now-card { position: static; }
}

@media (max-width: 860px) {
  .work-card {
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .work-cover { min-height: 230px; }
  .work-meta { margin-top: 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .notes-head { align-items: flex-start; }
}

@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-badge { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-label { font-size: 0.68rem; }
  .tech-grid { grid-template-columns: 1fr; }
  .timeline::before { inset-inline-start: 7px; }
  .tl-item { grid-template-columns: 22px minmax(0, 1fr); gap: 16px; padding-block: 18px; }
  .tl-year { grid-column: 2; grid-row: 1; text-align: start; font-size: 0.72rem; margin-bottom: -4px; }
  .tl-dot { grid-column: 1; grid-row: 1 / span 2; margin-top: 5px; }
  .tl-body { grid-column: 2; grid-row: 2; }
  .acc-body { padding-inline: 0; }
  .acc-item summary { grid-template-columns: 32px minmax(0, 1fr) 30px; gap: 10px; }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 520px) {
  .hero-title { font-size: clamp(2.05rem, 10vw, 2.9rem); }
  .hero-statement { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .hero-stats { grid-template-columns: 1fr; gap: 0; padding-block: 0; }
  .stat { display: flex; align-items: baseline; justify-content: space-between; padding-block: 13px; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .stat-label { margin: 0; order: -1; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-strip { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-link { grid-template-columns: 62px minmax(0, 1fr) auto; }
  .note-card { flex-basis: 88%; padding: 22px; }
  .work-meta > div { grid-template-columns: 76px minmax(0, 1fr); }
}

/* ---------- Contact form extras ---------- */
.hp-field {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.form-status.is-ok { color: var(--accent-text); }
