/* ==========================================================================
   dilkhushmeena.in — design system
   Tokens are declared once on :root (light), then redefined for dark under
   both the media query and the explicit [data-theme] stamp, so all three
   theme states (light / dark / system) resolve as a complete set.
   ========================================================================== */

:root {
  /* surfaces */
  --ground:     #FAFAF9;
  --surface:    #FFFFFF;
  --surface-2:  #F1F1EF;
  --inset:      #F5F5F3;

  /* text */
  --ink:        #121417;
  --ink-2:      #33383E;
  --muted:      #5C636B;
  --faint:      #868D95;

  /* structure */
  --line:       #E2E3E5;
  --line-2:     #CFD1D4;

  /* small mono text that should stay quiet but remain comfortably readable */
  --quiet-text: #545B63;

  /* accent — deep forest green */
  --accent:     #1B4D3E;
  --accent-2:   #143B2F;
  --accent-ink: #FFFFFF;
  --accent-soft:#E6EFEA;

  /* status */
  --live:       #1F7A4D;
  --live-soft:  #E4F1EA;
  --wip:        #8A6410;
  --wip-soft:   #F6EEDA;

  /* shadow — quiet studio elevation levels */
  --lift:       0 1px 2px rgba(18, 20, 23, .04), 0 8px 24px rgba(18, 20, 23, .06);
  --lift-hover: 0 2px 6px rgba(18, 20, 23, .06), 0 12px 32px rgba(18, 20, 23, .1);

  /* type */
  --f-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-body:    "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* metrics */
  --shell:     1100px;
  --measure:   68ch;
  --radius:    6px;
  --gutter:    clamp(16px, 5vw, 40px);
  --section:   clamp(64px, 11vw, 128px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:     #0F1113;
    --surface:    #181B1F;
    --surface-2:  #202429;
    --inset:      #141719;
    --ink:        #E8EAED;
    --ink-2:      #C3C8CE;
    --muted:      #8B939C;
    --faint:      #6B737B;
    --line:       #25292E;
    --line-2:     #353A41;
    --quiet-text: #A6AEB7;
    --accent:     #4FA383;
    --accent-2:   #63B896;
    --accent-ink: #0B1210;
    --accent-soft:#162620;
    --live:       #56B585;
    --live-soft:  #14271E;
    --wip:        #D2A343;
    --wip-soft:   #2A2414;
    --lift:       0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
    --lift-hover: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --ground:     #0F1113;
  --surface:    #181B1F;
  --surface-2:  #202429;
  --inset:      #141719;
  --ink:        #E8EAED;
  --ink-2:      #C3C8CE;
  --muted:      #8B939C;
  --faint:      #6B737B;
  --line:       #25292E;
  --line-2:     #353A41;
  --quiet-text: #A6AEB7;
  --accent:     #4FA383;
  --accent-2:   #63B896;
  --accent-ink: #0B1210;
  --accent-soft:#162620;
  --live:       #56B585;
  --live-soft:  #14271E;
  --wip:        #D2A343;
  --wip-soft:   #2A2414;
  --lift:       0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --lift-hover: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
}

/* --------------------------------------------------------------- reset -- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Selective theme crossfade (no universal * selector) */
body,
.site-header,
.card,
.frame,
.frame__bar,
.arch,
.arch__node,
.arch__card,
.story,
.services > div,
.contact,
.site-footer,
.theme-toggle,
.preview-flag {
  transition: background-color .22s ease, border-color .22s ease, color .22s ease;
}

picture { display: block; width: 100%; }
img, svg { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border: 1px solid var(--line-2);
  border-radius: var(--radius); z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

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

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.05rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); letter-spacing: -0.015em; }

p { margin: 0; }

