/* Self-hosted variable fonts (Latin subset). No third-party CDN: faster + EU-privacy clean. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/fraunces-latin-var.woff2") format("woff2");
}

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

:root {
  color-scheme: light;
  --paper: #f5ead8;
  --paper-soft: #fff8ec;
  --paper-deep: #ead9bd;
  --ink: #17130d;
  --ink-soft: #463f35;
  --muted: #716653;
  --line: rgba(67, 54, 36, 0.18);
  --line-strong: rgba(67, 54, 36, 0.3);
  --green: #28543c;
  --green-soft: #e3eadb;
  --brass: #a36d29;
  --copper: #c48645;
  --blue: #486b88;
  --shadow: 0 18px 48px rgba(67, 54, 36, 0.13);
  --glass-fill: linear-gradient(145deg, rgba(255, 253, 247, 0.78), rgba(255, 248, 236, 0.48));
  --glass-fill-strong: linear-gradient(145deg, rgba(255, 253, 247, 0.9), rgba(255, 248, 236, 0.62));
  --glass-border: rgba(255, 255, 255, 0.56);
  --glass-edge: rgba(67, 54, 36, 0.18);
  --glass-shadow:
    0 18px 50px rgba(67, 54, 36, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(67, 54, 36, 0.06);
  --radius: 8px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 251, 242, 0.92), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(232, 214, 181, 0.42), transparent 32%),
    linear-gradient(120deg, #f7eddb, #efe0c5);
  color: var(--ink);
  font-family: var(--sans);
}

body.nav-open {
  overflow: hidden;
}

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

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

button {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: rgba(40, 84, 60, 0.22);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper-soft);
  border-radius: 999px;
  padding: 10px 14px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 241, 224, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  font-family: var(--serif);
  font-size: 16px;
  background: rgba(255, 248, 236, 0.76);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--ink-soft);
  font-size: 13px;
  border: 1px solid transparent;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a.is-active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 248, 236, 0.62);
}

.primary-nav a:focus-visible {
  outline: 3px solid rgba(40, 84, 60, 0.22);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 248, 236, 0.84);
  padding: 11px;
}

.nav-toggle span:not(.visually-hidden) {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
}

.site-header-fallback {
  display: none;
}

.hero {
  position: relative;
  padding: 0 clamp(14px, 3vw, 28px) 18px;
}

.eyebrow,
.section-kicker,
.card-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
.section-heading h2,
.contact h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 9ch;
  margin-top: 12px;
  font-size: clamp(48px, 6vw, 86px);
  line-height: 0.92;
}

.detail-card,
.case-card,
.workbench article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 236, 0.72);
  box-shadow: 0 12px 32px rgba(67, 54, 36, 0.09);
}

.detail-card p,
.case-card p,
.workbench p {
  color: var(--ink-soft);
  line-height: 1.52;
}

.code-card {
  background: #18140f;
  color: var(--paper-soft);
}

.code-card .card-label,
.code-card small {
  color: #d4b47f;
}

pre {
  overflow: auto;
  margin: 12px 0 0;
  color: #f6ead8;
  font-size: 13px;
  line-height: 1.45;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 8px 20px rgba(67, 54, 36, 0.08);
}

.button.primary {
  background:
    linear-gradient(145deg, rgba(47, 95, 69, 0.96), rgba(31, 69, 48, 0.96)),
    var(--green);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--paper-soft);
}

.button.secondary {
  background:
    var(--glass-fill),
    rgba(255, 248, 236, 0.54);
  color: var(--ink);
  border-color: var(--glass-border);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: 3px solid rgba(40, 84, 60, 0.22);
  outline-offset: 2px;
}

.metrics-band {
  width: min(1180px, calc(100% - 36px));
  margin: 38px auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow);
}

.metrics-band div {
  display: grid;
  gap: 7px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(255, 248, 236, 0.9);
}

.metrics-band strong {
  font-family: var(--serif);
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 500;
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.metrics-band span {
  color: var(--muted);
  font-size: clamp(11px, 0.85vw, 13px);
  letter-spacing: 0.01em;
}

/* Below 780px the 5-across row gets cramped: drop to 2 columns. With an odd
   item count (5), the last item would orphan a grey empty cell, so span it
   across both columns. Robust if a 6th metric is ever added (even → no span). */
