/* ============================================================
   The Freelancerr — portfolio
   Theme: "workshop at golden hour" — deep-sea field, warm chalk
   ink, one brass accent. Zero CDN. No cyan. No hologram bloom.
   ============================================================ */

:root {
  /* palette — deep field */
  --void:       #0a1420;
  --surface:    #0f2340;
  --surface-2:  #16294a;
  --ink:        #ede7dc;                 /* chalk */
  --ink-dim:    #a8b0bc;
  --line:       rgba(237, 231, 220, 0.12);
  --line-strong: rgba(237, 231, 220, 0.22);

  /* single warm accent */
  --accent:       #c9a227;
  --accent-bright:#ddb63c;
  --accent-soft:  rgba(201, 162, 39, 0.14);
  --accent-glow:  rgba(201, 162, 39, 0.45);

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* motion / shape */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(201, 162, 39, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(22, 41, 74, 0.55), transparent 55%),
    var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain — softer than before */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: var(--accent-bright); }

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

main { position: relative; z-index: 1; }

/* ---------- scrollbar ---------- */

* { scrollbar-width: thin; scrollbar-color: var(--accent) rgba(10, 20, 32, 0.6); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(10, 20, 32, 0.6); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-bright));
  border-radius: 999px;
  border: 2px solid rgba(10, 20, 32, 0.6);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-bright); }

/* ---------- type helpers ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 2.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-title em {
  font-weight: 400;
  font-style: italic;
  color: var(--accent-bright);
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(10, 20, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav.scrolled {
  background: rgba(8, 16, 26, 0.92);
  box-shadow: 0 1px 0 var(--line);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.sigil {
  width: 42px;
  height: 42px;
  opacity: 1;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong), 0 8px 18px -8px rgba(3, 8, 16, 0.85);
  transform: rotate(-6deg);
  transition: transform 0.5s var(--ease), box-shadow 0.4s var(--ease);
}

.nav-brand:hover .sigil {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px -6px var(--accent-glow);
}

.nav-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.2rem);
}

.nav-links a {
  position: relative;
  color: var(--ink-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transition: color 0.25s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-links a:hover { color: var(--ink); }

/* ---------- hero ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(9rem, 16vh, 12rem) clamp(1.2rem, 4vw, 3rem) clamp(5rem, 9vh, 7rem);
  background: radial-gradient(65% 55% at 50% 8%, var(--accent-glow), transparent 72%);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.7rem, 6.2vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero-title .line { display: block; }

.hero-title .line:nth-child(2) .line-inner {
  font-style: italic;
  font-weight: 500;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-bright) 28%, var(--ink) 50%, var(--accent-bright) 72%, var(--accent) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: sheen 9s linear infinite;
}

@keyframes sheen {
  to { background-position: 220% 0; }
}

.hero-sub {
  max-width: 56ch;
  margin: 1.8rem 0 0;
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.hero-sub strong {
  color: var(--accent-bright);
  font-weight: 600;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.6rem;
}

/* ---------- section anchors ---------- */

#work, #proof, #story, #contact, #top {
  scroll-margin-top: 88px;
}

/* ---------- availability ---------- */

.available {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.4rem 0 0;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.available i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: avail-pulse 2.4s var(--ease) infinite;
}

@keyframes avail-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  60% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #10151d;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 14px 32px -14px var(--accent-glow);
}

.btn:active {
  transform: translateY(-1px) scale(0.99);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: none;
}

.btn-big { padding: 1.1rem 2.2rem; font-size: 0.9rem; }

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  padding: 1rem 0;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  white-space: nowrap;
  animation: marquee 34s linear infinite;
}