.lead {
  font-size: clamp(1.05rem, 1.9vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 54ch;
}

.body-text { color: var(--ink-2); max-width: var(--measure); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono { font-family: var(--f-mono); }

/* -------------------------------------------------------------- layout -- */

.shell {
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding-block: var(--section); }
section + section { padding-top: 0; }

.stack   { display: flex; flex-direction: column; }
.gap-sm  { gap: 12px; }
.gap-md  { gap: 20px; }
.gap-lg  { gap: 32px; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
  max-width: var(--measure);
}

/* -------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease;
}
.site-header[data-stuck="true"] { border-bottom-color: var(--line); }

.site-header .shell {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.wordmark {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}
.wordmark span { color: var(--muted); font-weight: 400; }

/* On a phone the subtitle wraps the wordmark onto a second line and the
   sticky bar eats the top of the page, so the header keeps the name only. */
@media (max-width: 599px) {
  .wordmark span { display: none; }
  .wordmark { font-size: 1rem; }
  .site-header .shell { min-height: 52px; gap: 10px; }
  .site-header .btn--sm { min-height: 36px; padding: 6px 13px; font-size: .86rem; }
}

/* -------------------------------------------------------------- button -- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: .94rem;
  font-weight: 500;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { border-color: var(--ink-2); }

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

.btn--quiet {
  background: transparent;
  border-color: transparent;
  padding-inline: 4px;
  color: var(--ink-2);
}
.btn--quiet:hover { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .btn:not(.btn--quiet):hover {
    transform: translateY(-1px);
  }
  .btn--quiet:hover {
    transform: translateX(2px);
  }
}

.btn--sm { min-height: 38px; padding: 7px 14px; font-size: .88rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ------------------------------------------------------------- badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge--live { background: var(--live-soft); color: var(--live); }
.badge--wip  { background: var(--wip-soft);  color: var(--wip); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

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

.hero { padding-block: clamp(48px, 9vw, 96px) var(--section); }

.hero__avail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--live);
  margin-bottom: 22px;
}
.hero__avail .dot {
  position: relative;
}
.hero__avail .dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__avail .dot::after {
    animation: live-pulse 3s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  }
  @keyframes live-pulse {
    0% {
      transform: scale(0.6);
      opacity: 0.6;
    }
    50% {
      transform: scale(1.8);
      opacity: 0;
    }
    100% {
      transform: scale(1.8);
      opacity: 0;
    }
  }
}

.hero h1 { max-width: 26ch; margin-bottom: 22px; }
.hero .lead { margin-bottom: 32px; }

/* --------------------------------------------------------- proof strip -- */

.proof {
  border-block: 1px solid var(--line);
  padding-block: 22px;
}

.proof__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 28px;
  margin-bottom: 18px;
}

.proof__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* keep badges at their own width, not the column's */
  gap: 5px;
  text-decoration: none;
  padding: 6px 0;
  border-top: 2px solid transparent;
  transition: border-color .18s ease, transform .18s ease;
}
.proof__item:hover { border-top-color: var(--accent); }
.proof__item:hover .proof__name { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .proof__item:hover {
    transform: translateY(-1px);
  }
}

.proof__name {
  font-weight: 600;
  font-size: 1rem;
  transition: color .13s ease;
}
.proof__what { font-size: .86rem; color: var(--muted); }

.proof__note {
  font-size: .9rem;
  color: var(--muted);
  max-width: 62ch;
}

/* -------------------------------------------------------------- case ---- */

.case { display: flex; flex-direction: column; gap: 28px; }

.case__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.case__title { margin-block: 6px 0; }

.case__what {
  font-size: 1.02rem;
  color: var(--ink-2);
  max-width: var(--measure);
}

.case__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: var(--measure);
}
.case__points li {
  position: relative;
  padding-left: 20px;
  font-size: .97rem;
  color: var(--ink-2);
}
.case__points li::before {
  content: "";
  position: absolute;
  left: 2px; top: .62em;
  width: 6px; height: 1px;
  background: var(--accent);
}

.case__role {
  font-size: .95rem;
  color: var(--muted);
  max-width: var(--measure);
  padding-left: 14px;
  border-left: 2px solid var(--line-2);
}

/* two-up card row for the smaller projects */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--line-2); }
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--lift);
  }
}
.card h3 { font-size: 1.25rem; }
.card p { font-size: .95rem; color: var(--ink-2); }
.card .btn-row { margin-top: auto; padding-top: 8px; }

/* ------------------------------------------------- screenshot framing --- */

.frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--lift);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .frame:hover {
    border-color: var(--line-2);
    box-shadow: var(--lift-hover);
    transform: translateY(-1px);
  }
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.frame__dots { display: flex; gap: 5px; flex: none; }
.frame__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: block; }
.frame__url {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame__body { display: block; }

/* card preview framing */
.card__frame {
  margin: 0;
  border-radius: var(--radius);
  flex: none;
}
.card__frame .frame__body {
  height: 200px;
  overflow: hidden;
  position: relative;
}
.card__frame .frame__body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.card__frame .frame__body--contained {
  background: var(--inset);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 14px;
}
.card__frame .card__phone-img {
  width: 100%;
  max-width: 175px;
  height: auto;
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--line-2);
  border-bottom: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1), 0 8px 20px rgba(0, 0, 0, .08);
  display: block;
}

.frame__caption {
  font-family: var(--f-mono);
  font-size: .74rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 12px;
}

/* placeholder that stands in for a screenshot not yet captured */
.placeholder {
  aspect-ratio: 16 / 10;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent 0 11px,
      color-mix(in srgb, var(--line) 55%, transparent) 11px 12px
    ),
    var(--inset);
  max-width: 100%;
}
.placeholder__id {
  font-family: var(--f-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.placeholder__label {
  font-family: var(--f-body);
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-2);
  max-width: 34ch;
}
.placeholder__note {
  font-family: var(--f-mono);
  font-size: .7rem;
  color: var(--faint);
}

/* phone-shaped container */
.phone {
  width: min(300px, 100%);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--lift);
  margin-inline: auto;
}
.phone .placeholder { aspect-ratio: 9 / 17; border-radius: 0; }

/* ------------------------------------------- composite screenshot framing -- */

.frame--composite {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--lift);
}
.frame--composite .frame__body picture {
  display: block;
  width: 100%;
}
.frame--composite .frame__body img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------- how I build -- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.steps li {
  background: var(--surface);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 4px 20px;
  align-items: baseline;
}
.steps__name {
  font-family: var(--f-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.steps__text { color: var(--ink-2); font-size: .97rem; }

@media (max-width: 620px) {
  .steps li { grid-template-columns: 1fr; gap: 6px; }
}

/* --------------------------------------------------------- ops list ----- */

.ops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: var(--measure);
}
.ops li {
  font-family: var(--f-mono);
  font-size: .86rem;
  line-height: 1.68;
  color: var(--quiet-text);
  padding-left: 18px;
  position: relative;
}
.ops li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--line-2);
}

/* ------------------------------------------------------------ services -- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.services > div {
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.services h3 { font-family: var(--f-body); font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.services p { font-size: .92rem; color: var(--muted); }

.services-note {
  margin-top: 18px;
  font-size: .93rem;
  color: var(--muted);
}

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

.contact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact h2 { max-width: 18ch; }
.contact__hi {
  font-size: .9rem;
  color: var(--faint);
  font-style: italic;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--section);
  padding-block: 44px calc(36px + env(safe-area-inset-bottom, 0px));
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 30px;
  margin-bottom: 36px;
}
.footer__cols h4 {
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}
.footer__cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer__cols a { font-size: .93rem; color: var(--ink-2); text-decoration: none; }
.footer__cols a:hover { color: var(--accent); }

.footer__end {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: .86rem;
  color: var(--muted);
}
.footer__end p { max-width: 52ch; }

.theme-toggle {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 12px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .13s ease, border-color .13s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }

/* ------------------------------------------- progressive scroll reveal --- */
/* Elements are 100% visible by default in HTML/CSS. If JS runs and motion
   is permitted, html.js-reveal is added to enable subtle entry reveals. */