@media (max-width: 780px) {
  .metrics-band {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-band div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

.proof-strip {
  width: min(1180px, calc(100% - 36px));
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 248, 236, 0.78);
  box-shadow: var(--shadow);
}

.proof-strip div {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 20px;
  border-left: 1px solid var(--line);
}

.proof-strip div:first-child {
  border-left: 0;
}

.proof-strip strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.proof-strip span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 28px auto 0;
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 236, 0.7);
  box-shadow: var(--shadow);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.7fr);
  gap: 28px;
  align-items: end;
  margin-top: 10px;
}

.section-heading h2,
.contact h2 {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 0.98;
}

.section-heading p,
.contact p {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.58;
}

.card-grid,
.case-grid,
.workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.case-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workbench {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-card,
.case-card,
.workbench article {
  min-height: 220px;
  padding: 20px;
}

.detail-card span,
.case-card span {
  color: var(--brass);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-card h3,
.case-card h3,
.workbench h3 {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.08;
}

.detail-card p,
.case-card p,
.workbench p {
  margin-top: 12px;
  font-size: 15px;
}

.atlas-section {
  background:
    linear-gradient(rgba(255, 248, 236, 0.76), rgba(255, 248, 236, 0.76)),
    repeating-linear-gradient(25deg, transparent 0 28px, rgba(40, 84, 60, 0.04) 29px, transparent 31px);
}

.engine-section {
  background:
    linear-gradient(rgba(255, 248, 236, 0.78), rgba(255, 248, 236, 0.78)),
    linear-gradient(rgba(163, 109, 41, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(163, 109, 41, 0.06) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}

.process-track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.process-track li {
  position: relative;
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  background: rgba(255, 248, 236, 0.76);
  border-left: 1px solid var(--line);
}

.process-track li:first-child {
  border-left: 0;
}

.process-track strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.process-track span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.contact {
  width: min(1180px, calc(100% - 36px));
  margin: 28px auto 0;
  padding: clamp(34px, 6vw, 70px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17130d;
  color: var(--paper-soft);
  box-shadow: var(--shadow);
}

.contact .section-kicker {
  color: #d5b57e;
}

.contact p:not(.section-kicker) {
  max-width: 620px;
  margin-top: 14px;
  color: #d8cbb7;
}

.contact .button.secondary {
  background: transparent;
  color: var(--paper-soft);
  border-color: rgba(255, 248, 236, 0.34);
}

.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: 22px auto 0;
  padding: 24px 0 36px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1120px) {
  .proof-strip,
  .card-grid,
  .workbench,
  .process-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-strip div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .proof-strip div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 780px) {
  .site-header-fallback {
    display: flex;
  }

  .site-header {
    min-height: 68px;
  }

  .brand small {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .primary-nav {
    position: fixed;
    inset: 68px 14px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 248, 236, 0.98);
    padding: 10px;
    box-shadow: var(--shadow);
  }

  body.nav-open .primary-nav {
    display: flex;
  }

  .primary-nav a {
    min-height: 46px;
  }

  .hero {
    padding-inline: 0;
  }

  h1 {
    font-size: 50px;
  }

  .section,
  .contact,
  .proof-strip {
    width: min(100% - 20px, 1180px);
  }

  .section {
    padding: 28px 18px;
  }

  .section-heading,
  .proof-strip,
  .card-grid,
  .workbench,
  .process-track,
  .contact,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .proof-strip div,
  .proof-strip div:nth-child(3),
  .proof-strip div:nth-child(4),
  .process-track li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .proof-strip div:first-child,
  .process-track li:first-child {
    border-top: 0;
  }

  .contact-actions {
    justify-content: flex-start;
  }

  .site-footer {
    display: grid;
  }
}

.hero-stage {
  position: relative;
  height: min(100svh, 57.1429vw);
  min-height: 760px;
  padding: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(67, 54, 36, 0.16);
  background: #f5ead8;
  isolation: isolate;
}

.hero-plate {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.96) contrast(0.98);
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(255, 248, 236, 0.08), transparent 22%, rgba(245, 234, 216, 0.22)),
    radial-gradient(circle at 50% 48%, rgba(255, 248, 236, 0.45), transparent 17%);
  pointer-events: none;
}

.hero-stage::after {
  content: "";
  position: absolute;
  inset: 7% 50% 0 auto;
  z-index: -1;
  width: 1px;
  background: linear-gradient(transparent, rgba(67, 54, 36, 0.24), transparent);
  pointer-events: none;
}

.hero-lens {
  position: absolute;
  inset: 6.4% 0 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, background 260ms ease;
}

.hero-stage[data-active-side="atlas"] .hero-lens {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(40, 84, 60, 0.07), rgba(255, 248, 236, 0.08) 42%, rgba(255, 248, 236, 0.72) 100%),
    radial-gradient(circle at 24% 42%, rgba(255, 253, 247, 0.08), transparent 30%);
}

.hero-stage[data-active-side="engine"] .hero-lens {
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(255, 248, 236, 0.72), rgba(255, 248, 236, 0.08) 55%, rgba(163, 109, 41, 0.1)),
    radial-gradient(circle at 78% 43%, rgba(255, 253, 247, 0.1), transparent 30%);
}

