/* ==========================================================================
   Sepehr Kakoli — Portfolio
   Design system "Signal": deep ink surfaces, glacier accent (evolved from the
   original #547c90 steel-teal) and a warm medal amber reserved for honors.
   RTL-first: layout uses logical properties throughout.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg: #07090c;
  --bg-2: #0a0e13;
  --surface: #0e1319;
  --surface-2: #131a22;
  --line: rgba(168, 198, 216, 0.09);
  --line-2: rgba(168, 198, 216, 0.17);
  --line-3: rgba(168, 198, 216, 0.28);

  /* text */
  --text: #e9eef2;
  --text-2: #a7b4be;
  --text-3: #6e7c87;

  /* accents */
  --accent: #8cc8dc;          /* glacier */
  --accent-strong: #bfe7f3;
  --accent-deep: #547c90;     /* heritage colour of the original site */
  --accent-soft: rgba(140, 200, 220, 0.1);
  --accent-glow: rgba(140, 200, 220, 0.35);
  --amber: #e7b872;           /* honors only */
  --amber-soft: rgba(231, 184, 114, 0.1);
  --silver-grad: linear-gradient(135deg, #f4f7f9 0%, #aab6bf 45%, #e6ecef 70%, #8f9ca6 100%);
  --bronze-grad: linear-gradient(135deg, #f6d9a8 0%, #c98d55 45%, #f0c88c 70%, #a8693a 100%);

  /* type */
  --sans: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --fs-hero: clamp(3.1rem, 8.6vw, 7.8rem);
  --fs-h2: clamp(2rem, 4.4vw, 3.5rem);
  --fs-h3: clamp(1.12rem, 1.5vw, 1.3rem);
  --fs-lead: clamp(1.02rem, 1.35vw, 1.2rem);

  /* shape & depth */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-lg: 0 40px 80px -36px rgba(0, 0, 0, 0.85);
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* layout */
  --gutter: clamp(16px, 4vw, 40px);
  --container: 1240px;
  --header-h: 64px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 40px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* film grain over everything, very subtle */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
img, svg, canvas { display: block; max-width: 100%; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
strong { font-weight: 700; color: var(--text); }
::selection { background: rgba(140, 200, 220, 0.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* an LTR block inside the RTL page still aligns to the page's start edge */
p[dir="ltr"], div[dir="ltr"] { text-align: right; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.ico {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mono-soft {
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--text-3);
  margin-inline-start: 0.4em;
}

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #061016;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Shared atoms ---------- */
.pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  padding-inline: 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              background-color 0.35s, border-color 0.35s, color 0.35s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  color: #05121a;
  background: linear-gradient(180deg, #d2f0f8 0%, var(--accent) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 30px -12px rgba(140, 200, 220, 0.6);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 18px 40px -14px rgba(140, 200, 220, 0.85);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: rgba(140, 200, 220, 0.45); background: var(--accent-soft); }
.btn-sm { height: 38px; padding-inline: 16px; font-size: 0.85rem; gap: 6px; }
.btn-lg { height: 56px; padding-inline: 30px; font-size: 1rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); background: rgba(255, 255, 255, 0.06); }
.icon-btn .ico { width: 18px; height: 18px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.link-btn .ico { transition: transform 0.35s var(--ease-out); }
.link-btn:hover .ico { transform: translateX(-4px); }

/* cards + pointer spotlight */
.card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01));
  box-shadow: var(--inner-hi);
}
[data-spotlight] { position: relative; isolation: isolate; }
[data-spotlight]::before,
[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  z-index: 0;
}
[data-spotlight]::before {
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 50%), rgba(140, 200, 220, 0.075), transparent 60%);
}
[data-spotlight]::after {
  padding: 1px;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(140, 200, 220, 0.5), transparent 65%);
  -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 exclude, linear-gradient(#000 0 0);
}
[data-spotlight]:hover::before,
[data-spotlight]:hover::after { opacity: 1; }
[data-spotlight] > * { position: relative; z-index: 1; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.card-head h3 { font-size: 1.12rem; font-weight: 700; }
.card-head .mono {
  color: var(--text-3);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(to left, var(--accent-deep), var(--accent), var(--accent-strong));
  transform: scaleX(var(--p, 0));
  transform-origin: right center;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 14px;
  inset-inline: 0;
  z-index: 60;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.header-inner {
  pointer-events: auto;
  max-width: var(--container);
  height: var(--header-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline: 10px 10px;
  padding-inline-start: 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 12, 16, 0.5);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--inner-hi), 0 20px 50px -30px rgba(0, 0, 0, 0.9);
  transition: background-color 0.4s, border-color 0.4s, transform 0.5s var(--ease-out);
}
.site-header.is-scrolled .header-inner { background: rgba(9, 12, 16, 0.78); border-color: var(--line-2); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; }
.bm-lines path { stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1.1; fill: none; }
.bm-nodes circle { fill: var(--accent); }
.bm-out { fill: var(--amber); }
.brand:hover .bm-out { filter: drop-shadow(0 0 6px var(--amber)); }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: 0; }

.nav { margin-inline: auto; }
.nav ul { display: flex; gap: 2px; }
.nav a {
  position: relative;
  display: block;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: color 0.25s, background-color 0.25s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a[aria-current="true"] { color: var(--text); background: var(--accent-soft); }
.nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  bottom: 4px;
  inset-inline: 45%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-cta { flex-shrink: 0; }

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
}
.menu-toggle span {
  position: absolute;
  inset-inline-start: 13px;
  width: 18px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 25px; width: 12px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 21px; width: 18px; transform: rotate(-45deg); }

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 56px) var(--gutter) 32px;
  background: rgba(7, 9, 12, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; }
.mobile-menu ol { display: grid; gap: 4px; }
.mobile-menu li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms + 80ms);
}
.mobile-menu.is-open li { opacity: 1; transform: none; }
.mobile-menu ol a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-block: 10px;
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  font-weight: 800;
  line-height: 1.3;
  border-bottom: 1px solid var(--line);
}
.mobile-menu ol a[aria-current="true"] { color: var(--accent-strong); }
.mm-i { font-size: 0.85rem; font-weight: 500; color: var(--accent); min-width: 2ch; }
.mm-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mm-social { display: flex; gap: 10px; }
.mm-social a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}

