/* ─────────────────────────────────────────────────────────────
   STROYOS landing — styles
   Brand tokens mirror app.stroyos.com (design-brief.md).
   Mobile-first: base styles target small screens; min-width
   media queries scale up.
   ───────────────────────────────────────────────────────────── */

:root {
  /* Backgrounds — inverted: black canvas, cards a shade lighter for tonal
     separation. --bg-ink is the one deliberate light band (the demo CTA),
     mirroring the original design's black CTA band against a light page. */
  --bg-content: #000000;
  --bg-surface: #1c1c1e;
  --bg-tint: #242426;
  --bg-ink: #ffffff;

  /* Text */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --text-on-ink: #000000;
  --text-on-ink-muted: rgba(0, 0, 0, 0.6);

  /* Borders */
  --border-default: #313135;
  --border-subtle: #232325;

  /* Accent / action */
  --ink: #ffffff;
  --ink-hover: #d4d4d4;
  --error: #ef4444;
  --success: #16a34a;

  /* Radii */
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Layout */
  --container: 1080px;
  --pad-x: 20px;

  /* Motion */
  --t-fast: 150ms ease;
}

/* ─── Reset / base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky nav is 60px — offset in-page anchor jumps so a target section's
     heading lands below the bar instead of tucking under it. */
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-content);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Safety net: nothing may cause a horizontal scroll. `clip` (not `hidden`)
     keeps the sticky nav working since it doesn't create a scroll container. */
  overflow-x: clip;
}

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

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

ol {
  padding: 0;
  list-style: none;
}

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

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

/* ─── Layout primitives ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section {
  padding-block: 64px;
  border-top: 1px solid var(--border-subtle);
}

.section--tint {
  background: var(--bg-surface);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.eyebrow--flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1;
  letter-spacing: 0.45px;
}

.flag-bg {
  width: 22.5px;
  height: auto;
  flex-shrink: 0;
  border-radius: 2px;
  border: 1px solid var(--border-default);
}

/* ─── Wordmark ──────────────────────────────────────────────── */
.wordmark {
  font-family: "Playfair Display", Bodoni, Didot, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1;
  user-select: none;
}

.wordmark--sm {
  font-size: 22px;
  transition: opacity var(--t-fast);
}
.wordmark--sm:hover {
  opacity: 0.7;
}

.wordmark--hero {
  /* Min sized so the 7-char wordmark fits a 320px phone without overflow. */
  font-size: clamp(40px, 12vw, 148px);
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: 100%;
}

/* Brand line at the top of the solution section: wordmark + callout,
   paired on one row at matching visual weight — signals the pivot from
   "the problem, generally" to "here's our product". Wraps to two lines
   gracefully on narrow screens rather than forcing an overflow. */
.brand-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.wordmark--section {
  font-size: clamp(22px, 3.4vw, 26px);
}

/* The callout, matched to the wordmark's own size and weight so neither
   dominates, with a slow gloss/shimmer sweep across the letters — the one
   deliberate "AI" flourish on the page. Falls back to plain
   secondary-colored text if background-clip: text isn't supported; the
   global prefers-reduced-motion rule already kills the animation. */