.hero-motion-layer {
  position: absolute;
  inset: 6.35% 0 0;
  z-index: 1;
  pointer-events: none;
}

/* Resting-state meridian: a faint center axis marking the bridge between map and
   build. Visible at rest; fades out when a side is chosen so it never competes
   with the spotlight. Sits behind the medallion (it reads as the axis it rests on). */
.hero-motion-layer::before {
  content: "";
  position: absolute;
  top: 3%;
  bottom: 3%;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(67, 54, 36, 0.24) 18%,
    rgba(67, 54, 36, 0.3) 50%,
    rgba(67, 54, 36, 0.24) 82%,
    transparent
  );
  box-shadow: 0 0 20px 6px rgba(255, 251, 244, 0.5);
  filter: blur(0.6px);
  opacity: 0.7;
  transition: opacity 280ms ease;
}

.hero-stage[data-active-side="atlas"] .hero-motion-layer::before,
.hero-stage[data-active-side="engine"] .hero-motion-layer::before {
  opacity: 0;
}

.gear-mark {
  position: absolute;
  width: clamp(38px, 3.4vw, 58px);
  aspect-ratio: 1;
  border: 1px solid rgba(163, 109, 41, 0.54);
  border-radius: 50%;
  opacity: 0;
  box-shadow: inset 0 0 0 10px rgba(255, 248, 236, 0.2);
}

.gear-mark::before,
.gear-mark::after {
  content: "";
  position: absolute;
  inset: 45% 12%;
  height: 1px;
  background: rgba(163, 109, 41, 0.56);
}

.gear-mark::after {
  transform: rotate(90deg);
}

.gear-mark-one {
  right: 32.5%;
  top: 28%;
}

.gear-mark-two {
  right: 21.5%;
  top: 61%;
}

.gear-mark-three {
  right: 12.5%;
  bottom: 12%;
}

.hero-stage.is-ready .gear-mark {
  animation: gear-arrive 650ms ease forwards, gear-turn 18s linear 700ms infinite;
}

.hero-stage.is-ready .gear-mark-two {
  animation-delay: 130ms, 830ms;
}

.hero-stage.is-ready .gear-mark-three {
  animation-delay: 260ms, 960ms;
}

.hero-stage[data-active-side="atlas"] .gear-mark {
  opacity: 0.28;
  filter: saturate(0.5);
}

.hero-stage[data-active-side="engine"] .gear-mark {
  opacity: 1;
  filter: drop-shadow(0 0 13px rgba(163, 109, 41, 0.2));
}


body.motion-enabled .hero-stage:not(.is-ready) .hero-copy-block,
body.motion-enabled .hero-stage:not(.is-ready) .hero-info-card {
  opacity: 0;
  transform: translateY(10px);
}

body.motion-enabled .hero-stage:not(.is-ready) .hero-callout {
  opacity: 0;
  transform: translate(-50%, 10px);
}