/* social rail */
.social-rail {
  position: fixed;
  bottom: 0;
  inset-inline-end: 28px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.social-rail a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(9, 12, 16, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  transition: color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out);
}
.social-rail a:hover { color: var(--accent-strong); border-color: rgba(140, 200, 220, 0.45); transform: translateY(-3px); }
.social-rail .ico { width: 17px; height: 17px; }
.rail-line { width: 1px; height: 72px; background: linear-gradient(to bottom, var(--line-3), transparent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--header-h) + 72px);
  padding-bottom: 72px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(168, 198, 216, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(168, 198, 216, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 40% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 40% 40%, #000 20%, transparent 75%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42% 46% at 26% 42%, rgba(140, 200, 220, 0.13), transparent 70%),
    radial-gradient(38% 38% at 88% 6%, rgba(84, 124, 144, 0.22), transparent 70%),
    radial-gradient(30% 30% at 12% 92%, rgba(231, 184, 114, 0.05), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero-net {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 64%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 55%, transparent 100%);
  mask-image: linear-gradient(to right, #000 55%, transparent 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

.hero-in {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  animation: hero-in 1.15s var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes hero-in { to { opacity: 1; transform: none; filter: blur(0); } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 0.86rem;
}

.hero-title {
  margin-top: 26px;
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
}
.hero-title > span > span {
  display: inline-block;
  padding-block: 0.06em;
  background: linear-gradient(180deg, #ffffff 25%, #b4cbd6 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-latin {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-latin span { margin-inline: 0.9em; color: var(--accent); }

.hero-typed {
  margin-top: 26px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.45em;
  font-size: clamp(1.3rem, 2.3vw, 1.75rem);
  font-weight: 500;
  color: var(--text-2);
  min-height: 1.9em;
}
.typed-word { color: var(--accent-strong); font-weight: 800; }
.typed-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-inline-start: -0.3em;
  align-self: center;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lede {
  margin-top: 14px;
  max-width: 52ch;
  color: var(--text-2);
  font-size: 1.04rem;
}
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

/* portrait */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
}
.portrait { position: relative; }
.portrait-frame {
  position: relative;
  padding: 10px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-2);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015) 42%, rgba(140, 200, 220, 0.07));
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 80px -20px rgba(140, 200, 220, 0.18);
}
.portrait-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 627;
  object-fit: cover;
  border-radius: 23px;
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 23px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(6, 9, 12, 0.62), transparent 32%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.vf {
  position: absolute;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-color: rgba(255, 255, 255, 0.75);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.vf-a { top: 24px; inset-inline-start: 24px; border-top-width: 1.5px; border-inline-start-width: 1.5px; border-start-start-radius: 6px; }
.vf-b { top: 24px; inset-inline-end: 24px; border-top-width: 1.5px; border-inline-end-width: 1.5px; border-start-end-radius: 6px; }
.vf-c { bottom: 24px; inset-inline-start: 24px; border-bottom-width: 1.5px; border-inline-start-width: 1.5px; border-end-start-radius: 6px; }
.vf-d { bottom: 24px; inset-inline-end: 24px; border-bottom-width: 1.5px; border-inline-end-width: 1.5px; border-end-end-radius: 6px; }

.portrait-tag {
  position: absolute;
  z-index: 3;
  bottom: 30px;
  inset-inline: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.86);
}
.portrait-tag span:last-child { font-family: var(--sans); letter-spacing: 0; font-size: 0.78rem; }

.float-chip {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: rgba(11, 15, 20, 0.74);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.95), var(--inner-hi);
  animation: float 8s var(--ease-in-out) infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.chip-medal {
  bottom: 13%;
  inset-inline-end: -22%;
  padding: 10px 18px 10px 10px;
  padding-inline-start: 10px;
  text-align: start;
  transition: border-color 0.3s, background-color 0.3s;
}
.chip-medal:hover { border-color: rgba(231, 184, 114, 0.5); background: rgba(20, 18, 14, 0.82); }
.chip-medal-disc {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--silver-grad);
  color: #1b242c;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 6px 16px -6px rgba(200, 214, 222, 0.6);
}
.chip-medal-disc .ico { width: 20px; height: 20px; stroke-width: 1.8; }
.chip-text strong { display: block; font-size: 0.92rem; line-height: 1.4; }
.chip-text small { display: block; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; color: var(--text-3); }

.chip-stack {
  top: 9%;
  inset-inline-start: -16%;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
  animation-delay: -4s;
}
.chip-stack .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(48px, 8vh, 96px);
  border-top: 1px solid var(--line);
}
.hero-stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 24px;
  padding-inline: 20px;
}
.hero-stats > div:first-child { padding-inline-start: 0; }
.hero-stats > div + div { border-inline-start: 1px solid var(--line); }
.hero-stats dd {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.hero-stats dt { font-size: 0.82rem; line-height: 1.6; color: var(--text-3); }


/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(88px, 12vw, 168px); overflow-x: clip; }
.section + .section::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: var(--gutter);
  max-width: var(--container);
  margin-inline: auto;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--line-2) 20%, var(--line-2) 80%, transparent);
}

