:root {
  /* Colour tokens live in theme.css so both themes can swap them. */

  --font: var(--font-display);

  /* Type scale — minor third from 16px, per the system */
  --text-display:    clamp(3.5rem, 23vw, 20rem);
  --text-heading:    clamp(1.9rem, 4.4vw, 2.5625rem);  /* 41px */
  --text-body:       clamp(1.125rem, 2vw, 1.8125rem);  /* 29px */
  --text-heading-sm: clamp(1.25rem, 1.8vw, 1.5rem);    /* 24px */
  --text-subheading: 1.125rem;                          /* 18px */
  --text-micro:      0.75rem;                           /* 12px */

  /* Spacing scale, verbatim */
  --s-6: 6px;   --s-8: 8px;   --s-10: 10px; --s-12: 12px; --s-14: 14px;
  --s-18: 18px; --s-24: 24px; --s-31: 31px; --s-41: 41px; --s-45: 45px;
  --s-68: 68px; --s-204: 204px;

  --r-card: 12px;
  --r-pill: 36px;
  --r-ghost: 22.5px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(1.25rem, 5vw, 4.25rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--walnut);
  color: var(--cream);
  font-family: var(--font);
  font-feature-settings: "ss01" on;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Type roles ----------
   Everything is uppercase weight 500. .body is the sole exception. */

.micro {
  margin: 0;
  font-size: var(--text-micro);
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--cream);
  opacity: 0.7;
}

.heading {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 500;
  line-height: 0.9;
  text-transform: uppercase;
}

.heading-sm {
  margin: 0;
  font-size: var(--text-heading-sm);
  font-weight: 500;
  line-height: 1.09;
  text-transform: uppercase;
}

/* The system's only conversational voice: mixed case, weight 400. */
.body {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.26;
  text-transform: none;
  color: var(--cream);
  opacity: 0.82;
  max-width: 34ch;
}

.section-heading { margin-block: var(--s-18) var(--s-68); }

/* ---------- Layout ---------- */

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

/* Each major section owns a viewport, per the system. */
.section {
  position: relative;
  padding-block: clamp(4.25rem, 11vh, 8.5rem);
}

.hero,
.product,
.contact { min-height: 100svh; display: flex; align-items: center; }

.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--cork);
}

.shell-rule {
  width: calc(100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--s-14) var(--s-24);
  background: var(--cream);
  color: var(--walnut);
  text-transform: uppercase;
  font-size: var(--text-micro);
}
.skip-link:focus { left: 0; }

/* Content is lifted above the starfield backdrop. Without this, a fixed
   z-index:0 layer paints over the text of unpositioned ancestors. */
main,
.footer { position: relative; z-index: 1; }

/* ---------- Scroll rail ---------- */

.scroll-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--cork);
  z-index: 60;
}

.scroll-rail-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cream);
  transform-origin: left;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 1px 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--walnut) 82%, transparent);
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-24);
  max-width: 1360px;
  margin-inline: auto;
  padding: var(--s-18) var(--gutter);
}

.nav-mark {
  margin-right: auto;
  font-size: var(--s-14);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: var(--s-24);
}

.nav-links a {
  position: relative;
  padding-block: var(--s-6);
  font-size: var(--text-micro);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 200ms var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px dashed var(--cream);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.is-current { opacity: 1; }
.nav-links a.is-current::after { opacity: 1; }

/* ---------- Edge label ---------- */

.edge-label {
  position: fixed;
  top: 50%;
  right: var(--s-12);
  z-index: 40;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
  font-size: var(--s-10);
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.45;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Buttons ----------
   One filled pill per section. Everything else is a ghost outline. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: var(--s-12);
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    color 200ms var(--ease),
    opacity 200ms var(--ease);
}

.btn-pill {
  padding: var(--s-14) var(--s-24);
  border: 1px solid var(--bark);
  border-radius: var(--r-pill);
  background: var(--bark);
  color: var(--cream);
}
.btn-pill:hover { background: var(--cork); border-color: var(--cork); }

.btn-ghost {
  padding: var(--s-10) var(--s-18);
  border: 1px solid var(--cream);
  border-radius: var(--r-ghost);
  background: transparent;
  color: var(--cream);
  opacity: 0.75;
}
.btn-ghost:hover { opacity: 1; }

.model-btn.is-active {
  opacity: 1;
  background: var(--bark);
  border-color: var(--bark);
}

.nav-cta { flex: none; }

.nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-12);
  margin-top: var(--s-24);
}

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