.hero-stage.is-ready .hero-copy-block,
.hero-stage.is-ready .hero-info-card,
.hero-stage.is-ready .hero-callout {
  animation: component-reveal 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-stage.is-ready .hero-copy-engine {
  animation-delay: 80ms;
}

.hero-stage.is-ready .hero-card-stack-left .hero-info-card:nth-child(1),
.hero-stage.is-ready .hero-card-stack-right .hero-info-card:nth-child(1) {
  animation-delay: 160ms;
}

.hero-stage.is-ready .hero-card-stack-left .hero-info-card:nth-child(2),
.hero-stage.is-ready .hero-card-stack-right .hero-info-card:nth-child(2) {
  animation-delay: 230ms;
}

.hero-stage.is-ready .hero-card-stack-left .hero-info-card:nth-child(3),
.hero-stage.is-ready .hero-card-stack-right .hero-info-card:nth-child(3) {
  animation-delay: 300ms;
}

.hero-stage.is-ready .hero-card-stack-left .hero-info-card:nth-child(4),
.hero-stage.is-ready .hero-card-stack-right .hero-info-card:nth-child(4) {
  animation-delay: 370ms;
}

.hero-stage.is-ready .hero-medallion {
  animation-delay: 0ms;
}

.hero-stage.is-ready .hero-callout {
  animation-delay: 430ms;
}

.hero-stage.is-ready .hero-callout {
  animation-name: centered-component-reveal;
}

.medallion-content {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-stage.is-changing .medallion-content {
  transform: scale(0.985);
  box-shadow: 0 18px 54px rgba(67, 54, 36, 0.1);
}

.hero-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  height: 64px;
  min-height: 64px;
  padding: 0 clamp(20px, 1.9vw, 30px);
  border-bottom: 1px solid rgba(67, 54, 36, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.72), rgba(255, 248, 236, 0.46)),
    rgba(255, 248, 236, 0.48);
  backdrop-filter: blur(22px) saturate(1.16);
  -webkit-backdrop-filter: blur(22px) saturate(1.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 8px 26px rgba(67, 54, 36, 0.07);
}

.hero-nav button,
.hero-info-card,
.hero-annotations button,
.detail-reset {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.hero-mark {
  position: absolute;
  left: clamp(20px, 1.9vw, 30px);
  top: 50%;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: var(--glass-fill);
  box-shadow:
    0 8px 22px rgba(67, 54, 36, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 0 0 1px rgba(67, 54, 36, 0.08);
  color: var(--green);
  transform: translateY(-50%);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
}

.hero-mark span,
.hero-mark span::before,
.hero-mark span::after {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  width: 20px;
  height: 1px;
  background: rgba(67, 54, 36, 0.76);
  content: "";
  transform: translate(-50%, -50%);
}

.hero-mark span::before {
  width: 1px;
  height: 20px;
}

.hero-mark span::after {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(163, 109, 41, 0.78);
  border-radius: 1px;
  background: transparent;
  transform: translate(-50%, -50%) rotate(45deg);
}

.hero-nav-links,
.hero-nav-actions {
  display: flex;
  align-items: center;
}

.hero-nav-links {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  gap: clamp(22px, 2.35vw, 40px);
  transform: translateX(-50%);
}

.hero-nav-actions {
  position: absolute;
  right: clamp(20px, 1.9vw, 30px);
  top: 50%;
  gap: 10px;
  transform: translateY(-50%);
}

.hero-nav-links a,
.hero-nav-links button {
  position: relative;
  min-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: #1d1a15;
  font-size: clamp(13px, 0.95vw, 16px);
}

.hero-nav-links a::after,
.hero-nav-links button::after {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 13px;
  height: 2px;
  background: var(--brass);
  content: "";
  opacity: 0;
  transform: scaleX(0.72);
  transition: opacity 160ms ease, transform 160ms ease;
}

.hero-nav-links a:hover,
.hero-nav-links a:focus-visible,
.hero-nav-links button:hover,
.hero-nav-links button:focus-visible,
.hero-nav-links button.is-active {
  outline: none;
}

.hero-nav-links a:hover::after,
.hero-nav-links a:focus-visible::after,
.hero-nav-links button:hover::after,
.hero-nav-links button:focus-visible::after,
.hero-nav-links button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.hero-nav .button {
  min-height: 38px;
  padding: 0 clamp(14px, 1.45vw, 24px);
}

.hero-copy-block {
  position: absolute;
  z-index: 2;
  color: var(--ink);
  text-align: center;
}

.hero-copy-atlas {
  top: 11.1%;
  left: 6.8%;
  width: 25%;
}

.hero-copy-engine {
  top: 11.1%;
  right: 6.7%;
  width: 25%;
}

.hero-copy-block .eyebrow {
  color: var(--green);
  font-size: clamp(10px, 0.78vw, 15px);
}

.hero-copy-block h2 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(2rem, 2.8vw, 3.05rem);
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-copy-block p:not(.eyebrow) {
  width: min(100%, 360px);
  margin: 9px auto 0;
  font-family: var(--serif);
  font-size: clamp(14px, 1.15vw, 21px);
  line-height: 1.25;
}

.hero-card-stack {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: clamp(8px, 1.2vh, 14px);
  width: clamp(192px, 13.25vw, 246px);
  transition: opacity 180ms ease, filter 180ms ease;
}

.hero-card-stack-left {
  top: 25.5%;
  left: 3%;
}

.hero-card-stack-right {
  top: 25.5%;
  right: 3.35%;
}

.hero-info-card {
  min-height: clamp(96px, 10.7vh, 140px);
  display: grid;
  gap: 8px;
  align-content: start;
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background:
    var(--glass-fill),
    rgba(255, 248, 236, 0.56);
  box-shadow: var(--glass-shadow);
  padding: clamp(11px, 0.95vw, 17px);
  text-align: left;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.hero-info-card:hover,
.hero-info-card:focus-visible,
.hero-info-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(40, 84, 60, 0.48);
  background:
    var(--glass-fill-strong),
    rgba(255, 251, 244, 0.72);
  box-shadow:
    0 20px 55px rgba(67, 54, 36, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(67, 54, 36, 0.08);
  outline: none;
}

.hero-card-stack-right .hero-info-card:hover,
.hero-card-stack-right .hero-info-card:focus-visible,
.hero-card-stack-right .hero-info-card.is-active {
  border-color: rgba(163, 109, 41, 0.52);
}

.hero-info-card .card-label {
  color: var(--green);
  font-size: clamp(9px, 0.65vw, 11px);
  letter-spacing: 0.12em;
}

.hero-info-card strong {
  color: var(--ink-soft);
  font-size: clamp(12px, 0.88vw, 16px);
  line-height: 1.35;
  font-weight: 500;
}

.hero-info-card small {
  color: var(--muted);
  font-size: clamp(10px, 0.7vw, 12px);
  line-height: 1.3;
}

.hero-info-card.code-card {
  border-color: rgba(255, 248, 236, 0.18);
  background:
    linear-gradient(145deg, rgba(30, 25, 18, 0.92), rgba(12, 10, 8, 0.82)),
    #17130d;
  color: var(--paper-soft);
  box-shadow:
    0 18px 46px rgba(24, 19, 13, 0.28),
    inset 0 1px 0 rgba(255, 248, 236, 0.12);
}

.hero-info-card.code-card .card-label {
  color: #d5b57e;
}

.hero-info-card.code-card pre {
  margin: 2px 0 0;
  color: var(--paper-soft);
  font-size: clamp(10px, 0.72vw, 13px);
}

.hero-info-card.code-card small {
  color: #d5c2a2;
}

.hero-annotations {
  position: absolute;
  z-index: 3;
  transition: opacity 180ms ease, filter 180ms ease;
}

.hero-annotations button {
  position: absolute;
  min-width: 116px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 12px;
  background:
    var(--glass-fill),
    rgba(255, 248, 236, 0.5);
  padding: 7px 9px;
  color: var(--ink-soft);
  font-size: clamp(9px, 0.66vw, 12px);
  line-height: 1.2;
  box-shadow:
    0 10px 24px rgba(67, 54, 36, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.hero-annotations button:hover,
.hero-annotations button:focus-visible,
.hero-annotations button.is-active {
  outline: none;
  border-color: rgba(40, 84, 60, 0.42);
  background:
    var(--glass-fill-strong),
    rgba(255, 251, 244, 0.72);
}

.hero-annotations-atlas {
  inset: 0 auto auto 0;
}

.hero-annotations-atlas button:nth-child(1) {
  left: 21.1vw;
  top: 28.2vh;
}

.hero-annotations-atlas button:nth-child(2) {
  left: 27.2vw;
  top: 40.5vh;
}

.hero-annotations-atlas button:nth-child(3) {
  left: 23.7vw;
  top: 52vh;
}

.hero-annotations-atlas button:nth-child(4) {
  left: 27.5vw;
  top: 63.5vh;
}

.hero-annotations-engine {
  inset: 0 0 auto auto;
}

.hero-annotations-engine button:nth-child(1) {
  right: 25vw;
  top: 20.5vh;
}

.hero-annotations-engine button:nth-child(2) {
  right: 23.4vw;
  top: 39vh;
}

.hero-annotations-engine button:nth-child(3) {
  right: 27.2vw;
  top: 57.2vh;
}

.hero-annotations-engine button:nth-child(4) {
  right: 24.1vw;
  top: 72.2vh;
}

.hero-medallion {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 48.3%;
  width: clamp(270px, 19.2vw, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
}

.hero-copy-block,
.hero-card-stack,
.hero-annotations {
  transition: opacity 260ms ease, filter 260ms ease;
}

.hero-stage[data-active-side="atlas"] .hero-copy-engine,
.hero-stage[data-active-side="atlas"] .hero-card-stack-right,
.hero-stage[data-active-side="atlas"] .hero-annotations-engine,
.hero-stage[data-active-side="engine"] .hero-copy-atlas,
.hero-stage[data-active-side="engine"] .hero-card-stack-left,
.hero-stage[data-active-side="engine"] .hero-annotations-atlas {
  opacity: 0.34;
  filter: saturate(0.58) contrast(0.9);
}

/* Cinematic spotlight: lift the active half a touch (no extra dim on the inactive side) */
.hero-stage[data-active-side="atlas"] .hero-copy-atlas,
.hero-stage[data-active-side="atlas"] .hero-card-stack-left,
.hero-stage[data-active-side="engine"] .hero-copy-engine,
.hero-stage[data-active-side="engine"] .hero-card-stack-right {
  filter: saturate(1.06) brightness(1.015);
}

.medallion-ring,
.medallion-ring::before,
.medallion-ring::after {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.medallion-ring {
  inset: -7.5%;
  border: 1px solid rgba(163, 109, 41, 0.46);
}

.medallion-ring::before {
  content: "";
  inset: 7.5%;
  border: 1px solid rgba(67, 54, 36, 0.2);
}

.medallion-ring::after {
  content: "";
  inset: 17%;
  border: 1px solid rgba(163, 109, 41, 0.18);
}

.medallion-ring span {
  position: absolute;
  color: rgba(67, 54, 36, 0.5);
  font-family: var(--serif);
  font-size: clamp(9px, 0.7vw, 12px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.medallion-ring span:nth-child(1) {
  left: 12%;
  top: 19%;
  transform: rotate(-52deg);
}

.medallion-ring span:nth-child(2) {
  right: 6%;
  top: 21%;
  transform: rotate(40deg);
}

.medallion-ring span:nth-child(3) {
  left: 23%;
  bottom: 7%;
  transform: rotate(47deg);
}

.medallion-content {
  position: relative;
  width: 80%;
  height: 80%;
  overflow: hidden;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(3px, 0.38vh, 4.5px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 253, 247, 0.98), rgba(255, 248, 236, 0.96) 58%, rgba(244, 230, 204, 0.95)),
    var(--paper-soft);
  box-shadow:
    0 18px 54px rgba(67, 54, 36, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(67, 54, 36, 0.08),
    inset 0 0 0 10px rgba(255, 255, 255, 0.12);
  padding: 8.5%;
}

.medallion-content .eyebrow {
  color: var(--green);
  font-size: clamp(9px, 0.72vw, 12px);
}

.hero-stage.is-detail .medallion-content {
  gap: 2px;
  padding: 7.5%;
}

.hero-stage.is-detail .medallion-content .eyebrow {
  font-size: clamp(8px, 0.58vw, 10px);
  line-height: 1.1;
}

.medallion-content h1 {
  max-width: none;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.8vw, 3.05rem);
  line-height: 0.9;
  font-weight: 500;
}

.hero-stage.is-detail .medallion-content h1 {
  max-width: 9ch;
  font-size: clamp(1.2rem, 1.34vw, 1.62rem);
  line-height: 0.94;
}

.medallion-content p:not(.eyebrow) {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(12px, 0.95vw, 17px);
  line-height: 1.28;
}

.hero-stage.is-detail .medallion-content p:not(.eyebrow) {
  max-width: 18ch;
  font-size: clamp(10px, 0.72vw, 12.5px);
  line-height: 1.16;
}

.medallion-content ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: clamp(9px, 0.68vw, 12px);
  line-height: 1.2;
}

.hero-stage.is-detail .medallion-content ul {
  gap: 1px;
  font-size: clamp(8px, 0.58vw, 10px);
}

.detail-reset {
  min-height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.5);
  padding: 0 9px;
  color: var(--muted);
  font-size: 9.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.hero-stage:not(.is-locked) .detail-reset {
  display: none;
}

.hero-callout {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 5%;
  width: min(43vw, 690px);
  min-height: clamp(48px, 5.4vw, 66px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  transform: translateX(-50%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background:
    var(--glass-fill-strong),
    rgba(255, 248, 236, 0.62);
  box-shadow: var(--glass-shadow);
  padding: 8px 14px;
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.hero-callout span {
  color: var(--brass);
  font-size: clamp(20px, 1.8vw, 30px);
}

.hero-callout p {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(12px, 0.95vw, 17px);
  line-height: 1.25;
}

.hero-callout .button {
  white-space: nowrap;
}

@keyframes gear-arrive {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-8deg);
  }

  to {
    opacity: 0.62;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes gear-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes component-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes centered-component-reveal {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 1180px) {
  .hero-stage {
    height: auto;
    min-height: 0;
    padding-bottom: 0;
  }

  .hero-plate {
    position: absolute;
  }

  .hero-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 100svh;
    padding: 72px 14px 18px;
  }

  .site-header-fallback {
    display: flex;
  }

  .hero-nav {
    display: none;
  }

  .hero-stage::before {
    background: rgba(255, 248, 236, 0.54);
  }

  .hero-motion-layer {
    display: none;
  }

  body.motion-enabled .hero-stage:not(.is-ready) .hero-medallion {
    transform: translateY(10px);
  }

  .hero-stage.is-ready .hero-medallion {
    animation: component-reveal 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* On mobile the callout is in normal flow (justify-self: center), not
     absolutely positioned. The desktop "centered-component-reveal" ends on
     translateX(-50%), which here shifts the card (and its button) off the
     left edge. Re-point to the translateY-only reveal like the medallion. */
  .hero-stage.is-ready .hero-callout {
    animation-name: component-reveal;
  }

  .hero-copy-block,
  .hero-card-stack,
  .hero-medallion,
  .hero-callout {
    position: relative;
    inset: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: min(100%, 680px);
    transform: none;
    justify-self: center;
  }

  .hero-copy-block {
    padding: 22px 14px 0;
  }

  .hero-copy-block h2 {
    font-size: 44px;
  }

  .hero-card-stack {
    gap: 10px;
  }

  .hero-medallion {
    order: -1;
    width: min(72vw, 320px);
    margin-top: 8px;
  }

  .hero-card-stack-left {
    order: 1;
  }

  .hero-copy-atlas {
    order: 0;
  }

  .hero-copy-engine {
    order: 2;
  }

  .hero-card-stack-right {
    order: 3;
  }

  .hero-callout {
    order: 4;
    grid-template-columns: auto 1fr;
  }

  .hero-callout .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .hero-annotations {
    display: none;
  }
}

@media (max-width: 780px) {
  .site-header-fallback {
    display: flex;
  }

  .hero-stage {
    padding-top: 70px;
  }

  .hero-plate {
    opacity: 0.62;
    object-position: center top;
  }

  .medallion-content h1 {
    font-size: 36px;
  }

  .hero-stage.is-detail .medallion-content h1 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