.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-index {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-3);
}
.section-index .num { color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.section-index .rule { width: 44px; height: 1px; background: var(--line-3); }
.section-head h2 {
  margin-top: 16px;
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.22;
}
.section-lede { margin-top: 14px; max-width: 58ch; color: var(--text-2); font-size: var(--fs-lead); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.about-statement {
  font-size: clamp(1.3rem, 2.25vw, 1.85rem);
  font-weight: 500;
  line-height: 1.9;
  color: var(--text-2);
}
.about-statement strong { font-weight: 800; }
.about-statement mark {
  color: var(--text);
  background: linear-gradient(to top, rgba(140, 200, 220, 0.18) 0 34%, transparent 34%);
  border-radius: 2px;
  padding-inline: 2px;
}

.spec { padding: clamp(24px, 3vw, 34px); }
.spec-status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-2); }
.spec dl { display: grid; }
.spec dl > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 16px;
  padding-block: 13px;
  border-top: 1px solid var(--line);
}
.spec dt { color: var(--text-3); font-size: 0.86rem; }
.spec dd { font-weight: 600; font-size: 0.95rem; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 20px;
  align-items: stretch;
}
.meters-card, .curriculum { padding: clamp(24px, 3vw, 38px); }
.meters-card { display: flex; flex-direction: column; }
.meters { flex: 1; display: grid; gap: 22px; align-content: space-between; }
.meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  row-gap: 10px;
}
.meter-name { text-align: right; font-weight: 500; font-size: 0.95rem; color: var(--text); }
.meter-val { font-size: 0.86rem; font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.meter-track {
  grid-column: 1 / -1;
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}
.meter-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: calc(var(--v) * 1%);
  border-radius: inherit;
  background: linear-gradient(to left, var(--accent-deep), var(--accent) 70%, var(--accent-strong));
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 1.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.meter-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: -3px;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 12px 2px var(--accent-glow);
}
.meters.is-in .meter-fill { transform: scaleX(1); }
.card-foot { margin-top: 26px; font-size: 0.8rem; color: var(--text-3); }

