:root {
  /* Brand navy lifted from the logo, drenched across the surface */
  --navy-900: oklch(0.2 0.05 265);
  --navy-800: oklch(0.24 0.06 265);
  --navy-700: oklch(0.31 0.07 265);
  --ink: oklch(0.97 0.008 265);
  --ink-soft: oklch(0.84 0.03 265);
  --ink-faint: oklch(0.7 0.04 265);
  --ring: oklch(0.55 0.06 265);
  /* Coral marks the human: every checkpoint, every call a person makes */
  --human: oklch(0.76 0.15 40);
  --human-deep: oklch(0.68 0.17 38);

  --font-display: "Saira", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(120% 90% at 85% 40%, var(--navy-800) 0%, var(--navy-900) 60%) fixed,
    var(--navy-900);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.page {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
  max-width: 90rem;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.logo {
  display: block;
  width: clamp(9.5rem, 18vw, 13.5rem);
  height: auto;
  /* Logo ships navy on transparent; render it in ink on the navy field */
  filter: brightness(0) invert(1);
}

.masthead-link {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s var(--ease-out);
}
.masthead-link:hover { color: var(--ink); }
.masthead-link span { color: var(--human); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2rem, 5vh, 4rem);
}

.copy { position: relative; z-index: 2; max-width: 42rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.4rem 0.9rem 0.4rem 0.75rem;
  border: 1px solid color-mix(in oklch, var(--ink) 18%, transparent);
  border-radius: 999px;
  margin-bottom: clamp(1.5rem, 3vh, 2.25rem);
}

.status-dot {
  position: relative;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--human);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--human);
  animation: ping 2.4s var(--ease-out) infinite;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 4.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
h1 .line { display: block; }
h1 .human { color: var(--human); }

.lede {
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 clamp(2rem, 4vh, 2.75rem);
  text-wrap: pretty;
}

/* The loop: a real sequence, so it earns its order */
.loop {
  list-style: none;
  margin: 0 0 clamp(2.25rem, 5vh, 3rem);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}
.loop li {
  counter-increment: step;
  position: relative;
  padding-top: 1.1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
.loop li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in oklch, var(--ink) 16%, transparent);
}
.loop li.is-human::before { background: var(--human); }
.loop strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.loop li.is-human strong { color: var(--human); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--navy-900);
  background: var(--human);
  padding: 0.95rem 1.5rem;
  border-radius: 0.6rem;
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.button:hover { background: oklch(0.81 0.13 42); }
.button:active { transform: translateY(1px); }
.button svg { transition: transform 0.25s var(--ease-out); }
.button:hover svg { transform: translateX(3px); }

.cta-note { font-size: 0.9375rem; color: var(--ink-faint); }

/* ---------- The loop visual ---------- */
.visual {
  margin: 0;
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 40rem);
  justify-self: end;
  margin-right: calc(var(--gutter) * -0.5);
}

.rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rings circle { fill: none; stroke-linecap: round; }
.rings .track { stroke: var(--ring); }
.rings--lit .track { stroke: var(--human); }

/* Lit copy only shows just after the checkpoint at 12 o'clock, then fades */
.rings--lit {
  -webkit-mask-image: conic-gradient(from 0deg, #000 0deg, #000 18deg, transparent 95deg, transparent 360deg);
          mask-image: conic-gradient(from 0deg, #000 0deg, #000 18deg, transparent 95deg, transparent 360deg);
}

.spin {
  transform-origin: 0 0;
  animation: spin var(--dur) linear infinite;
}

.gate circle {
  fill: var(--human);
  animation: gate 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.visual-caption {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 34%;
  text-align: center;
  font-size: clamp(0.75rem, 1vw, 0.875rem);
  line-height: 1.4;
  color: var(--ink-faint);
  margin: 0;
}
.visual-caption b {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15em;
  color: var(--ink);
}

/* ---------- Contact dialog ---------- */
button { font: inherit; }
.button { border: 0; cursor: pointer; }

.contact {
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 1px solid color-mix(in oklch, var(--ink) 14%, transparent);
  border-radius: 1rem;
  background: var(--navy-800);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 30px 80px -20px oklch(0.1 0.04 265 / 0.8);
}
.contact[open] { animation: dialog-in 0.45s var(--ease-out); }
.contact::backdrop {
  background: oklch(0.14 0.04 265 / 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.contact-body { padding: clamp(1.5rem, 4vw, 2.5rem); }

.contact h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  padding-right: 2.5rem;
  text-wrap: balance;
}
.contact h2:focus { outline: none; }
.contact-intro { color: var(--ink-soft); margin: 0 0 1.75rem; text-wrap: pretty; }

.contact-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.contact-close:hover { background: color-mix(in oklch, var(--ink) 10%, transparent); color: var(--ink); }

.contact-form { display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field > span { font-size: 0.9375rem; font-weight: 500; color: var(--ink); }
.field em { font-style: normal; font-weight: 400; color: var(--ink-faint); margin-left: 0.35rem; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--navy-900);
  border: 1px solid color-mix(in oklch, var(--ink) 22%, transparent);
  border-radius: 0.55rem;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 7.5rem; line-height: 1.5; }
.field input:hover,
.field textarea:hover { border-color: color-mix(in oklch, var(--ink) 38%, transparent); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--human);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--human) 28%, transparent);
}
.was-validated .field :invalid { border-color: oklch(0.72 0.17 25); }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.9375rem;
  color: oklch(0.9 0.06 25);
  background: oklch(0.45 0.13 25 / 0.35);
}

.contact-submit { justify-self: start; margin-top: 0.4rem; }
.contact-submit:disabled { opacity: 0.7; cursor: progress; }

.done-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  color: var(--navy-900);
  background: var(--human);
  animation: pop 0.5s var(--ease-out);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-faint);
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in oklch, var(--ink) 10%, transparent);
  position: relative;
  z-index: 2;
}
.foot p { margin: 0; }

/* ---------- Load choreography ---------- */
.rise { animation: rise 0.9s var(--ease-out) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.4s; }
.rise-5 { animation-delay: 0.5s; }
.rise-6 { animation-delay: 0.6s; }
.visual { animation: bloom 1.6s var(--ease-out) 0.1s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes bloom {
  from { opacity: 0; transform: scale(0.92) rotate(-12deg); filter: blur(10px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gate {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .visual { animation: fade 0.4s ease both; }
  .spin, .gate circle, .status-dot::after, .done-mark { animation: none; }
  .contact[open] { animation: fade 0.2s ease; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0;
    padding-block: 1.5rem 3rem;
  }
  .visual {
    order: -1;
    width: min(78vw, 24rem);
    justify-self: center;
    margin: 0 0 1.5rem;
  }
  .visual-caption { display: none; }
  .copy { max-width: 40rem; }
}

@media (max-width: 34rem) {
  .masthead-link { display: none; }
  .contact-submit { width: 100%; justify-content: center; }
  .loop { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .loop li { padding-top: 0; padding-left: 1rem; }
  .loop li::before { top: 0.2rem; bottom: 0.2rem; right: auto; width: 2px; height: auto; }
  .button { width: 100%; justify-content: center; }
}