@media (prefers-reduced-motion: no-preference) {
  html.js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .28s ease, transform .28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  html.js-reveal [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn--quiet, .card, .frame, .proof__item,
  body, .site-header, .frame__bar, .arch, .arch__node, .arch__card,
  .story, .services > div, .contact, .site-footer, .theme-toggle, .preview-flag {
    transform: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------ preview --- */

.preview-flag {
  background: var(--wip-soft);
  color: var(--wip);
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .05em;
  text-align: center;
  padding: 7px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--wip) 30%, transparent);
}

/* ==========================================================================
   Case study pages
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent); }

.cs-head { padding-block: clamp(32px, 6vw, 56px) 0; }
.cs-head h1 { max-width: 20ch; margin-block: 14px 18px; }

.cs-answer {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
}

.cs-section { padding-block: clamp(40px, 7vw, 72px) 0; }
.cs-section > .shell > h2 { margin-bottom: 20px; }

.cs-body p { color: var(--ink-2); max-width: var(--measure); }
.cs-body p + p { margin-top: 14px; }

/* numbered engineering stories */
.story {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 20px;
}
.story:last-of-type { border-bottom: 1px solid var(--line); }
.story__n {
  font-family: var(--f-mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: .35em;
}
.story h3 { font-size: 1.18rem; margin-bottom: 12px; }
.story p { color: var(--ink-2); font-size: .97rem; max-width: var(--measure); }
.story p + p { margin-top: 12px; }
.story__figure {
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--quiet-text);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
@media (max-width: 620px) {
  .story { grid-template-columns: 1fr; gap: 8px; }
}

/* ----------------------------------------------- architecture flow ------- */

.arch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.arch__flow {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.arch__node {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch__node--accent {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.arch__step {
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--accent);
}

.arch__title {
  font-family: var(--f-body);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.arch__desc {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

.arch__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: .95rem;
  color: var(--line-2);
  user-select: none;
  flex: none;
}

.arch__sub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.arch__card {
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arch__pill {
  font-family: var(--f-mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.arch__card h4 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0;
}

.arch__card p {
  font-size: .8rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 820px) {
  .arch__flow {
    flex-direction: column;
    gap: 8px;
  }
  .arch__arrow {
    transform: rotate(90deg);
    padding-block: 2px;
  }
}

/* ---------------------------------------------------- image lightbox ---- */

.lightbox-trigger {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 18, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 32px);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.lightbox[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__dialog {
  max-width: min(96vw, 1440px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.lightbox__img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: block;
}

.lightbox__caption {
  font-family: var(--f-mono);
  font-size: .74rem;
  color: var(--muted);
  text-align: center;
  max-width: 65ch;
  line-height: 1.5;
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}

.lightbox__close:hover {
  color: var(--ink);
  border-color: var(--line-2);
}

/* plain stack / status lines */
.factline {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 8px 20px;
  max-width: var(--measure);
  font-size: .95rem;
}
.factline dt {
  font-family: var(--f-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: .35em;
}
.factline dd { margin: 0; color: var(--ink-2); }
@media (max-width: 620px) {
  .factline { grid-template-columns: 1fr; gap: 2px; }
  .factline dd { margin-bottom: 14px; }
}

/* ----------------------------------------------------------- site-nav ---- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  font-size: .88rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}
.site-nav a[aria-current="page"] {
  font-weight: 600;
}
@media (max-width: 768px) {
  .site-nav { display: none; }
}

/* --------------------------------------------------------- resources ----- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.resource-card:hover {
  border-color: var(--line-2);
}
@media (hover: hover) and (pointer: fine) {
  .resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--lift);
  }
}
.resource-card h3 {
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.3;
}
.resource-card:hover h3 {
  color: var(--accent);
}
.resource-card p {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.6;
}
.resource-card .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--faint);
}

/* ----------------------------------------------------- article prose ----- */
.article-header {
  padding-block: clamp(36px, 7vw, 64px) 0;
}
.article-header h1 {
  max-width: 24ch;
  margin-block: 16px 20px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: .76rem;
  color: var(--faint);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article-prose {
  font-size: 1.03rem;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: var(--measure);
}
.article-prose p {
  margin-bottom: 22px;
}
.article-prose h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  color: var(--ink);
  margin-block: 44px 16px;
  letter-spacing: -0.015em;
}
.article-prose h3 {
  font-size: 1.18rem;
  color: var(--ink);
  margin-block: 30px 12px;
}
.article-prose ul, .article-prose ol {
  margin: 0 0 22px 0;
  padding-left: 24px;
}
.article-prose li {
  margin-bottom: 8px;
  color: var(--ink-2);
}
.article-prose strong {
  color: var(--ink);
}
.article-prose code {
  font-family: var(--f-mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.takeaway-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-block: 32px;
}
.takeaway-card h4 {
  font-family: var(--f-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.takeaway-card p {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}
.related-work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