.marquee-track span {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.marquee-track i {
  color: var(--accent);
  font-style: normal;
  font-size: 0.7rem;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* ---------- about / proof ---------- */

.about {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-text p:not(.eyebrow) {
  color: var(--ink-dim);
  font-size: 1.02rem;
  margin: 0;
  max-width: 52ch;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.6rem;
  margin: 0;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  padding: 1.1rem 1.2rem;
}

.stat dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  color: var(--accent-bright);
}

.stat dd {
  margin: 0.35rem 0 0;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats .stat {
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.stats .stat:hover {
  border-color: rgba(201, 162, 39, 0.45);
  transform: translateY(-3px);
}

/* ---------- work / bento ---------- */

.work {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.2rem, 4vw, 3rem);
}

.work-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
}

.work-head .section-title { margin: 0; }

.work-cta {
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s var(--ease);
}

.work-cta:hover {
  color: var(--accent-bright);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.2rem;
}

.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.card {
  position: relative;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  padding: 1.6rem;
  overflow: hidden;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 22px 44px -22px rgba(3, 8, 16, 0.85), 0 0 0 1px rgba(201, 162, 39, 0.12) inset;
}

/* clickable card wrapper */
.card-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  text-decoration: none;
  color: inherit;
}

.card-arrow {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  color: var(--accent-bright);
  font-size: 1rem;
  line-height: 1;
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.card:hover .card-arrow {
  opacity: 1;
  transform: none;
}

/* private / NDA card — deliberately inert */
.card-private:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.nda {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chip {
  display: inline-block;
  margin: 0;
  padding: 0.32rem 0.75rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-body h3 {
  margin: 0.4rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card-copy {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
  line-height: 1.65;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.stack li {
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

/* pipe visual (Gig Autopilot) */
.card-vis.pipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.pipe-node {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.pipe-arrow {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.more {
  margin: 2.6rem 0 0;
  color: var(--ink-dim);
  font-size: 0.74rem;
  line-height: 1.9;
}

/* ---------- story — vertical editorial ---------- */

.story {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.2rem, 4vw, 3rem);
}

.story-head {
  max-width: 60ch;
  margin-bottom: 4.5rem;
}

.frames {
  display: flex;
  flex-direction: column;
  gap: 7rem;
}

.frame {
  margin: 0;
}

.frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -40px rgba(3, 8, 16, 0.9);
  transition: transform 1.1s var(--ease), box-shadow 0.6s var(--ease);
}

.frame:hover img {
  transform: scale(1.03);
  box-shadow: 0 34px 80px -38px rgba(3, 8, 16, 0.95);
}

/* editorial text frames — case study / credentials */
.frame-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  letter-spacing: 0.24em;
  font-size: 0.78rem;
}

.frame-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 26ch;
}

.frame-copy {
  margin: 1.1rem 0 0;
  max-width: 58ch;
  color: var(--ink-dim);
  line-height: 1.75;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  margin-top: 1.9rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metric-strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

.metric-label {
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.frame figcaption {
  margin-top: 1rem;
  color: var(--ink-dim);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.frame-actions {
  margin-top: 1.2rem;
}

.frame-actions .btn {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* ---------- credentials — real certificates, pictures ---------- */

.cred-sec {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(5rem, 10vh, 8rem) clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 4rem;
}

.cred-sec .frame-copy {
  margin-top: 1.4rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.4rem;
  margin-top: 3rem;
}

.cert-card {
  margin: 0;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}

.cert-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

a.cert-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
}
.cert-link:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.cert-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 1.1rem;
  background: var(--void);
}

.cert-card.cert-feature img {
  aspect-ratio: 4 / 3;
}

.cert-caption {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1.1rem;
  border-top: 1px solid var(--line);
}

.cert-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--ink);
}

.cert-issuer {
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cert-pdf {
  margin-top: 0.5rem;
  color: var(--accent-bright);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  align-self: flex-start;
  transition: border-color 0.3s var(--ease);
}

.cert-pdf:hover { border-color: var(--accent-bright); }

.prof-link {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.85em;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 4px;
  transition: color 0.25s var(--ease), text-decoration-color 0.25s var(--ease);
}
.prof-link:hover { color: var(--ink); text-decoration-color: var(--accent-bright); }

/* ---------- contact ---------- */

.contact {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(5rem, 12vh, 9rem) clamp(1.2rem, 4vw, 3rem) clamp(4rem, 8vh, 6rem);
  text-align: center;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.2rem);
  margin: 2.4rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-links a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.contact-links a:hover { color: var(--accent-bright); }

.footnote {
  margin: 3.4rem 0 0;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

/* ---------- footer ---------- */

.footer {
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.72rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.to-top span {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.to-top:hover { color: var(--accent-bright); }

.to-top:hover span { transform: translateY(-2px); }

/* ---------- reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

[data-reveal].is-inview {
  opacity: 1;
  transform: none;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .hero-title .line:nth-child(2) .line-inner { animation: none; }
  .available i { animation: none; }
  .progress { animation: none !important; }
  .card:hover .pipe-arrow { animation: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .span-5, .span-6, .span-7 { grid-column: span 12; }
  .frames { gap: 4rem; }
  .nav-links { display: none; }
}

/* ---------- language switch ---------- */

/* neutral nav fix: with a 3rd child (.lang-switch) in the fixed nav,
   auto margin keeps the link group pinned right (identical for EN's 2-child nav) */
.nav-links { margin-inline-start: auto; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* comfortable tap target on both EN + fa nav */
  margin-inline-start: 1.4rem;
  font-size: 0.78rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--accent-bright);
  border-color: var(--accent);
}

/* ---------- scroll progress line (CSS scroll-driven, zero JS) ---------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: progress-grow linear;
  animation-duration: auto;
  animation-timeline: scroll(root);
}

@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

html[lang="fa"] .progress {
  transform-origin: 100% 50%;
}

/* ---------- story scrollytelling — pinned crossfade ----------
   main.js adds .pinned to .story-pin on desktop (ScrollTrigger +
   no reduced motion). Without it the frames stay a static column. */

html.js-on body.anim .story-pin.pinned .frames {
  display: grid;
}

html.js-on body.anim .story-pin.pinned .frame {
  grid-area: 1 / 1;
  margin: 0;
}

.story-cue {
  display: none;
}

html.js-on body.anim .story-pin.pinned .story-cue {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.8rem;
}

.cue-num,
.cue-total {
  color: var(--accent-bright);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.cue-track {
  position: relative;
  display: inline-block;
  width: clamp(120px, 20vw, 240px);
  height: 1px;
  background: var(--line-strong);
  overflow: hidden;
}

.cue-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

html[lang="fa"] .cue-fill {
  transform-origin: 100% 50%;
}

/* ---------- pipe visual (flag card) — slide on hover ---------- */

.pipe-arrow {
  --pipe-x: 0.3em;
  display: inline-block;
}

html[lang="fa"] .pipe-arrow {
  --pipe-x: -0.3em;
}

@keyframes pipe-slide {
  from { transform: translateX(0); }
  to { transform: translateX(var(--pipe-x)); }
}

.card:hover .pipe-arrow {
  animation: pipe-slide 0.9s var(--ease) infinite alternate;
}

/* ---------- Farsi (fa) overrides ---------- */

html[lang="fa"] body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

html[lang="fa"] .mono,
html[lang="fa"] .nav-links a,
html[lang="fa"] .nav-name,
html[lang="fa"] .pipe-node,
html[lang="fa"] .marquee .marquee-track span,
html[lang="fa"] .marquee .marquee-track i {
  font-family: "Vazirmatn", var(--font-mono);
  letter-spacing: 0;
}

html[lang="fa"] .hero-title,
html[lang="fa"] .section-title,
html[lang="fa"] .frame-title,
html[lang="fa"] .card h3 {
  font-family: "Vazirmatn", var(--font-display);
  letter-spacing: 0;
}

html[lang="fa"] .hero-title {
  font-weight: 700;
}

html[lang="fa"] .hero-title .line:nth-child(2) .line-inner,
html[lang="fa"] .section-title em {
  font-style: normal;
}

html[lang="fa"] .eyebrow,
html[lang="fa"] .frame-kicker {
  text-transform: none;
}

/* ---- @font-face (merged from assets/fonts/fonts.css; one CSS request) ----
   Inter / JetBrains Mono: latin + latin-ext subsets only (cyrillic/greek/
   vietnamese faces removed - never matched by EN/fa text).
   Fraunces: 600 normal (headings/names), 700 normal (hero), 400 italic (em).
   Vazirmatn: 400 + 700 for the fa mirror.
   All faces font-display: swap. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/font-6.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/font-7.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: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/font-6.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/font-7.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: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/font-6.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/font-7.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: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/font-12.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/font-13.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: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/fraunces-latin-600-normal.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: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/fraunces-latin-700-normal.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: 'Fraunces'; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/fraunces-latin-400-italic.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: 'Vazirmatn'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/vazirmatn-regular.woff2) format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/vazirmatn-bold.woff2) format('woff2'); }

