:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --ink: #f5f5f7;
  --body: #c8c8cc;
  --muted: #86868b;
  --soft: rgba(245, 245, 247, 0.07);
  --line: rgba(245, 245, 247, 0.14);
  --line-strong: rgba(245, 245, 247, 0.26);
  --accent: #d8b45f;
  --accent-soft: rgba(216, 180, 95, 0.12);
  --leaf: #9dbb87;
  --bg-warm: #14120e;
  --max: 1320px;
  --gutter: clamp(1.25rem, 4vw, 4.75rem);
  --vine-space: clamp(4rem, 10vw, 9rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 14%, rgba(216, 180, 95, 0.08), transparent 24rem),
    linear-gradient(180deg, #0d0d0c 0%, #0f0f0d 46%, #0d0d0c 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body.detail-page {
  background:
    radial-gradient(circle at 8% 20%, rgba(157, 187, 135, 0.06), transparent 22rem),
    linear-gradient(180deg, #0d0d0c 0%, #11100d 48%, #0d0d0c 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

p,
h1,
h2,
h3,
ul,
ol,
dl {
  margin: 0;
}

ul,
ol {
  padding-left: 1.1rem;
}

li + li {
  margin-top: 0.65rem;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.site-nav {
  position: fixed;
  z-index: 60;
  inset: 0 var(--gutter) auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(13, 13, 12, 0.78);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: grid;
  gap: 0.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-lockup span:first-child {
  white-space: nowrap;
}

.brand-lockup span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.3vw, 2rem);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.vine-shell {
  position: fixed;
  z-index: 20;
  left: clamp(1.15rem, 3vw, 3.5rem);
  top: 96px;
  bottom: 32px;
  width: 86px;
  pointer-events: none;
}

.vine-shell svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.vine-track,
.vine-progress {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2;
}

.vine-track {
  stroke: rgba(245, 245, 247, 0.12);
}

.vine-progress {
  stroke: var(--accent);
  filter: drop-shadow(0 0 14px rgba(216, 180, 95, 0.18));
}

.vine-node {
  position: absolute;
  left: 40px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.42;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: opacity 220ms var(--ease), background 220ms var(--ease), transform 220ms var(--ease);
}

.vine-node.is-active {
  background: var(--accent);
  opacity: 1;
  transform: translate(-50%, -50%) rotate(45deg) scale(1.28);
}

.vine-node::after {
  content: "";
  position: absolute;
  left: 9px;
  top: -7px;
  width: 15px;
  height: 8px;
  border-radius: 14px 0 14px 0;
  background: rgba(157, 187, 135, 0.34);
  transform: rotate(-72deg);
  transform-origin: left center;
}

.vine-node:nth-of-type(odd)::after {
  left: -15px;
  top: 6px;
  transform: rotate(108deg);
}

.vine-node.is-active::after {
  background: rgba(157, 187, 135, 0.72);
}

.vine-node:nth-of-type(1) { top: 4%; }
.vine-node:nth-of-type(2) { top: 22%; }
.vine-node:nth-of-type(3) { top: 42%; }
.vine-node:nth-of-type(4) { top: 62%; }
.vine-node:nth-of-type(5) { top: 82%; }

.mobile-progress {
  position: fixed;
  z-index: 80;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: rgba(245, 245, 247, 0.12);
  display: none;
}

.mobile-progress span {
  display: block;
  width: calc(var(--scroll-progress, 0) * 100%);
  height: 100%;
  background: var(--accent);
}

.journey,
.site-footer,
.case-shell {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin: 0 auto;
}

.journey {
  padding-left: var(--vine-space);
  scroll-snap-type: y proximity;
}

.frame {
  min-height: 100svh;
  padding: calc(82px + clamp(3rem, 6vw, 6rem)) 0 clamp(3rem, 7vw, 7rem);
  display: grid;
  align-content: center;
  gap: clamp(1.4rem, 4vw, 3rem);
  scroll-snap-align: start;
}

.frame.tight {
  min-height: 76svh;
}

.frame.two-col {
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 0.78fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 8rem);
}

.context {
  color: var(--accent);
  font-size: clamp(0.95rem, 1.35vw, 1.06rem);
}

.micro {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
.display,
.case-title {
  max-width: 11ch;
  color: var(--ink);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.036em;
  text-wrap: balance;
}

h2 {
  max-width: 12ch;
  color: var(--ink);
  font-size: clamp(2.35rem, 5.4vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.034em;
  text-wrap: balance;
}

h3 {
  color: var(--ink);
  font-size: clamp(1.35rem, 2.5vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.lead {
  max-width: 68ch;
  color: var(--body);
  font-size: clamp(1.05rem, 1.65vw, 1.32rem);
}

.statement-stack {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.8rem);
}

.statement-stack p {
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.proof-path {
  display: grid;
  gap: 0;
}

.proof-link,
.artifact-link,
.case-row,
.resume-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  padding: clamp(1rem, 2.5vw, 1.55rem) 0;
}

.proof-link::before,
.artifact-link::before,
.case-row::before,
.resume-row::before,
.archive-line::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--line);
}

.proof-link span,
.artifact-link span,
.case-row span,
.resume-row span {
  color: var(--accent);
}

.proof-link strong,
.artifact-link strong,
.case-row strong,
.resume-row strong {
  color: var(--ink);
  font-size: clamp(1.35rem, 2.7vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.proof-link em,
.artifact-link em,
.case-row em {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-style: normal;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}

.proof-link:hover strong,
.artifact-link:hover strong,
.case-row:hover strong {
  color: color-mix(in srgb, var(--ink) 82%, var(--accent) 18%);
}

.metric-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.metric-line div {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.metric-line dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-line dd {
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.operating-list {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.operating-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.operating-list strong {
  color: var(--accent);
  font-weight: 600;
}

.operating-list span {
  color: var(--body);
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.artifact-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(190px, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  scrollbar-color: var(--accent) transparent;
}

.artifact {
  min-width: 190px;
  aspect-ratio: 3 / 4;
  display: grid;
  align-content: end;
  padding: 1rem;
  color: var(--ink);
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 100%),
    var(--soft);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.artifact strong {
  font-size: 1rem;
  line-height: 1.1;
}

.artifact span {
  color: var(--body);
  font-size: 0.78rem;
}

.contact-frame h2 {
  max-width: 14ch;
}

.contact-routes {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 3vw, 2rem);
  color: var(--body);
}

.contact-routes a,
.text-link {
  position: relative;
  width: fit-content;
  color: var(--accent);
  padding-bottom: 0.24rem;
}

.contact-routes a::after,
.text-link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
}

.scroll-cue {
  position: fixed;
  z-index: 25;
  right: var(--gutter);
  bottom: clamp(1rem, 3vw, 2rem);
  display: grid;
  justify-items: end;
  gap: 0.55rem;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.scroll-cue span {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 52px;
  overflow: hidden;
  background: var(--line);
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -2px;
  width: 5px;
  height: 18px;
  background: var(--accent);
  animation: cue-down 1.7s var(--ease) infinite;
}

.has-moved .scroll-cue {
  opacity: 0;
  transform: translateY(8px);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem var(--vine-space);
  color: var(--muted);
  font-size: 0.86rem;
}

.case-shell {
  padding: calc(82px + clamp(4rem, 8vw, 8rem)) 0 clamp(4rem, 8vw, 8rem) var(--vine-space);
}

.case-hero {
  min-height: 82svh;
  display: grid;
  align-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.case-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
  color: var(--muted);
}

.case-summary {
  max-width: 72ch;
  color: var(--body);
  font-size: clamp(1.05rem, 1.65vw, 1.32rem);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.button {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #10100e;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.case-section {
  display: grid;
  grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 6rem);
  padding: clamp(3rem, 7vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.section-kicker {
  position: sticky;
  top: 112px;
  align-self: start;
  color: var(--accent);
}

.section-kicker span {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

.case-section-body {
  display: grid;
  gap: clamp(1.35rem, 3vw, 2.4rem);
}

.case-section-body > p {
  max-width: 74ch;
  color: var(--body);
  font-size: clamp(1.04rem, 1.45vw, 1.18rem);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.evidence-panel {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 0.7rem;
  padding: clamp(1rem, 2vw, 1.4rem) 0 0;
  border-top: 1px solid var(--line);
}

.evidence-panel strong {
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.evidence-panel p {
  color: var(--body);
}

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

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

.visual {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: var(--soft);
}

.visual img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.visual figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3rem 1rem 1rem;
  color: var(--ink);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.diagram-visual img {
  object-fit: contain;
  padding: 1rem;
  background: #111;
}

.system-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.system-map div {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 0.7rem;
  padding: 1rem;
  background: #11110f;
}

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

.system-map p {
  color: var(--body);
  font-size: 0.95rem;
}

.archive-lines {
  display: grid;
}

.archive-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(140px, 0.25fr) minmax(0, 1fr) minmax(110px, 0.18fr);
  gap: clamp(1rem, 3vw, 3rem);
  padding: 1.1rem 0;
  align-items: baseline;
}

.archive-line strong {
  color: var(--ink);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
}

.archive-line span,
.archive-line em {
  color: var(--muted);
  font-style: normal;
}

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(300px, 0.35fr);
  gap: clamp(1.5rem, 5vw, 5rem);
}

.resume-stack {
  display: grid;
  gap: 1.6rem;
}

.resume-row {
  grid-template-columns: minmax(120px, 0.2fr) minmax(0, 1fr);
}

.resume-row p,
.resume-side p {
  color: var(--body);
}

.resume-side {
  display: grid;
  gap: 1.4rem;
}

.resume-side section {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(96vw, 1500px);
  max-height: 88vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--accent);
  color: #111;
  cursor: pointer;
}

@keyframes cue-down {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(60px);
  }
}

@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;
  }
}

@media (max-width: 980px) {
  .journey,
  .site-footer,
  .case-shell {
    padding-left: 0;
  }

  .vine-shell {
    display: none;
  }

  .mobile-progress {
    display: block;
  }

  .frame.two-col,
  .case-section,
  .resume-grid {
    grid-template-columns: 1fr;
  }

  .section-kicker {
    position: static;
  }

  .metric-line,
  .system-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-nav {
    position: sticky;
    inset: auto;
    top: 0;
    width: min(var(--max), calc(100% - var(--gutter) * 2));
    margin: 0 auto;
    min-height: 74px;
  }

  .brand-lockup span:last-child {
    display: none;
  }

  .nav-links {
    gap: 0.75rem;
    font-size: 0.68rem;
  }

  .nav-links .optional {
    display: none;
  }

  .nav-links a:not(:first-child):not([aria-current="page"]) {
    display: none;
  }

  .journey,
  .case-shell {
    width: min(var(--max), calc(100% - var(--gutter) * 2));
  }

  .frame {
    min-height: auto;
    padding: clamp(4rem, 14vw, 6rem) 0;
  }

  h1,
  .display,
  .case-title {
    font-size: clamp(2.65rem, 12vw, 4.15rem);
    max-width: 10.5ch;
  }

  h2 {
    font-size: clamp(2.25rem, 10vw, 3.8rem);
  }

  .proof-link,
  .artifact-link,
  .case-row,
  .operating-list li,
  .archive-line,
  .resume-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .metric-line,
  .evidence-grid,
  .visual-grid,
  .visual-grid.two,
  .system-map {
    grid-template-columns: 1fr;
  }

  .scroll-cue {
    display: none;
  }

  .case-shell {
    padding-top: clamp(3rem, 10vw, 5rem);
  }

  .case-hero {
    min-height: auto;
    padding: clamp(2rem, 10vw, 4rem) 0;
  }

  .case-section {
    padding: clamp(3rem, 11vw, 5rem) 0;
  }

  .site-footer {
    display: grid;
    padding-left: 0;
  }
}