.cur-groups { display: grid; }
.cur-group { padding-block: 18px; border-top: 1px dashed var(--line-2); }
.cur-group:first-child { padding-top: 0; border-top: 0; }
.cur-group:last-child { padding-bottom: 0; }
.cur-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cur-title h4 { font-size: 0.98rem; font-weight: 700; }
.cur-src { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cur-src button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid rgba(140, 200, 220, 0.24);
  font-size: 0.74rem;
  color: var(--accent);
  transition: background-color 0.25s, border-color 0.25s;
}
.cur-src button::before {
  content: "";
  width: 9px;
  height: 11px;
  border: 1.2px solid currentColor;
  border-radius: 2px;
  opacity: 0.8;
}
.cur-src button:hover { background: var(--accent-soft); border-color: rgba(140, 200, 220, 0.5); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  unicode-bidi: plaintext;
  padding: 5px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-2);
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.project {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  min-height: 300px;
  transition: transform 0.5s var(--ease-out), border-color 0.4s;
}
.project:hover { transform: translateY(-4px); border-color: var(--line-2); }
.projects > :nth-child(2), .projects > :nth-child(3) { grid-column: span 5; min-height: 260px; }
.project--featured {
  grid-column: span 7;
  grid-row: span 2;
  justify-content: flex-end;
  padding: clamp(28px, 3.4vw, 44px);
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 70% 0%, rgba(140, 200, 220, 0.09), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.project--featured .project-top { margin-bottom: auto; padding-bottom: 28px; }
.project-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 220, 0.2);
  background: linear-gradient(160deg, rgba(140, 200, 220, 0.14), rgba(140, 200, 220, 0.03));
  color: var(--accent-strong);
}
.project-icon .ico { width: 22px; height: 22px; }
.project-cat { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em; color: var(--text-3); }
.project h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.5; }
.project p { color: var(--text-2); font-size: 0.94rem; }
.project--featured h3 { font-size: clamp(1.6rem, 2.7vw, 2.3rem); font-weight: 800; line-height: 1.35; }
.project--featured > p:not(.project-kicker) { font-size: 1.02rem; max-width: 52ch; }
.project-kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tags li {
  unicode-bidi: plaintext;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--text-3);
}
.project-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}
.project-foot .tags { margin-top: 0; padding-top: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge .ico { width: 15px; height: 15px; stroke-width: 2; }
.badge-silver {
  color: #10171d;
  background: var(--silver-grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 24px -10px rgba(210, 222, 230, 0.55);
}

/* lost-script glyph field (featured project) */
[data-spotlight] > .glyph-field {
  position: absolute;
  inset: 0 0 38% 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 10%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 10%, transparent 100%);
}
.glyph-field svg { width: 100%; height: 100%; }
.glyph-field path { fill: none; stroke: rgba(168, 198, 216, 0.16); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 1.2s var(--ease-out); }
.glyph-field g.on path { stroke: var(--accent-strong); filter: drop-shadow(0 0 4px var(--accent)); transition-duration: 0.25s; }
.glyph-field .scan {
  position: absolute;
  inset-block: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px 2px var(--accent-glow);
  animation: scan 7s var(--ease-in-out) infinite;
}
@keyframes scan {
  0% { inset-inline-start: -2%; opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { inset-inline-start: 102%; opacity: 0; }
}

.now-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  width: fit-content;
  margin: 40px auto 0;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px dashed var(--line-3);
  background: rgba(255, 255, 255, 0.02);
}
.now-label { display: inline-flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 0.88rem; }
.now-text { font-weight: 700; color: var(--accent-strong); }

/* ---------- Timeline ---------- */
.timeline {
  --label: 250px;
  --gap: 80px;
  position: relative;
  display: grid;
  gap: 64px;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  inset-block: 8px 0;
  inset-inline-start: calc(var(--label) + var(--gap) / 2);
  width: 1px;
}
.timeline::before { background: var(--line-2); }
.timeline::after {
  background: linear-gradient(to bottom, var(--accent-deep), var(--accent));
  transform: scaleY(var(--tl, 0));
  transform-origin: top;
  box-shadow: 0 0 10px var(--accent-glow);
}
.tl-year {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  column-gap: var(--gap);
}
.tl-year-label {
  position: sticky;
  top: calc(var(--header-h) + 56px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-year-label span {
  font-size: clamp(3rem, 5.6vw, 4.8rem);
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 200, 220, 0.38);
  transition: color 0.6s var(--ease-out);
}
.tl-year.is-active .tl-year-label span { color: var(--text); -webkit-text-stroke-color: transparent; }
.tl-year-label small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; color: var(--text-3); }
.tl-entries { display: grid; gap: 18px; max-width: 820px; }
.tl-card {
  position: relative;
  padding: clamp(22px, 2.6vw, 32px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
}
.tl-card::before {
  content: "";
  position: absolute;
  top: 34px;
  inset-inline-start: calc(var(--gap) / -2 - 5px);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-deep);
  background: var(--bg);
  transition: background-color 0.5s, box-shadow 0.5s, border-color 0.5s;
}
.tl-card.is-in::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(140, 200, 220, 0.1), 0 0 14px var(--accent-glow); }
.tl-when { display: inline-flex; align-items: center; gap: 9px; font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.tl-card h3 { margin: 6px 0 10px; font-size: var(--fs-h3); font-weight: 700; line-height: 1.55; }
.tl-card p:not(.tl-when) { color: var(--text-2); font-size: 0.97rem; }
.tl-card--win {
  border-color: rgba(231, 184, 114, 0.2);
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(231, 184, 114, 0.07), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
}
.tl-card--win .tl-when { color: var(--amber); }
.tl-card--win.is-in::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 5px rgba(231, 184, 114, 0.12), 0 0 14px rgba(231, 184, 114, 0.5); }
.tl-card--now { border-style: dashed; border-color: rgba(140, 200, 220, 0.3); }
.evidence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(140, 200, 220, 0.25);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
  transition: background-color 0.25s, border-color 0.25s;
}
.evidence:hover { border-color: rgba(140, 200, 220, 0.55); background: rgba(140, 200, 220, 0.16); }
.tl-card--win .evidence { color: var(--amber); border-color: rgba(231, 184, 114, 0.3); background: var(--amber-soft); }
.tl-card--win .evidence:hover { border-color: rgba(231, 184, 114, 0.6); background: rgba(231, 184, 114, 0.16); }
.evidence .ico { width: 16px; height: 16px; }

