/* ----------------------------------------------------------------------------
   Abhishek Pahuja — portfolio stylesheet
   Bold sans, soft surfaces, scroll-driven reveals. No external dependencies.
   ---------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f4f3ef;
  --surface: #e9e8e2;
  --surface-strong: #deddd6;
  --text: #111318;
  --muted: #5d6169;
  --line: rgba(17, 19, 24, 0.14);
  --accent: #126b4c;
  --accent-ink: #f8fffb;
  --band-bg: #0b0d10;
  --band-text: #f2f3ef;
  --band-muted: #9ea4ad;
  --band-accent: #42d392;
  --shadow: 0 24px 70px rgba(17, 19, 24, 0.10);
  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 28px;
  --ease: cubic-bezier(0.22, 0.75, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --surface: #15181d;
    --surface-strong: #1c2026;
    --text: #f2f3ef;
    --muted: #9ea4ad;
    --line: rgba(242, 243, 239, 0.14);
    --accent: #42d392;
    --accent-ink: #07110d;
    --band-bg: #15181d;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #e9e8e2;
  --surface-strong: #deddd6;
  --text: #111318;
  --muted: #5d6169;
  --line: rgba(17, 19, 24, 0.14);
  --accent: #126b4c;
  --accent-ink: #f8fffb;
  --band-bg: #0b0d10;
  --shadow: 0 24px 70px rgba(17, 19, 24, 0.10);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #15181d;
  --surface-strong: #1c2026;
  --text: #f2f3ef;
  --muted: #9ea4ad;
  --line: rgba(242, 243, 239, 0.14);
  --accent: #42d392;
  --accent-ink: #07110d;
  --band-bg: #15181d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

/* Base ---------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms ease, color 240ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 52rem);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 52rem);
}

a {
  color: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  font: inherit;
}

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

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

h1,
h2,
h3 {
  margin: 0 0 1.1rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 7.4vw, 6.8rem);
  letter-spacing: -0.045em;
  line-height: 0.96;
}

h2 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
}

h3 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  transform: translateY(-200%);
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

/* Type helpers ---------------------------------------------------------------- */

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

.eyebrow span {
  margin-inline: 0.45em;
  color: var(--muted);
}

.meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.lead {
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: var(--line);
}

.text-link:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

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

.tag-list li {
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

/* Buttons -------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 200ms var(--ease), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--text);
}

.button--primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.button--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* Header --------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  transition: border-color 240ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

/* Over the dark band the header adopts the band's palette. */
.site-header.is-over-band {
  background: color-mix(in srgb, var(--band-bg) 72%, transparent);
  border-bottom-color: rgba(242, 243, 239, 0.12);
  color: var(--band-text);
}

.site-header.is-over-band .site-nav a {
  color: var(--band-muted);
}

.site-header.is-over-band .site-nav a:hover,
.site-header.is-over-band .site-nav a[aria-current="page"],
.site-header.is-over-band .theme-toggle {
  color: var(--band-text);
}

.site-header.is-over-band .theme-toggle {
  border-color: rgba(242, 243, 239, 0.2);
}

.site-header.is-over-band .brand span {
  color: var(--band-accent);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}

.brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.2rem);
}

.site-nav a {
  padding-block: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
}

.theme-toggle__mark {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* Hero ----------------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: calc(100svh - 64px);
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: clip;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 980px;
}

.hero h1 {
  max-width: 15ch;
  margin-bottom: 1.75rem;
}

.hero h1 .word {
  display: inline-block;
}

.hero__summary {
  max-width: 62ch;
  margin-bottom: 1.9rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.5;
}

