@font-face {
  font-family: "Raleway Local";
  src: url("/tex/fonts/raleway/Raleway-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Raleway Local";
  src: url("/tex/fonts/raleway/Raleway-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Lato Local";
  src: url("/tex/fonts/lato/Lato-Reg.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lato Local";
  src: url("/tex/fonts/lato/Lato-Bol.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --midnight: #000;
  --navy: #090909;
  --slate: #11151a;
  --mist: #f2f6fa;
  --steel: #9fb0c1;
  --brass: #d5a54a;
  --rule: #242a33;
  --page: min(72rem, calc(100% - 2rem));
  --reading: 45rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(140, 200, 255, .08) 50%, transparent calc(50% + .5px)),
    var(--midnight);
  color: var(--mist);
  font-family: "Lato Local", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: var(--mist); text-underline-offset: .23em; text-decoration-color: var(--brass); }
a:hover { color: var(--brass); }
button, a { touch-action: manipulation; }

h1, h2, h3 {
  margin: 0;
  font-family: "Raleway Local", system-ui, sans-serif;
  line-height: 1.12;
  text-wrap: balance;
}

h1 { font-size: clamp(2.55rem, 5vw, 3.85rem); letter-spacing: -.045em; max-width: 17ch; }
h2 { font-size: clamp(1.8rem, 3.5vw, 3.1rem); letter-spacing: -.025em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
p { margin: 0; }

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

.shell { width: var(--page); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: 1rem; padding: .65rem 1rem; background: var(--brass); color: var(--midnight); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(39, 64, 90, .9);
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(14px);
}

.header-inner { width: var(--page); min-height: 4.4rem; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { font: 700 1.05rem/1 "Raleway Local", sans-serif; text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: clamp(.85rem, 2.5vw, 2rem); font-size: .93rem; }
.site-header nav a { color: var(--steel); text-decoration: none; }
.site-header nav a:hover { color: var(--mist); }

.hero { min-height: calc(100svh - 4.4rem); display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(17rem, .65fr); gap: clamp(2rem, 8vw, 7rem); align-items: center; padding-block: clamp(3.5rem, 6vw, 5rem); position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 5% 0 8%; background: radial-gradient(circle at 24% 38%, rgba(80, 160, 230, .2), transparent 34%), radial-gradient(circle at 62% 58%, rgba(213, 165, 74, .12), transparent 30%); filter: blur(18px); animation: ambient-drift 14s ease-in-out infinite alternate; pointer-events: none; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 8% 0; background-image: linear-gradient(rgba(140, 200, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 200, 255, .035) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 76%, transparent); pointer-events: none; }
.hero h1 { color: transparent; background: linear-gradient(105deg, #f7f9fc 8%, #8cc8ff 58%, #d5a54a 105%); background-clip: text; -webkit-background-clip: text; }
.context-line { color: var(--brass); font-weight: 700; margin-bottom: 1.6rem; }
.hero-summary { max-width: 41rem; margin-top: 2rem; color: var(--steel); font-size: clamp(1.12rem, 2.2vw, 1.38rem); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.25rem; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.85rem; padding: .65rem 1rem; border: 1px solid var(--rule); border-radius: .2rem; background: transparent; color: var(--mist); font: 700 .92rem/1 "Lato Local", sans-serif; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { border-color: var(--brass); color: var(--brass); }
.button-primary { border-color: var(--brass); background: var(--brass); color: var(--midnight); }
.button-primary:hover { background: #e3b762; color: var(--midnight); }

.system-index { align-self: stretch; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--rule); padding-left: clamp(1.2rem, 3vw, 2.4rem); }
.portrait-wrap { display: flex; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.portrait-wrap img { width: 7rem; aspect-ratio: 1; border-radius: 50%; object-fit: cover; filter: saturate(.75) contrast(1.05); border: 1px solid var(--rule); }
.portrait-wrap p { color: var(--steel); font-size: .9rem; }
.system-index ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.system-index li { padding: .82rem 0; border-bottom: 1px solid var(--rule); }
.system-index li span { display: block; color: var(--steel); font-size: .78rem; }

.section { padding-block: clamp(4.5rem, 9vw, 8rem); border-top: 1px solid var(--rule); }
.section-heading { display: grid; grid-template-columns: minmax(12rem, .75fr) minmax(0, 1.75fr); gap: 2rem; align-items: end; margin-bottom: clamp(2rem, 5vw, 4rem); }
.section-heading p { color: var(--steel); max-width: 40rem; }
.project-ledger { border-top: 1px solid var(--rule); }
.project-record { display: grid; grid-template-columns: minmax(13rem, .8fr) minmax(18rem, 1.5fr) auto; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: 2.1rem; border-bottom: 1px solid var(--rule); transition: background-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.project-record:hover { background: linear-gradient(90deg, rgba(140, 200, 255, .055), rgba(213, 165, 74, .025)); box-shadow: 0 1rem 3rem rgba(80, 160, 230, .07); transform: translateY(-2px); }
.project-record > p { color: var(--steel); max-width: 48rem; }
.project-name p { margin-top: .5rem; color: var(--brass); font-size: .85rem; }
.record-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; font-size: .9rem; white-space: nowrap; }

.timeline { border-top: 1px solid var(--rule); }
.timeline article { display: grid; grid-template-columns: minmax(12rem, .75fr) minmax(18rem, 1.5fr) 9rem; gap: clamp(1.5rem, 4vw, 4rem); padding-block: 2rem; border-bottom: 1px solid var(--rule); }
.timeline article > p { color: var(--steel); }
.timeline time { color: var(--brass); font-size: .9rem; text-align: right; }
.company { margin-top: .35rem; color: var(--steel); }
.split-section { display: grid; grid-template-columns: minmax(12rem, .75fr) minmax(0, 1.75fr); gap: 2rem; }
.split-section .section-heading { display: block; margin: 0; }
.prose { max-width: var(--reading); color: var(--steel); }
.prose > * + * { margin-top: 1.25rem; }

.contact-section { border-block: 1px solid var(--rule); background: var(--navy); }
.contact-inner { display: flex; justify-content: space-between; align-items: end; gap: 3rem; padding-block: clamp(3.5rem, 8vw, 6rem); }
.contact-inner p { margin-top: .7rem; color: var(--steel); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.1rem; }
.site-footer { min-height: 6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--steel); font-size: .9rem; }

.case-hero { padding-block: clamp(4rem, 9vw, 7rem); border-bottom: 1px solid var(--rule); }
.case-hero .back-link { display: inline-block; margin-bottom: 2rem; color: var(--steel); }
.case-hero h1 { max-width: 16ch; }
.case-hero .lead { max-width: 46rem; margin-top: 1.6rem; color: var(--steel); font-size: clamp(1.1rem, 2vw, 1.3rem); }
.case-meta { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; margin-top: 2rem; color: var(--brass); font-size: .9rem; }
.case-body { width: min(64rem, calc(100% - 2rem)); margin-inline: auto; }
.case-section { display: grid; grid-template-columns: minmax(11rem, .55fr) minmax(0, 1.45fr); gap: clamp(2rem, 7vw, 6rem); padding-block: clamp(3.5rem, 8vw, 6.5rem); border-bottom: 1px solid var(--rule); }
.case-section h2 { font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
.case-content { max-width: var(--reading); color: var(--steel); }
.case-content > * + * { margin-top: 1.25rem; }
.case-content h3 { color: var(--mist); margin-top: 2rem; }
.case-content ul { padding-left: 1.2rem; }
.case-content li + li { margin-top: .7rem; }
.decision-list { list-style: none; padding: 0 !important; counter-reset: decision; }
.decision-list li { counter-increment: decision; padding: 1.15rem 0 1.15rem 3rem; border-top: 1px solid var(--rule); position: relative; }
.decision-list li::before { content: counter(decision); position: absolute; left: 0; top: 1.05rem; color: var(--brass); font: 700 1rem "Raleway Local", sans-serif; }
.decision-list strong { color: var(--mist); }

.system-map { display: grid; gap: .75rem; margin-block: 1.75rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--rule); background: var(--navy); color: var(--mist); }
.map-row { display: grid; grid-template-columns: repeat(var(--map-columns, 3), minmax(0, 1fr)); gap: .75rem; align-items: stretch; }
.map-node { min-height: 5.2rem; display: flex; flex-direction: column; justify-content: center; padding: .85rem; border: 1px solid var(--rule); background: var(--slate); }
.map-node strong { color: var(--mist); }
.map-node span { color: var(--steel); font-size: .83rem; }
.map-arrow { display: flex; align-items: center; justify-content: center; min-width: 2rem; overflow: hidden; color: var(--brass); font-size: 1.5rem; }
.map-arrow::after { content: "→"; animation: flow-arrow 1.5s ease-in-out infinite; }
.map-note { padding: .8rem; border-left: 3px solid var(--brass); color: var(--steel); font-size: .9rem; }
.case-content-wide { max-width: none; }
.workflow-graph { display: grid; justify-items: center; gap: .8rem; margin-block: 1.75rem; color: var(--mist); }
.workflow-terminal { min-width: 5.5rem; padding: .45rem .85rem; border: 1px solid var(--brass); border-radius: 999px; background: rgba(213, 165, 74, .08); color: var(--brass); font: 700 .75rem/1 "Raleway Local", sans-serif; text-align: center; letter-spacing: .1em; }
.workflow-stage { width: 100%; padding: 1rem; border: 1px solid var(--rule); background: var(--navy); }
.workflow-stage-label { margin-bottom: .8rem; color: var(--brass); font: 700 .72rem/1 "Raleway Local", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.workflow-track { display: grid; gap: .65rem; align-items: stretch; }
.workflow-track-two { grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr); }
.workflow-track-three { grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1fr) 4rem minmax(0, 1fr); }
.workflow-node { min-width: 0; padding: .85rem; border: 1px solid var(--rule); background: var(--slate); }
.workflow-node > span { display: block; margin-bottom: .35rem; color: var(--brass); font: 700 .68rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.workflow-node strong { display: block; color: var(--mist); font: 700 .98rem/1.2 "Raleway Local", sans-serif; }
.workflow-node p { margin-top: .45rem; color: var(--steel); font-size: .78rem; line-height: 1.45; }
.workflow-decision { border-color: var(--brass); background: rgba(213, 165, 74, .06); }
.workflow-edge { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; color: var(--brass); text-align: center; }
.workflow-edge::after { content: "→"; font-size: 1.35rem; animation: flow-arrow 1.5s ease-in-out infinite; }
.workflow-edge span { color: var(--steel); font-size: .64rem; line-height: 1.2; }
.workflow-branches { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0; padding: .75rem 0 0 !important; border-top: 1px solid var(--rule); list-style: none; }
.workflow-branches li { display: inline-flex; align-items: center; gap: .45rem; margin: 0 !important; padding: .42rem .6rem; border: 1px dashed var(--rule); color: var(--steel); font-size: .72rem; line-height: 1.35; }
.workflow-branches li::after { content: "→"; color: var(--brass); order: 1; }
.workflow-branches li span { order: 0; }
.workflow-branches li strong { order: 2; color: var(--mist); }
.workflow-stage-connector { width: 1.5rem; min-height: 1.6rem; display: grid; place-items: center; color: var(--brass); }
.workflow-stage-connector::after { content: "↓"; animation: flow-down 1.5s ease-in-out infinite; }
.workflow-stage-connector-labeled { width: auto; grid-template-rows: auto auto; margin: .25rem auto; }
.workflow-stage-connector-labeled span { color: var(--steel); font-size: .68rem; }
.workflow-graph > .map-note { width: 100%; margin-top: .25rem; }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.case-content.outcomes > * + * { margin-top: 0; }
.outcomes article { height: 100%; padding: 1.25rem; border: 1px solid var(--rule); background: var(--navy); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.outcomes article:hover { transform: translateY(-.35rem); border-color: var(--brass); box-shadow: 0 .9rem 2rem rgba(80, 160, 230, .08); }
.case-content.outcomes h3 { margin-top: 0; }
.outcomes p { margin-top: .6rem; color: var(--steel); }

.privacy-page .case-content { max-width: 50rem; }
.privacy-page h2 { margin-top: 2.6rem; color: var(--mist); }
.privacy-page h3 { margin-top: 2rem; color: var(--mist); }
.privacy-page ul { padding-left: 1.2rem; }
.privacy-page .button { margin-top: 1.5rem; }

.consent-banner { position: fixed; z-index: 50; inset: auto 1rem 1rem auto; width: min(34rem, calc(100% - 2rem)); padding: 1.15rem; border: 1px solid var(--brass); background: var(--navy); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .4); }
.consent-banner h2 { font-size: 1.15rem; }
.consent-banner p { margin-top: .45rem; color: var(--steel); font-size: .9rem; }
.consent-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes ambient-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(.98); opacity: .75; }
  to { transform: translate3d(3%, 2%, 0) scale(1.04); opacity: 1; }
}

@keyframes flow-arrow {
  0%, 100% { opacity: .3; transform: translateX(-.35rem); }
  50% { opacity: 1; transform: translateX(.35rem); }
}

@keyframes flow-down {
  0%, 100% { opacity: .3; transform: translateY(-.25rem); }
  50% { opacity: 1; transform: translateY(.25rem); }
}

@media (max-width: 760px) {
  body { background: var(--midnight); }
  .nav-secondary { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-block: 4rem; }
  .system-index { border-left: 0; border-top: 1px solid var(--rule); padding: 2rem 0 0; }
  .section-heading, .split-section, .case-section { grid-template-columns: 1fr; }
  .project-record, .timeline article { grid-template-columns: 1fr; gap: 1rem; }
  .record-actions { flex-direction: row; gap: 1rem; }
  .timeline time { text-align: left; order: -1; }
  .contact-inner { align-items: flex-start; flex-direction: column; }
  .contact-links { justify-content: flex-start; }
  .map-row { grid-template-columns: 1fr; }
  .map-arrow { transform: rotate(90deg); min-height: 2rem; }
  .workflow-track-two, .workflow-track-three { grid-template-columns: 1fr; }
  .workflow-edge { min-height: 2.6rem; }
  .workflow-edge::after { content: "↓"; animation-name: flow-down; }
  .workflow-branches { display: grid; }
  .outcomes { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  :root { --page: calc(100% - 1.25rem); }
  body { font-size: 1rem; }
  .header-inner { min-height: 4rem; }
  .wordmark { font-size: .95rem; }
  .site-header nav { gap: .75rem; font-size: .85rem; }
  .actions, .actions .button { width: 100%; }
  .portrait-wrap img { width: 5.5rem; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .consent-banner, .actions, .contact-section, .site-footer { display: none !important; }
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  a { color: #111; text-decoration: none; }
  .hero { min-height: auto; display: block; }
  .section, .case-section { break-inside: avoid; }
  .system-index, .project-record, .timeline article, .case-section { border-color: #bbb; }
  .hero-summary, .section-heading p, .project-record > p, .timeline article > p, .prose, .case-content { color: #333; }
}