.ai-badge {
  font-family: "Playfair Display", serif;
  font-size: clamp(22px, 3.4vw, 26px);
  font-weight: 700;
  color: var(--text-secondary);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .ai-badge {
    background-image: linear-gradient(
      100deg,
      var(--text-secondary) 0%,
      var(--text-secondary) 42%,
      #ffffff 50%,
      var(--text-secondary) 58%,
      var(--text-secondary) 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ai-shimmer 8s linear infinite;
  }
}
@keyframes ai-shimmer {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding-inline: 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
    transform var(--t-fast), opacity var(--t-fast);
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn--sm {
  height: 38px;
  padding-inline: 16px;
  font-size: 14px;
}

.btn--primary {
  background: var(--ink);
  color: var(--text-on-ink);
}
.btn--primary:hover {
  background: var(--ink-hover);
}

.btn--outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn--outline:hover {
  background: #141416;
}

.link-muted {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--t-fast);
}
.link-muted:hover {
  color: var(--text-primary);
}

/* ─── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-default);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding-block: 72px 76px;
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero .eyebrow {
  margin-bottom: 20px;
}
.hero__sub {
  /* The h1 — sized and colored as supporting text on purpose, kept
     font-weight: 400 so the browser's default bold h1 doesn't apply. */
  font-size: clamp(16px, 2.6vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 56ch;
  margin-bottom: 34px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ─── Band (problem) ────────────────────────────────────────── */
.band {
  max-width: 780px;
}
.band__title {
  font-size: clamp(22px, 4.4vw, 32px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  max-width: 24ch;
}
.band__body {
  font-size: clamp(15px, 2.4vw, 17px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* ─── Section headings ──────────────────────────────────────── */
.section__title {
  font-size: clamp(22px, 4.4vw, 32px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  max-width: 22ch;
}
.section__sub {
  font-size: clamp(15px, 2.4vw, 17px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 60ch;
}
/* A subtitle directly under a title takes over the title's bottom spacing,
   so the pair reads as one block instead of double-gapping. */
.section__title + .section__sub {
  margin-top: -24px;
  margin-bottom: 40px;
}

/* ─── Proof / market stats ──────────────────────────────────── */
.proof-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 48px;
}
.proof-stat__n {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(36px, 7vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.proof-stat__l {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 30ch;
}
.proof-note {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─── Bullets (why-hard reasons list) ────────────────────────── */
.bullets {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 800px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bullets li {
  display: flex;
  gap: 16px;
  font-size: clamp(15px, 2.2vw, 17px);
  line-height: 1.6;
  color: var(--text-secondary);
}
/* A short editorial rule, not a numeral — these four are parallel
   alternatives, not an ordered process, so they carry no sequence. The
   padded 01–04 numbering is reserved for the flow-steps (a real sequence)
   and the autonomy ladder (real levels). Aligned to the first text line. */
.bullets .mark {
  flex: 0 0 auto;
  width: 22px;
  height: 1px;
  margin-top: 15px;
  background: var(--text-tertiary);
}
.bullets b {
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Flow grid (the solution, as icon-led cards) ────────────── */
/* The one section that has to out-weigh the rest of the page — it's the
   product. Cards use --bg-tint, one step lighter than the section's own
   --bg-surface, so they read as raised surfaces instead of sinking into
   the background (the previous --bg-content card was darker than its
   surroundings and all but vanished). */
.flow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.flow-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg-tint);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.flow-card:hover {
  transform: translateY(-3px);
  border-color: #4a4a4f;
}
.flow-card__num {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 34px;
  color: var(--text-tertiary);
}
.flow-card__title {
  font-size: clamp(18px, 2.4vw, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.flow-card__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ─── Autonomy ladder ─────────────────────────────────────────── */
.autonomy-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-default);
}
.autonomy-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-block: 24px;
  border-bottom: 1px solid var(--border-default);
}
/* No trailing hairline into the section's empty padding. */
.autonomy-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.autonomy-item__level {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 16px;
}
.autonomy-item__body {
  flex: 1;
  min-width: 0;
}
.autonomy-item__name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.autonomy-item__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ─── CTA (demo) ────────────────────────────────────────────── */
.cta {
  background: var(--bg-ink);
  color: var(--text-on-ink);
  padding-block: 76px;
}
.cta__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta__title {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.cta__sub {
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55;
  color: var(--text-on-ink-muted);
  max-width: 46ch;
  margin-bottom: 32px;
}

/* The CTA band is the one deliberately light section (--bg-ink is white
   here) — buttons in it need a dark focus ring, not the page-wide white
   one, or it disappears against the white band. */
.cta .btn:focus-visible {
  outline-color: #000000;
}

/* ─── Demo form ─────────────────────────────────────────────── */
.demo-form {
  width: 100%;
  max-width: 480px;
}
/* A single bordered capsule holding both the input and the button — flush
   together, no visible seam — rather than a dark input dropped onto the
   light CTA band (which read as a stray black box). Stacks and re-joins at
   the 560px breakpoint below. */
.demo-form__row {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.demo-form__row:focus-within {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
.input {
  height: 52px;
  width: 100%;
  padding-inline: 18px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: inherit;
  font-size: 16px; /* 16px avoids iOS zoom-on-focus */
  color: #1d1d1f;
}
.input::placeholder {
  color: #9a9a9a;
}
.input:focus {
  outline: none;
}
.input[aria-invalid="true"] {
  background: #fef2f2;
}
.demo-form .btn {
  width: 100%;
  height: 52px;
  border-radius: 0;
}
.demo-form__msg {
  min-height: 20px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--text-on-ink-muted);
}
.demo-form__msg--ok {
  color: #15803d;
}
.demo-form__msg--err {
  color: #b91c1c;
}
.cta__note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-on-ink-muted);
}

/* ─── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--bg-content);
  border-top: 1px solid var(--border-default);
  padding-block: 28px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.footer__copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────
   Motion — scroll reveals, entrance & ambience
   Progressive enhancement: hidden initial states apply ONLY when JS
   is present (.js on <html>) AND the user hasn't asked for reduced
   motion. Without JS, or under prefers-reduced-motion, every element
   renders in its final, visible state. The global reduced-motion rule
   near the top also strips transitions/animations as a hard backstop.
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  /* Elements the observer will reveal — start slightly lowered & clear,
     ease up into place. The soft, decelerating cubic-bezier is what reads
     as "considered" rather than "sliding UI". */
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* The hero wordmark gets a touch more travel + a hair of scale, so the
     brand name settles in as the anchor of the entrance. */
  .js .reveal--hero {
    transform: translateY(26px) scale(0.985);
  }

  /* Ambient glow behind the hero wordmark — a single, very faint white
     radial that slowly breathes. The one bit of "AI light" on an
     otherwise strict monochrome page; kept low enough to feel like
     atmosphere, not decoration. */
  .hero {
    position: relative;
    isolation: isolate;
  }
  .hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 42%;
    left: 50%;
    width: min(760px, 108vw);
    aspect-ratio: 1.6 / 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(255, 255, 255, 0.035) 34%,
      transparent 68%
    );
    filter: blur(8px);
    pointer-events: none;
    animation: hero-breathe 9s ease-in-out infinite;
  }
}

@keyframes hero-breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

/* Nav gains a faint lift once the page is scrolled past the hero fold —
   grounds the sticky bar against content moving underneath it. */
.nav {
  transition: border-color var(--t-fast), box-shadow var(--t-fast),
    background var(--t-fast);
}
.nav--scrolled {
  border-bottom-color: #3c3c42;
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.55);
}

/* Count-up stats hold their digit width steady while animating so the row
   doesn't reflow as numbers tick up. */
.proof-stat__n {
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────────
   Breakpoints
   ───────────────────────────────────────────────────────────── */

/* ≥ 560px — form capsule goes inline, footer spreads */
@media (min-width: 560px) {
  .demo-form__row {
    flex-direction: row;
  }
  .demo-form .btn {
    width: auto;
    flex-shrink: 0;
  }
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ≥ 720px — roomier sections, three-up stats */
@media (min-width: 720px) {
  :root {
    --pad-x: 32px;
  }
  .section {
    padding-block: 88px;
  }
  .proof-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ≥ 1000px — four-up solution cards */
@media (min-width: 1000px) {
  .flow-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