.hero__summary strong {
  color: var(--text);
  font-weight: 600;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.availability {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.availability__dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero__facts {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.6rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__field {
  position: absolute;
  top: 8%;
  right: -12vw;
  width: min(56vw, 780px);
  aspect-ratio: 1;
  opacity: 0.6;
  pointer-events: none;
}

.orbit,
.signal {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.orbit--one {
  animation: orbit 28s linear infinite;
}

.orbit--one::before,
.orbit--two::before {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 28px var(--accent);
}

.orbit--two {
  inset: 17%;
  animation: orbit 19s linear infinite reverse;
}

.signal {
  inset: 34%;
  border: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent), transparent 68%);
  animation: pulse 4.5s ease-in-out infinite;
}

/* Stats ---------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  display: grid;
  align-content: start;
  min-height: 170px;
  padding: 1.9rem 1.4rem 1.9rem 0;
  border-right: 1px solid var(--line);
}

.stat + .stat {
  padding-left: 1.4rem;
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: clamp(2.1rem, 3.8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat > span {
  max-width: 20ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.stat small {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Sections ------------------------------------------------------------------- */

.section {
  padding-block: clamp(5rem, 10vw, 8rem);
}

.section-head {
  max-width: 820px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2 {
  max-width: 16ch;
}

/* Work cards ----------------------------------------------------------------- */

.stack {
  display: grid;
  gap: 1.25rem;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.32fr);
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.6rem, 4vw, 3.25rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card::after {
  position: absolute;
  right: -14%;
  bottom: -48%;
  width: 52%;
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  background: var(--card-color);
  opacity: 0.16;
  filter: blur(2px);
  pointer-events: none;
}

.card--lime { --card-color: #42d392; }
.card--blue { --card-color: #5b8cff; }
.card--violet { --card-color: #9c74ff; }
.card--orange { --card-color: #ff9e56; }
.card--pink { --card-color: #fa6c95; }
.card--teal { --card-color: #37c6c0; }
.card--amber { --card-color: #f0c050; }

.card > * {
  position: relative;
  z-index: 1;
}

.card__body {
  min-width: 0;
}

.card__index {
  margin: 0 0 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.card h3 {
  max-width: 24ch;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  line-height: 1.04;
}

.card__xyz {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.card__xyz strong {
  color: var(--text);
  font-weight: 600;
}

.card__metric {
  align-self: end;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.card__metric strong,
.card__metric span {
  display: block;
}

.card__metric strong {
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
  white-space: nowrap;
}

.card__metric span {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.card details {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.card summary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.card summary::-webkit-details-marker {
  display: none;
}

.card summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 220ms var(--ease), background-color 200ms ease;
}

.card details[open] summary::before {
  content: "–";
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.card summary:hover {
  color: var(--accent);
}

.card__detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2.5rem;
  max-width: 72ch;
  margin-top: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.card__detail h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.card__detail p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card__detail > div {
  min-width: 0;
}

/* Sticky card stacking on large screens; opt out when a card is expanded. */
@media (min-width: 960px) and (min-height: 720px) {
  .stack {
    gap: 1.5rem;
  }

  .card {
    position: sticky;
    top: calc(5.5rem + var(--n, 0) * 0.9rem);
  }

  .card.is-expanded {
    position: relative;
    top: auto;
  }
}

/* Approach band -------------------------------------------------------------- */

.approach {
  background: var(--band-bg);
  color: var(--band-text);
}

.approach__track {
  min-height: 200svh;
}

.approach__sticky {
  position: sticky;
  top: 0;
  display: grid;
  align-content: center;
  gap: clamp(2rem, 5vw, 3.5rem);
  min-height: 100svh;
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.approach .eyebrow {
  color: var(--band-accent);
}

.approach blockquote {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(2.2rem, 5.2vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  text-wrap: balance;
}

.approach blockquote .word {
  display: inline-block;
  transition: opacity 260ms ease, color 260ms ease;
}

.approach.is-scripted blockquote .word {
  opacity: 0.22;
}

.approach.is-scripted blockquote .word.is-lit {
  opacity: 1;
}

.approach blockquote em {
  font-style: normal;
  color: var(--band-accent);
}

.tenets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tenets li {
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid rgba(242, 243, 239, 0.14);
  border-radius: 20px;
  background: rgba(242, 243, 239, 0.04);
}

.tenets .card__index {
  margin-bottom: 1.1rem;
  color: var(--band-muted);
}

.tenets h3 {
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.tenets p {
  margin: 0;
  color: var(--band-muted);
  font-size: 0.92rem;
}

.approach.is-scripted .tenets li {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.approach.is-scripted .tenets.is-lit li {
  opacity: 1;
  transform: none;
}

/* Services ------------------------------------------------------------------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.service {
  display: grid;
  align-content: start;
  padding: 1.75rem 1.6rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: transform 260ms var(--ease), border-color 200ms ease;
}

.service:hover {
  transform: translateY(-3px);
  border-color: var(--text);
}

.service .card__index {
  margin-bottom: 1.3rem;
}

.service h3 {
  margin-bottom: 0.6rem;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.service p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.service--cta {
  align-content: end;
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.service--cta h3 {
  font-size: 1.6rem;
}

.service--cta .text-link {
  color: var(--bg);
  text-decoration-color: color-mix(in srgb, var(--bg) 40%, transparent);
}

/* Writing -------------------------------------------------------------------- */

.writing-home {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.writing-home h2 {
  max-width: 13ch;
}

.latest-writing {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.latest-writing li {
  border-bottom: 1px solid var(--line);
}

.latest-writing a {
  display: grid;
  gap: 0.45rem;
  padding: 1.3rem 0;
  text-decoration: none;
}

.latest-writing strong {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.22;
  transition: color 160ms ease;
}

.latest-writing a:hover strong {
  color: var(--accent);
}

/* Contact -------------------------------------------------------------------- */

.contact h2 {
  max-width: 18ch;
}

.audiences {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin: 2.25rem 0;
}

.audiences article {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.audiences h3 {
  margin-bottom: 0.4rem;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.audiences p {
  margin: 0;
  color: var(--muted);
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
}

.contact__email {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--line);
}

.contact__email:hover {
  color: var(--accent);
}

/* Footer --------------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* Writing archive ------------------------------------------------------------ */

.page-head {
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 4vw, 3rem);
}

.page-head h1 {
  max-width: 12ch;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 4rem;
}

.writing-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: transform 260ms var(--ease), border-color 200ms ease;
}

.writing-card:hover {
  transform: translateY(-3px);
  border-color: var(--text);
}

.writing-card h2 {
  margin: 0.9rem 0 0.75rem;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.writing-card h2 a {
  text-decoration: none;
}

.writing-card h2 a:hover {
  color: var(--accent);
}

.writing-card > p:not(.meta) {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.6;
}

.writing-card .tag-list {
  margin-top: auto;
}

/* Article -------------------------------------------------------------------- */

.article-page {
  max-width: 46rem;
  padding: clamp(3rem, 6vw, 4.5rem) 0 4rem;
}

.article__head .back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.article__head .back:hover {
  color: var(--text);
}

.article__head h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 1.04;
  overflow-wrap: break-word;
}

.article__head .tag-list {
  margin-top: 0.9rem;
}

.article-body {
  margin-top: 2.5rem;
  font-size: 1.1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.article-body > p:first-child {
  font-size: 1.22rem;
  line-height: 1.6;
}

.article-body p {
  margin: 1.35rem 0;
}

.article-body h2,
.article-body h4 {
  margin: 2.5rem 0 0.9rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.article-body ul,
.article-body ol {
  margin: 1.35rem 0;
  padding-left: 1.4rem;
}

.article-body li {
  margin: 0.5rem 0;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--line);
}

.article-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.article-body blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.article-body figure {
  margin: 2rem 0;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.article-body figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.article-body pre,
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-body pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.article-nav a {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 200ms ease, transform 260ms var(--ease);
}

.article-nav a:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

.article-nav .article-nav__older {
  text-align: right;
}

.article-nav span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-nav strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.article__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Not found ------------------------------------------------------------------ */

.not-found {
  display: grid;
  place-content: center;
  gap: 0.5rem;
  min-height: calc(100svh - 64px);
  padding: 4rem 0;
  text-align: center;
}

.not-found h1 {
  max-width: 12ch;
  margin-inline: auto;
}

.not-found .lead {
  margin: 0 auto 1.5rem;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

/* Scroll reveals ------------------------------------------------------------- */

.reveal-pending {
  opacity: 0;
  transform: translateY(28px);
}

.reveal-pending.in {
  opacity: 1;
  transform: none;
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.reveal-pending.in .word {
  animation: word-in 700ms var(--ease) both;
  animation-delay: calc(var(--w, 0) * 60ms);
}

@keyframes word-in {
  from { opacity: 0; transform: translateY(0.35em); }
  to { opacity: 1; transform: none; }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { transform: scale(1.12); opacity: 0.7; }
}

@keyframes pulse-dot {
  50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent); }
}

/* Scroll-linked hero fade where the browser supports scroll timelines. */
@supports (animation-timeline: scroll()) {
  .hero__content,
  .hero__facts {
    animation: hero-out linear both;
    animation-timeline: scroll(root);
    animation-range: 0 80vh;
  }

  @keyframes hero-out {
    to { opacity: 0.1; transform: translateY(-48px) scale(0.97); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-pending,
  .approach.is-scripted blockquote .word,
  .approach.is-scripted .tenets li {
    opacity: 1 !important;
    transform: none !important;
  }

  .card {
    position: relative !important;
    top: auto !important;
  }
}

/* Responsive ----------------------------------------------------------------- */

@media (max-width: 960px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    padding-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat:nth-child(even) {
    border-right: 0;
    padding-left: 1.4rem;
  }

  .stat:nth-child(n + 3) {
    border-bottom: 0;
  }

  .card {
    grid-template-columns: 1fr;
  }

  .card__metric {
    align-self: start;
    margin-top: 0.5rem;
  }

  .tenets,
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .writing-home {
    grid-template-columns: 1fr;
  }

  .hero__field {
    top: 12%;
    right: -36vw;
    width: 90vw;
    opacity: 0.4;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 7.5rem;
  }

  .site-header__inner {
    grid-template-columns: 1fr auto;
    padding-bottom: 0.35rem;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 1rem;
  }

  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: 0.84rem;
  }

  .theme-toggle [data-theme-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 3.8rem);
  }

  .hero__actions .button {
    width: 100%;
  }

  .card {
    padding: 1.5rem;
  }

  .card__detail,
  .tenets,
  .services-grid,
  .writing-grid,
  .article-nav {
    grid-template-columns: 1fr;
  }

  .approach__sticky {
    min-height: auto;
    position: relative;
  }

  .approach__track {
    min-height: auto;
  }

  .article-nav .article-nav__older {
    text-align: left;
  }

  .site-footer {
    flex-direction: column;
  }
}