.tl-continue {
  margin-top: 80px;
  text-align: center;
}
.tl-continue-dots { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.tl-continue-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: dots 1.4s var(--ease-in-out) infinite;
}
.tl-continue-dots i:nth-child(2) { animation-delay: 0.18s; }
.tl-continue-dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dots { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }
.tl-continue h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
.tl-continue p { margin: 10px auto 0; max-width: 50ch; color: var(--text-2); }

/* ---------- Archive ---------- */
.archive-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(22px, 3vw, 34px);
  margin-bottom: clamp(48px, 6vw, 72px);
}
.sum-stats { display: flex; gap: clamp(20px, 3vw, 40px); }
.sum-stats > div { display: flex; flex-direction: column-reverse; gap: 6px; }
.sum-stats dd { font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 800; line-height: 1; white-space: nowrap; }
.sum-stats dt { font-size: 0.8rem; color: var(--text-3); }

.chrono-label { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--text-3); margin-bottom: 10px; }
.chrono-label .mono { color: var(--accent); letter-spacing: 0.2em; }
.chrono-track { position: relative; height: 80px; }
.chrono-axis {
  position: absolute;
  inset-inline: 0;
  top: 44px;
  height: 1px;
  background: var(--line-2);
}
.chrono-tick {
  position: absolute;
  top: 40px;
  width: 1px;
  height: 9px;
  background: var(--line-2);
}
.chrono-tick.is-year { top: 34px; height: 21px; background: var(--line-3); }
.chrono-year {
  position: absolute;
  top: 58px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-3);
}
.chrono-dot {
  position: absolute;
  top: 44px;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  margin-inline-start: -11px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translateY(var(--lane, 0px));
}
.chrono-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-2), 0 0 10px var(--accent-glow);
  transition: transform 0.3s var(--ease-out);
}
.chrono-dot[data-kind="honor"]::before { width: 11px; height: 11px; background: var(--amber); box-shadow: 0 0 0 3px var(--bg-2), 0 0 12px rgba(231, 184, 114, 0.6); }
.chrono-dot[data-kind="featured"]::before { background: var(--accent-strong); outline: 1px solid var(--accent); outline-offset: 3px; }
.chrono-dot:hover::before, .chrono-dot:focus-visible::before { transform: scale(1.5); }
.chrono-dot .tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  translate: -50% 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(14, 19, 25, 0.96);
  font-size: 0.74rem;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.25s var(--ease-out);
  z-index: 3;
}
.chrono-dot:hover .tip, .chrono-dot:focus-visible .tip { opacity: 1; translate: -50% 0; }
.chrono-dot.tip-start .tip { left: auto; right: -6px; translate: 0 4px; }
.chrono-dot.tip-end .tip { left: -6px; translate: 0 4px; }
.chrono-dot.tip-start:hover .tip, .chrono-dot.tip-start:focus-visible .tip,
.chrono-dot.tip-end:hover .tip, .chrono-dot.tip-end:focus-visible .tip { translate: 0 0; }
.chrono-now {
  position: absolute;
  top: 44px;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  margin-inline-start: -4.5px;
}
.chrono-now .pulse { width: 9px; height: 9px; background: var(--text-2); box-shadow: none; }
.chrono-now .pulse::after { border-color: var(--text-2); }
.chrono-now small {
  position: absolute;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  font-size: 0.7rem;
  color: var(--text-3);
  white-space: nowrap;
}

.archive-block + .archive-block { margin-top: clamp(56px, 7vw, 88px); }
.block-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-2);
}
.block-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.block-title .ico { color: var(--accent); }

/* honors */
.honors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.honor {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 2.6vw, 32px);
  padding: clamp(18px, 2.2vw, 26px);
  align-items: center;
}
.honor[data-tier="silver"] { border-color: rgba(214, 226, 234, 0.16); }
.honor[data-tier="third"] { border-color: rgba(231, 184, 114, 0.18); }
.exhibit {
  position: relative;
  display: block;
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(255, 255, 255, 0.12), transparent 70%),
    linear-gradient(180deg, #121920, #0b1015);
  border: 1px solid var(--line);
  perspective: 900px;
  overflow: hidden;
}
.exhibit img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotateX(4deg) translateY(2px);
  transition: transform 0.7s var(--ease-out);
}
.exhibit:hover img, .exhibit:focus-visible img { transform: rotateX(0) translateY(-4px) scale(1.02); }
.exhibit-hint {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(7, 9, 12, 0.8);
  border: 1px solid var(--line-2);
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.3s, translate 0.4s var(--ease-out);
}
.exhibit-hint .ico { width: 14px; height: 14px; }
.exhibit:hover .exhibit-hint, .exhibit:focus-visible .exhibit-hint { opacity: 1; translate: 0 0; }

