/* ---------------------------------------------------------------
   Autonomous Foundry — design tokens
--------------------------------------------------------------- */
:root {
  --black: #000000;
  --white: #ffffff;
  --purple: #8a16e8;

  --font-body: "PT Sans", sans-serif;

  --max-width: 1280px;

  /* fluid page gutter: 20px at 402px viewport -> 104px at 1280px viewport */
  --gutter: clamp(1.25rem, -1.154rem + 9.57vw, 6.5rem);

  /* fluid type: scales continuously with viewport width at the figma
     ratio (no plateau) — the max here is a sanity ceiling for very
     large/high-res screens, not the figma breakpoint value */
  --size-headline: clamp(2.5rem, 1.07rem + 5.7vw, 12rem);
  --size-legal: clamp(1rem, 0.885rem + 0.46vw, 1.25rem);
}

/* ---------------------------------------------------------------
   Reset
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.4;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  body { scroll-behavior: auto; }
}

h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------
   Shared layout helpers
--------------------------------------------------------------- */
.logo {
  display: inline-flex;
}

.logo__mark {
  display: block;
  width: 144px;
  height: 144px;
}

/* ---------------------------------------------------------------
   Hero
--------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 0.6rem + 2vw, 2.25rem) var(--gutter);
  padding-bottom: clamp(2rem, 1.4rem + 2vw, 3rem);
  text-align: center;
}

.hero__content {
  /* auto margins on a flex-column child both center it vertically (main
     axis) and, since they override stretch, horizontally (cross axis) —
     groups the logo and headline as one centered unit so the logo sits
     just above the headline instead of pinned to the very top edge */
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 0.7rem + 2vw, 2.5rem);
}

.hero__top {
  flex-shrink: 0;
}

.hero__headline {
  /* kept as normal block/inline content (not itself a flex container) so
     the word-group spans below wrap with normal text spacing */
  max-width: 68ch;
  font-family: var(--font-body);
  font-weight: 700;
  font-style: italic;
  font-size: var(--size-headline);
  line-height: 1.08;
  text-align: center;
}

/* Word-group reveal animation, injected by script.js */
.hero__headline .word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

.hero__headline .word-inner {
  display: inline-block;
  transform: translateY(115%);
  opacity: 0;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease-out;
}

.hero__headline .word-inner.is-in {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .hero__headline .word-inner {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* Minimal footer, shared by all pages. */
.site-footer {
  margin: 0 var(--gutter);
  padding: 1.75rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  font-size: var(--size-legal);
}

.footer__links a:hover,
.legal-copy a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 6px;
}

/* Legal pages use the same typography and palette as the homepage. */
.legal-header { padding: 2rem var(--gutter) 0; }
.legal-header .logo__mark { width: 80px; height: 80px; }
.legal-copy {
  max-width: 48rem;
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
  box-sizing: content-box;
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.legal-copy h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.legal-copy h2 { margin: 2rem 0 0.5rem; font-size: 1.375rem; }
.legal-copy p + p { margin-top: 1rem; }
.legal-copy .legal-date { color: #aaa; margin-bottom: 2rem; font-size: 1rem; }
.legal-copy a { text-decoration: underline; text-underline-offset: 0.2em; }