/* The wordmark is the hero lockup and spans the frame; the positioning line
   and the attribution card sit beneath it as a two-column row. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-content: center;
  column-gap: var(--s-45);
  row-gap: var(--s-18);
  padding-block: var(--s-68) var(--s-45);
  width: 100%;
}

.hero-grid > .micro,
.wordmark,
.scroll-cue { grid-column: 1 / -1; }

.hero-line { grid-column: 1; align-self: start; }

.info-card { grid-column: 2; grid-row: span 2; align-self: start; }

.wordmark {
  margin: 0;
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: normal;
}

.hero-line {
  margin: 0;
  max-width: 20ch;
  font-size: var(--text-heading-sm);
  font-weight: 500;
  line-height: 1.09;
  text-transform: uppercase;
}

.info-card {
  margin-top: 0;
  max-width: 46ch;
  padding: var(--s-24);
  border: 1px solid var(--cork);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--bark) 45%, transparent);
}
.info-card .rule { margin-block: var(--s-14); }
.info-card .body { max-width: none; }

.scroll-cue {
  margin-top: var(--s-45);
  opacity: 0.45;
}

/* ---------- Product reveal: three columns, render centred ---------- */

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-45);
  width: 100%;
}

.product-side { display: grid; gap: var(--s-18); }
.product-right { justify-items: end; text-align: right; }
.product-right .body { text-align: right; }

.product-stage { display: grid; gap: var(--s-24); justify-items: center; }

.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--cork);
  border-radius: var(--r-card);
  overflow: hidden;
  /* A soft vitrine for the object. Semi-transparent, so where the browser
     composites the starfield through the WebGL layer the sky still glows at
     the edges, and where it does not the panel still reads as deliberate. */
  background:
    radial-gradient(ellipse at center,
      var(--vitrine-near) 0%,
      var(--vitrine-far) 72%);
  touch-action: pan-y;
  cursor: grab;
}
.canvas-container:active { cursor: grabbing; }
.canvas-container canvas { display: block; }

.canvas-fallback {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: var(--s-24);
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--text-micro);
  text-transform: uppercase;
  opacity: 0.7;
}
.canvas-container.is-fallback .canvas-fallback { display: flex; }

.model-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-8);
}

.model-btn:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-41);
  margin: 0;
}

.stat { display: grid; gap: var(--s-10); }
.stat dt { order: 2; }

.stat-figure {
  order: 1;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 0.9;
}

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

.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px dashed var(--cork);
}

.service {
  display: grid;
  gap: var(--s-14);
  align-content: start;
  padding: var(--s-31) var(--s-24) var(--s-45);
  border-bottom: 1px dashed var(--cork);
  border-right: 1px dashed var(--cork);
}
.service:last-child { border-right: 0; }
.service .body { font-size: var(--text-subheading); line-height: 1.4; }
.service-index { opacity: 0.45; }

/* ---------- Process ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px dashed var(--cork);
}

.step {
  display: grid;
  grid-template-columns: var(--s-68) minmax(0, 1fr);
  gap: var(--s-24);
  padding-block: var(--s-31);
  border-bottom: 1px dashed var(--cork);
}

.step-num { opacity: 0.45; padding-top: var(--s-6); }
.step-body { display: grid; gap: var(--s-12); }
.step-body .body { max-width: 60ch; }

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

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-68);
  align-items: start;
  width: 100%;
}

.contact-copy { display: grid; gap: var(--s-18); align-content: start; }

.contact-form { display: grid; gap: var(--s-31); }

.field { display: grid; gap: var(--s-8); }
.field label { opacity: 0.7; }

/* Underline only — the form mirrors the ghost-button restraint. */
.field input,
.field textarea {
  width: 100%;
  padding: var(--s-8) var(--s-6);
  border: 0;
  border-bottom: 1px solid var(--cream);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--font);
  font-size: var(--text-subheading);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}

.field textarea { resize: vertical; min-height: 3.5rem; }

.field input:hover,
.field textarea:hover { background: color-mix(in srgb, var(--bark) 30%, transparent); }

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-bottom-color: var(--ember); }

.field-error { color: var(--ember); opacity: 1; }

.contact-form .btn-pill { justify-self: start; }

.form-status { min-height: 1.4em; }
.form-status.is-sent { opacity: 1; }

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

.footer {
  border-top: 1px dashed var(--cork);
  padding-block: var(--s-31);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-18) var(--s-45);
  align-items: baseline;
}
.footer-inner .micro:first-child { margin-right: auto; }

/* Ember appears exactly once: the credit line. */
.credit { color: var(--ember); opacity: 1; }

.legal {
  max-width: 1360px;
  margin: var(--s-24) auto 0;
  padding-inline: var(--gutter);
  font-family: Arial, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.7;
}

/* ---------- Focus ---------- */

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

/* ---------- Scroll reveal ---------- */

/* Visible by default, for the same reason as [data-pop] above. */
.js-arming [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 900ms var(--ease),
    transform 900ms var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}

.js-arming [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-31);
  }
  .product-right { justify-items: start; text-align: left; }
  .product-right .body { text-align: left; }
  .product-stage { order: -1; }
  .canvas-container { aspect-ratio: 4 / 3; }

  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-45); }
}