.honor-body { display: flex; flex-direction: column; gap: 14px; }
.tier { display: flex; align-items: center; gap: 14px; }
.tier-disc {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #141b21;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.75), inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 10px 26px -10px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}
.tier-disc .ico { width: 26px; height: 26px; stroke-width: 1.8; }
.tier-disc.silver { background: var(--silver-grad); }
.tier-disc.third { background: var(--bronze-grad); color: #2a1a0c; }
.tier-label strong { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.4; }
.tier-label span { font-size: 0.8rem; color: var(--text-3); }
.scope {
  display: inline-block;
  padding: 2px 10px;
  margin-inline-start: 6px;
  border-radius: 999px;
  border: 1px solid rgba(231, 184, 114, 0.35);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 600;
}
.honor h4 { font-size: 1.02rem; font-weight: 700; line-height: 1.6; }
.facts { display: grid; }
.facts > div {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 12px;
  padding-block: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.facts dt { color: var(--text-3); }
.facts dd { color: var(--text); font-weight: 500; unicode-bidi: plaintext; text-align: right; }
.honor .link-btn { align-self: flex-start; }

/* featured credential */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 48px);
  padding: clamp(18px, 2.4vw, 30px);
  align-items: center;
}
.featured .exhibit { padding: 22px; }
.featured .exhibit img { transform: none; }
.featured .exhibit:hover img { transform: translateY(-3px) scale(1.015); }
.featured-body { display: flex; flex-direction: column; gap: 16px; }
.featured-body h4 { font-size: clamp(1.3rem, 2vw, 1.65rem); font-weight: 800; line-height: 1.45; }
.featured-body .issuer { color: var(--text-2); font-size: 0.92rem; }
.metrics { display: flex; gap: 14px; flex-wrap: wrap; }
.metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.metric-ring { position: relative; width: 58px; height: 58px; }
.metric-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.metric-ring circle { fill: none; stroke-width: 4; }
.metric-ring .bg { stroke: rgba(255, 255, 255, 0.07); }
.metric-ring .fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset 1.8s var(--ease-out) 0.2s;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}
.featured.is-in .metric-ring .fg { stroke-dashoffset: calc(150.8 * (1 - var(--score) / 100)); }
.metric-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
}
.metric-text strong { display: block; font-size: 0.95rem; font-weight: 700; }
.metric-text span { font-size: 0.78rem; color: var(--text-3); }
.metric-big { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--accent-strong); }
.featured-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed var(--line-2);
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-3);
}

/* course catalogue */
.catalog { border-top: 1px solid var(--line-2); counter-reset: none; }
.cat-row {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 8rem 6.5rem 7rem 2rem;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 14px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  transition: background-color 0.35s;
}
.cat-row::before {
  content: "";
  position: absolute;
  inset-block: -1px;
  inset-inline-start: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.45s var(--ease-out);
}
.cat-row:hover, .cat-row:focus-visible { background: linear-gradient(to left, rgba(140, 200, 220, 0.06), transparent 70%); }
.cat-row:hover::before, .cat-row:focus-visible::before { transform: scaleY(1); }
.cat-num { font-size: 0.86rem; font-weight: 600; color: var(--text-3); }
.cat-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: transform 0.45s var(--ease-out); }
.cat-row:hover .cat-title { transform: translateX(-6px); }
.cat-title strong { font-size: 1.12rem; font-weight: 700; }
.cat-title small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; text-align: right; }
.cat-domain {
  justify-self: start;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.74rem;
  color: var(--text-2);
}
.cat-topics { font-size: 0.82rem; color: var(--text-3); }
.cat-date { font-size: 0.86rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cat-arrow { display: grid; place-items: center; color: var(--text-3); transition: color 0.3s, transform 0.45s var(--ease-out); }
.cat-row:hover .cat-arrow { color: var(--accent); transform: translateX(-4px); }
.cat-thumb { display: none; }

/* floating preview that follows the pointer over catalogue rows */
.cat-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 300px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(0.92);
  transition: opacity 0.3s var(--ease-out);
}
.cat-preview.is-on { opacity: 1; }
.cat-preview img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.95);
  transform: rotate(var(--rot, -3deg));
  transition: transform 0.4s var(--ease-out);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.privacy-note .ico { color: var(--accent); width: 18px; height: 18px; }

