/* ------------------------------------------------------------------
   Optimal — joinoptimal.app
   Brand tokens sampled directly from the provided logo files.
   ------------------------------------------------------------------ */

:root {
  /* Sampled from the gradient orbit mark */
  --optimal-indigo: #0a006a;   /* deep gradient endpoint */
  --optimal-cyan:   #90edfb;   /* bright gradient endpoint */
  --optimal-black:  #000000;   /* mono variant */
  --optimal-white:  #ffffff;   /* mono variant */
  --optimal-blue-mid: #4090e0; /* sampled mid-gradient */

  /* Derived surface tones (indigo family, not new hues) */
  --ground:      #06031c;
  --ground-deep: #030110;
  --ink:         #e9edfb;
  --ink-muted:   #a9b2d6;

  --measure: 40rem;
}

@font-face {
  font-family: "Montserrat XB";
  src: url("/assets/montserrat-xbold-subset.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(180deg, var(--ground-deep) 0%, var(--ground) 30%, var(--ground) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark {
  font-family: "Montserrat XB", -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

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

.hero {
  position: relative;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.25rem 5rem;
  overflow: hidden;
}

/* Signature: a slow orbit ring echoing the mark's shape language */
.orbit-field {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(78vw, 34rem);
  aspect-ratio: 1;
  transform: translate(-50%, -58%);
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    transparent 0deg,
    rgba(144, 237, 251, 0.28) 70deg,
    rgba(64, 144, 224, 0.18) 140deg,
    transparent 220deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  animation: orbit 28s linear infinite;
  pointer-events: none;
}

@keyframes orbit {
  to { transform: translate(-50%, -58%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-field { animation: none; }
}

.hero-mark img {
  width: clamp(7rem, 22vw, 10.5rem);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 42px rgba(64, 144, 224, 0.35));
}

.wordmark {
  margin-top: 1.1rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* optically recenter tracked-out caps */
  color: var(--optimal-cyan);
}

h1 {
  margin-top: 1.4rem;
  max-width: 22ch;
  font-size: clamp(1.85rem, 5.4vw, 3rem);
  color: var(--optimal-white);
}

.hero-sub {
  margin-top: 1.1rem;
  max-width: 44ch;
  color: var(--ink-muted);
  font-size: 1.1rem;
}

/* ---------------- CTA ---------------- */

.cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.95rem 2.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--optimal-cyan) 0%, var(--optimal-blue-mid) 130%);
  color: var(--ground-deep);
  font-family: "Montserrat XB", -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(144, 237, 251, 0.35), 0 8px 28px rgba(64, 144, 224, 0.28);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(144, 237, 251, 0.55), 0 12px 34px rgba(64, 144, 224, 0.4);
}

.cta:focus-visible,
a:focus-visible {
  outline: 3px solid var(--optimal-cyan);
  outline-offset: 3px;
}

/* ---------------- Sections ---------------- */

main { display: block; }

.band {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4.5rem 1.25rem;
  position: relative;
}

/* Orbit-line divider between bands */
.band + .band::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--optimal-blue-mid), var(--optimal-cyan), transparent);
  opacity: 0.45;
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.05rem);
  color: var(--optimal-white);
  margin-bottom: 2.2rem;
}

.block + .block { margin-top: 2.6rem; }

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--optimal-cyan);
  margin-bottom: 0.45rem;
}

h3 {
  font-size: 1.25rem;
  color: var(--optimal-white);
  margin-bottom: 0.6rem;
}

.block p:not(.eyebrow),
.band > p {
  color: var(--ink-muted);
}

.band > p { max-width: 60ch; }

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

footer {
  border-top: 1px solid rgba(64, 144, 224, 0.25);
  background: var(--ground-deep);
  padding: 3rem 1.25rem 3.5rem;
}