@media (max-width: 860px) {
  .edge-label { display: none; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-line,
  .info-card { grid-column: 1; grid-row: auto; }
  .info-card { margin-top: var(--s-24); }

  .nav-inner { flex-wrap: wrap; row-gap: var(--s-12); }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: var(--s-10);
    border-top: 1px dashed var(--cork);
    padding-top: var(--s-10);
  }

  .service { border-right: 0; }

  .step { grid-template-columns: var(--s-41) minmax(0, 1fr); gap: var(--s-14); }
}

/* ---------- Reduced motion ---------- */

/* Reduced motion: reveals still fade in, they just do not travel. */
html[data-motion="reduced"] { scroll-behavior: auto; }

[data-motion="reduced"] .js-arming [data-reveal] {
  transform: none;
  transition: opacity 600ms var(--ease);
}

[data-motion="reduced"] .btn:hover,
[data-motion="reduced"] .card:hover { transform: none; }

/* =========================================================================
   Subpages: contact and pricing
   ========================================================================= */

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

/* Subpages open below the fixed nav rather than filling a viewport. */
.subpage .section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.subpage-head { padding-top: clamp(7rem, 14vh, 10rem) !important; }

.page-title {
  margin: var(--s-18) 0 var(--s-24);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.cta-block { display: grid; justify-items: start; gap: var(--s-18); }

.cta-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

/* ---------- Pricing ---------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-18);
  align-items: start;
}

.plan {
  position: relative;
  display: grid;
  gap: var(--s-24);
  align-content: start;
  height: 100%;
  padding: var(--s-31) var(--s-24) var(--s-24);
  border: 1px solid var(--cork);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--bark) 26%, transparent);
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}
.plan:hover { border-color: var(--driftwood); transform: translateY(-3px); }

/* One package carries the emphasis; the others stay quiet. */
.plan.is-featured {
  border-color: var(--driftwood);
  background: color-mix(in srgb, var(--bark) 52%, transparent);
}

.plan-flag {
  position: absolute;
  top: calc(var(--s-12) * -1);
  left: var(--s-24);
  padding: 4px var(--s-10);
  border-radius: 9999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  opacity: 1;
}

.plan-head { display: grid; gap: var(--s-8); }

.plan-name {
  margin: 0;
  font-size: var(--text-heading-sm);
  font-weight: 500;
  line-height: 1.09;
  text-transform: uppercase;
}

.plan-price {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.plan-currency { font-size: 0.5em; vertical-align: 0.55em; opacity: 0.7; }

.plan-for { opacity: 0.6; }

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-10);
  border-top: 1px dashed var(--cork);
  padding-top: var(--s-18);
}

.plan-list li {
  position: relative;
  padding-left: var(--s-18);
  font-size: var(--text-subheading);
  font-weight: 400;
  line-height: 1.4;
  color: var(--cream);
  opacity: 0.82;
}
.plan-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--ember);
}

.plan-cta { justify-self: start; align-self: end; }

/* ---------- Comparison table ---------- */

.table-scroll { overflow-x: auto; }

.plan-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
}

.plan-table th,
.plan-table td {
  padding: var(--s-18) var(--s-14);
  border-bottom: 1px dashed var(--cork);
  vertical-align: top;
}

.plan-table thead th {
  font-size: var(--text-micro);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.6;
}

.plan-table tbody th {
  font-size: var(--text-heading-sm);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-table td {
  font-size: var(--text-subheading);
  font-weight: 400;
  line-height: 1.4;
  color: var(--cream);
  opacity: 0.82;
}

.table-price { white-space: nowrap; font-weight: 500; opacity: 1 !important; }

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

.contact-aside { display: grid; gap: var(--s-18); align-content: start; }

.next-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-14);
}

.next-steps li {
  display: grid;
  grid-template-columns: var(--s-31) minmax(0, 1fr);
  gap: var(--s-12);
  font-size: var(--text-subheading);
  font-weight: 400;
  line-height: 1.4;
  color: var(--cream);
  opacity: 0.82;
  padding-block: var(--s-12);
  border-top: 1px dashed var(--cork);
}

.next-steps .step-num { opacity: 0.5; padding-top: 0.2em; }

/* The select keeps the same restraint as the inputs: a line, not a box. */
.field select {
  width: 100%;
  padding: var(--s-8) var(--s-6);
  border: 0;
  border-bottom: 1px solid var(--cream);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--font);
  font-size: var(--text-subheading);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.field select:hover { background: color-mix(in srgb, var(--bark) 30%, transparent); }
/* The native dropdown list is painted by the OS, so set it explicitly. */
.field select option { background: var(--walnut); color: var(--cream); }

@media (max-width: 860px) {
  .plan-cta { justify-self: stretch; }
  .next-steps li { grid-template-columns: var(--s-24) minmax(0, 1fr); }
}