.resume-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding: clamp(26px, 3.4vw, 44px);
  background:
    radial-gradient(60% 120% at 0% 100%, rgba(140, 200, 220, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}
.resume-cta .mono { color: var(--accent); }
.resume-cta h3 { margin-top: 6px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; }
.resume-cta p:not(.mono) { margin-top: 4px; color: var(--text-2); }

.noscript-list { display: grid; gap: 8px; margin-top: 16px; }
.noscript-list a { color: var(--accent); text-decoration: underline; }

/* ---------- Contact ---------- */
.contact-email {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 24px;
  padding-block: clamp(26px, 4vw, 44px);
  border-block: 1px solid var(--line-2);
}
.contact-email .mono { grid-column: 1 / -1; color: var(--text-3); }
.contact-email-addr {
  justify-self: start;
  font-size: clamp(1.5rem, 5.4vw, 4.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  background: linear-gradient(90deg, var(--text), var(--text));
  -webkit-background-clip: text;
  background-clip: text;
  transition: color 0.4s;
}
.contact-email .ico {
  width: clamp(28px, 4vw, 48px);
  height: clamp(28px, 4vw, 48px);
  stroke-width: 1.3;
  color: var(--text-3);
  transition: transform 0.5s var(--ease-out), color 0.4s;
}
.contact-email:hover .contact-email-addr { color: var(--accent-strong); }
.contact-email:hover .ico { transform: translateX(-10px) rotate(-45deg); color: var(--accent); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 22px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s, transform 0.5s var(--ease-out);
}
a.contact-item:hover { border-color: var(--line-2); transform: translateY(-3px); }
.contact-item .ico { width: 22px; height: 22px; color: var(--accent); margin-bottom: 18px; }
.ci-label { font-size: 0.8rem; color: var(--text-3); }
.ci-value { font-weight: 600; text-align: right; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 30px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { font-size: 0.84rem; color: var(--text-3); }
.site-footer .accent { color: var(--accent); }
.to-top { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-2); transition: color 0.3s; }
.to-top:hover { color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: rgba(5, 7, 10, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.lightbox.is-open { opacity: 1; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.5); }
.lb-shell {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  grid-template-areas: "info stage";
  height: 100%;
}
.lb-stage {
  grid-area: stage;
  position: relative;
  min-height: 0;
  padding: 40px 88px;
  display: grid;
}
.lb-viewport {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 12px;
  scrollbar-width: thin;
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-img.is-swapping { opacity: 0; transform: translateX(var(--dir, 0)) scale(0.985); }
.lb-viewport { direction: ltr; }
.lb-viewport.is-zoomed { place-items: initial; overflow: auto; cursor: grab; }
.lb-viewport.is-zoomed.is-dragging { cursor: grabbing; }
.lb-viewport.is-zoomed .lb-img { margin: auto; max-width: none; max-height: none; width: var(--zw); border-radius: 0; cursor: zoom-out; }
.lb-viewport.is-zoomed.is-dragging .lb-img { cursor: grabbing; }
.lb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.lb-stage.is-loading .lb-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.lb-nav {
  position: absolute;
  top: 50%;
  margin-top: -26px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(14, 19, 25, 0.75);
  color: var(--text);
  transition: background-color 0.25s, border-color 0.25s, transform 0.35s var(--ease-out);
}
.lb-nav:hover { background: rgba(28, 36, 46, 0.9); border-color: var(--line-3); }
.lb-prev { inset-inline-start: 20px; }
.lb-next { inset-inline-end: 20px; }
.lb-prev:hover { transform: translateX(3px); }
.lb-next:hover { transform: translateX(-3px); }
.lb-nav .ico { width: 22px; height: 22px; }

.lb-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-inline-end: 1px solid var(--line);
  background: rgba(10, 14, 19, 0.9);
}
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.lb-count { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; color: var(--text-3); }
.lb-count b { color: var(--text); font-weight: 600; }
.lb-tools { display: flex; gap: 8px; }
.lb-body { flex: 1; overflow-y: auto; padding: 26px 26px 34px; scrollbar-width: thin; }
.lb-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 200, 220, 0.25);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
}
.lb-kind.is-honor { border-color: rgba(231, 184, 114, 0.35); color: var(--amber); }
.lb-body h2 { margin-top: 16px; font-size: 1.5rem; font-weight: 800; line-height: 1.45; }
.lb-sub { margin-top: 4px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-3); text-transform: uppercase; text-align: right; }
.lb-body .facts { margin-top: 22px; }
.lb-body .facts > div { grid-template-columns: 6.4rem 1fr; }
.lb-topics { margin-top: 26px; }
.lb-topics h3 { font-size: 0.86rem; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.lb-topics ol { display: grid; gap: 2px; counter-reset: t; }
.lb-topics li {
  counter-increment: t;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 6px;
  padding-block: 7px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-2);
}
.lb-topics li::before { content: counter(t, persian); font-family: var(--sans); color: var(--accent); font-weight: 700; font-size: 0.8rem; }
.lb-note, .lb-privacy {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--text-3);
}
.lb-note .ico, .lb-privacy .ico { width: 17px; height: 17px; margin-top: 3px; color: var(--accent); }
.lb-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}
.lb-open:hover { text-decoration: underline; text-underline-offset: 4px; }
.lb-keys { margin-top: 26px; font-size: 0.72rem; color: var(--text-3); }
.lb-keys kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  margin-inline: 2px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: center;
}
html.lb-lock, html.menu-lock { overflow: hidden; }