.disclaimer {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.disclaimer a {
  color: var(--optimal-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- Sticky mobile CTA (CSS only) ---------------- */

.sticky-cta { display: none; }

@media (max-width: 640px) {
  .sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(3, 1, 16, 0) 0%, rgba(3, 1, 16, 0.92) 35%);
    text-align: center;
    z-index: 10;
  }

  .sticky-cta .cta {
    margin-top: 0;
    display: block;
    width: 100%;
  }

  /* keep the disclaimer readable above the fixed bar */
  footer { padding-bottom: 7.5rem; }
}

/* ==================================================================
   Responsive layer: tablet and desktop.
   Everything below is additive. Base (mobile) rules above are
   untouched; the only base-scope rule added is hiding the desktop
   footer lockup so phones render exactly as before.
   ================================================================== */

.footer-lockup { display: none; }

/* ---------------- Tablet (768px+): wider, calmer, same shape ----- */

@media (min-width: 768px) {
  :root { --measure: 46rem; }

  .hero { padding: 5rem 2.5rem 6rem; }

  h1 { font-size: clamp(2.2rem, 4.6vw, 2.9rem); }

  .hero-sub { font-size: 1.15rem; }

  .band { padding: 5rem 2.5rem; }

  .band + .band::before { left: 2.5rem; right: 2.5rem; }
}

/* ---------------- Desktop (1024px+): the wide layout ------------- */

@media (min-width: 1024px) {

  /* Hero: asymmetric two-column composition inside a bounded
     content width, with a full-bleed indigo-to-cyan gradient field. */
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-rows: auto auto auto auto;
    align-content: center;
    align-items: center;
    column-gap: 4rem;
    text-align: left;
    min-height: 92svh;
    padding: 6rem max(4rem, calc((100vw - 1240px) / 2 + 2rem)) 6rem;
    background:
      radial-gradient(56rem 40rem at 82% 28%, rgba(64, 144, 224, 0.22), transparent 62%),
      radial-gradient(40rem 30rem at 74% 60%, rgba(144, 237, 251, 0.10), transparent 65%),
      linear-gradient(150deg, var(--ground-deep) 0%, var(--optimal-indigo) 58%, #082051 100%);
  }

  .hero-mark {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: center;
  }

  .hero-mark img {
    width: min(32vw, 24rem);
    filter: drop-shadow(0 0 70px rgba(64, 144, 224, 0.5));
  }

  .wordmark {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    margin-top: 0;
    text-indent: 0;
  }

  .hero h1 {
    grid-column: 1;
    grid-row: 2;
    margin-top: 1.2rem;
    max-width: 17ch;
    font-size: clamp(2.6rem, 3.4vw, 3.6rem);
  }

  .hero-sub {
    grid-column: 1;
    grid-row: 3;
    margin-top: 1.2rem;
    max-width: 46ch;
    font-size: 1.2rem;
  }

  .hero > .cta {
    grid-column: 1;
    grid-row: 4;
    justify-self: start;
    align-self: start;
    margin-top: 2.2rem;
    padding: 1.05rem 2.9rem;
    font-size: 1.1rem;
  }

  /* Orbit ring rides behind the right-column mark. Its own keyframes
     keep the desktop translate through the rotation. */
  .orbit-field {
    left: calc(50% + min(24vw, 19.5rem));
    top: 50%;
    right: auto;
    width: min(36vw, 30rem);
    transform: translate(-50%, -50%);
    animation: orbit-desktop 28s linear infinite;
  }

  @keyframes orbit-desktop {
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }

  @media (prefers-reduced-motion: reduce) {
    .orbit-field { animation: none; }
  }

  /* Bands widen into the bounded container. */
  .band {
    max-width: 1240px;
    padding: 6rem 4rem;
  }

  .band + .band::before { left: 4rem; right: 4rem; }

  h2 { font-size: 2.4rem; margin-bottom: 2.8rem; }

  h3 { font-size: 1.35rem; }

  /* "What's inside": three columns, each block keyed by a vertical
     gradient hairline echoing the orbit-line dividers. */
  section[aria-labelledby="inside-heading"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 3.5rem;
  }

  section[aria-labelledby="inside-heading"] h2 { grid-column: 1 / -1; }

  .block + .block { margin-top: 0; }

  .block {
    position: relative;
    padding-left: 1.75rem;
  }

  .block::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 1px;
    background: linear-gradient(180deg, var(--optimal-cyan), rgba(64, 144, 224, 0));
  }

  /* "Built in the open": heading left, statement and CTA right. */
  section[aria-labelledby="open-heading"] {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 4rem;
    align-items: start;
  }

  section[aria-labelledby="open-heading"] h2 {
    grid-column: 1;
    margin-bottom: 0;
  }

  section[aria-labelledby="open-heading"] > p {
    grid-column: 2;
    font-size: 1.1rem;
  }

  section[aria-labelledby="open-heading"] > .cta {
    grid-column: 2;
    justify-self: start;
  }

  /* Footer: the horizontal lockup reads well here. Its background is
     pure black, so the footer surface matches it exactly. */
  footer {
    background: var(--optimal-black);
    padding: 4rem 4rem 4.5rem;
  }

  .footer-lockup {
    display: block;
    max-width: 1240px;
    margin: 0 auto 2.2rem;
  }

  .footer-lockup img {
    width: min(19rem, 26vw);
    height: auto;
    display: block;
  }

  .disclaimer { max-width: 1240px; }
}