/* ---------- Reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(5px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: blur(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav a { padding-inline: 11px; }
  .social-rail { display: none; }
  .chip-medal { inset-inline-end: -10%; }
  .chip-stack { inset-inline-start: -8%; }
  .cat-row { grid-template-columns: 2.6rem minmax(0, 1fr) 7rem 6rem 2rem; }
  .cat-topics { display: none; }
}

@media (max-width: 1024px) {
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .hero-stats > div:nth-child(4) { padding-inline-start: 0; border-inline-start: 0; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects > * , .projects > :nth-child(2), .projects > :nth-child(3) { grid-column: span 6; }
  .project--featured { grid-column: 1 / -1; grid-row: auto; min-height: 460px; }
  .honors { grid-template-columns: 1fr; }
  .archive-summary { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline { --label: 150px; --gap: 56px; }
}

@media (max-width: 900px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .header-inner { padding-inline-start: 16px; }

  .hero { padding-top: calc(var(--header-h) + 48px); min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { width: min(78%, 340px); order: -1; margin-top: 8px; }
  .hero-net {
    width: 100%;
    height: 62%;
    inset-inline: 0;
    opacity: 0.85;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  }
  .hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero-typed { justify-content: center; }
  .hero-lede { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-latin { text-align: center; }
  .chip-medal { inset-inline-end: -12%; bottom: -30px; }
  .chip-stack { inset-inline-start: -12%; top: 6%; }
  .hero-grid { row-gap: 72px; }

  .about-grid { grid-template-columns: 1fr; }

  .timeline { --label: 0px; --gap: 40px; gap: 40px; }
  .timeline::before, .timeline::after { inset-inline-start: 6px; }
  .tl-year { grid-template-columns: 1fr; column-gap: 0; padding-inline-start: 40px; }
  .tl-year-label { position: static; flex-direction: row; align-items: baseline; gap: 12px; margin-bottom: 14px; }
  .tl-year-label span { font-size: 2.4rem; }
  .tl-card::before { inset-inline-start: -40px; }

  .featured { grid-template-columns: 1fr; }

  .cat-row {
    grid-template-columns: 112px minmax(0, 1fr) 1.6rem;
    grid-template-areas:
      "thumb title arrow"
      "thumb meta  arrow";
    gap: 4px 16px;
    padding: 16px 6px;
  }
  .cat-thumb { display: block; grid-area: thumb; }
  .cat-thumb img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
  .cat-num { display: none; }
  .cat-title { grid-area: title; }
  .cat-title strong { font-size: 1rem; }
  .cat-meta-m { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 0.8rem; color: var(--text-3); }
  .cat-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.06em; }
  .cat-domain, .cat-date { display: none; }
  .cat-arrow { grid-area: arrow; }
  .cat-preview { display: none; }

  .lb-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 56%) minmax(0, 44%);
    grid-template-areas: "stage" "info";
  }
  .lb-stage { padding: 56px 14px 14px; }
  .lb-info { border-inline-end: 0; border-top: 1px solid var(--line); }
  .lb-bar { position: absolute; top: 0; inset-inline: 0; z-index: 3; padding: 8px 10px; border: 0; background: linear-gradient(to bottom, rgba(5, 7, 10, 0.9), transparent); }
  .lb-body { padding: 18px 18px 28px; }
  .lb-body h2 { font-size: 1.25rem; margin-top: 12px; }
  .lb-nav { top: auto; bottom: 22px; margin-top: 0; width: 44px; height: 44px; }
  .lb-keys { display: none; }
}

@media (min-width: 901px) {
  .cat-meta-m { display: none; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .site-header { top: 10px; }
  .hero-title { margin-top: 20px; }
  .hero-latin { font-size: 0.64rem; letter-spacing: 0.16em; }
  .hero-latin span { margin-inline: 0.5em; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div { padding-inline: 14px; }
  .hero-stats > div:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
  .hero-stats > div:nth-child(4) { padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
  .hero-stats > div:last-child { grid-column: 1 / -1; }
  .hero-stats > div:last-child { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
  .chip-medal { inset-inline-end: -6%; padding-block: 8px; }
  .chip-stack { display: none; }
  .projects { gap: 14px; }
  .projects > *, .projects > :nth-child(2), .projects > :nth-child(3) { grid-column: 1 / -1; min-height: 0; }
  .project--featured { min-height: 420px; }
  .project { padding: 24px; }
  .now-strip { border-radius: var(--r-md); }
  .honor { grid-template-columns: 1fr; }
  .honor .exhibit { max-width: 280px; justify-self: center; }
  .sum-stats { justify-content: space-between; }
  .contact-grid { grid-template-columns: 1fr; gap: 10px; }
  .contact-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    row-gap: 0;
    align-items: center;
    padding: 16px 18px;
  }
  .contact-item .ico { grid-row: 1 / 3; margin-bottom: 0; }
  .project-kicker { letter-spacing: 0.08em; }
  .spec dl > div { grid-template-columns: 6.5rem 1fr; }
  .resume-cta .btn { width: 100%; }
  .footer-inner { flex-direction: column-reverse; align-items: flex-start; }
}

@media (hover: none) {
  .cat-preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .hero-in, .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .float-chip { animation: none; }
}
