/* ---------------------------------------------------------------------------
   Anvyl landing styles
   Palette: graphite base, slate surfaces, ivory text, ash secondary,
   bronze accent, bronze-hi highlight.
--------------------------------------------------------------------------- */

/* --- Self-hosted fonts (latin subsets, mirrors the Google Fonts faces) ----- */

/* Inter is a variable font file; the three declarations match the weights
   the site uses, exactly as Google's CSS declared them */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/fraunces-italic-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/space-mono-latin.woff2") format("woff2");
}

:root {
  --graphite:  #121110;
  --slate:     #1e1a17;
  --ivory:     #f2ebe1;
  --ash:       #9a8f82;
  --bronze:    #c98a3e;
  --bronze-hi: #e7b36b;
  --hairline:  rgba(231, 179, 107, 0.14);

  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-mono:  "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --pad-x: clamp(1.5rem, 6vw, 4.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--graphite);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--bronze); color: var(--graphite); }

:focus-visible {
  outline: 2px solid var(--bronze-hi);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* --- Wordmark / header ---------------------------------------------------- */

.site-header {
  position: absolute;
  top: 0; left: 0;
  z-index: 5;
  padding: 1.75rem var(--pad-x);
}

.wordmark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ivory);
  letter-spacing: 0.01em;
}

.wordmark-dot { color: var(--bronze); font-style: normal; }

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  min-width: 0;
  max-width: 82rem;
  margin: 0 auto;
  padding: 7rem var(--pad-x) 6rem;
}

.hero-copy { max-width: 36rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 2rem;
}

.headline {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.headline-accent {
  display: block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 0.68em;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--bronze-hi);
  margin-top: 0.45em;
}

.subhead {
  color: var(--ash);
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  line-height: 1.7;
  max-width: 30em;
  margin: 1.75rem 0 2.5rem;
  text-wrap: balance;
}

/* --- Waitlist form ---------------------------------------------------------- */

.waitlist { max-width: 30rem; }

.hp { display: none; }

.waitlist-row { display: flex; gap: 0.625rem; }

.waitlist-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ivory);
  background: var(--slate);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 0.95rem 1.2rem;
  transition: border-color 0.35s var(--ease);
}

.waitlist-input::placeholder { color: var(--ash); opacity: 0.6; }
.waitlist-input:hover { border-color: rgba(231, 179, 107, 0.3); }

.waitlist-btn {
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  color: var(--graphite);
  background: var(--bronze);
  border: none;
  border-radius: 2px;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), transform 0.25s var(--ease);
}

.waitlist-btn:hover  { background: var(--bronze-hi); }
.waitlist-btn:active { transform: translateY(1px); }

/* Same type scale as the founding line */
.form-note {
  min-height: 1.5rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ash);
}

.form-note.is-success { color: var(--bronze-hi); }
.form-note.is-error   { color: #cf8272; }

.waitlist-input.is-shake {
  border-color: rgba(207, 130, 114, 0.65);
  animation: shake 0.32s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  45%      { transform: translateX(4px); }
  70%      { transform: translateX(-3px); }
  90%      { transform: translateX(2px); }
}

.waitlist.is-done .waitlist-row { display: none; }

.founding {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ash);
  margin-top: 1.5rem;
}

.founding-hi { color: var(--bronze-hi); }

/* --- Engine ticker ----------------------------------------------------------- */

.ticker {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--bronze);
  margin-top: 2.25rem;
}

.ticker-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bronze);
  animation: dot-pulse 2.6s ease-in-out infinite;
}

.ticker-text { transition: opacity 0.26s var(--ease); }
.ticker-text.is-swap { opacity: 0; }

.ticker-cursor {
  color: var(--bronze-hi);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 138, 62, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(201, 138, 62, 0); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* --- Scroll hint --------------------------------------------------------------- */

.scroll-hint {
  position: absolute;
  left: var(--pad-x);
  bottom: 1.75rem;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--ash);
  opacity: 0.55;
  animation: hint-pulse 2.8s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.2; }
}

/* --- Torso visual ----------------------------------------------------------------- */

.torso-visual {
  position: absolute;
  top: 0;
  right: 0;
  bottom: -12%;
  width: min(52vw, 700px);
  z-index: 1;
  pointer-events: none;
}

.torso {
  display: block;
  width: 100%;
  height: 112%;
  will-change: transform;
}

.torso-fill {
  fill: #1d1915;
  stroke: rgba(201, 138, 62, 0.62);
  stroke-width: 1.5;
}

.torso-lines path {
  fill: none;
  stroke: rgba(201, 138, 62, 0.42);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Region glows: the radial gradient in the SVG carries the soft falloff;
   only opacity animates. No filters anywhere in the animation path (SVG
   filter regions clip into visible rectangles on WebKit). */
.glow {
  opacity: 0.15;   /* regions stay faintly present between pulses */
  animation: ignite 5.4s ease-in-out infinite;
}

.glow-1 { animation-delay: 0s; }
.glow-2 { animation-delay: 1.08s; }
.glow-3 { animation-delay: 2.16s; }
.glow-4 { animation-delay: 3.24s; }
.glow-5 { animation-delay: 4.32s; }

@keyframes ignite {
  0%, 26%, 100% { opacity: 0.15; }
  10%           { opacity: 1; }
}

/* Fade the figure into the page at its left and bottom edges */
.torso-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, var(--graphite) 0%, rgba(18, 17, 16, 0) 38%);
}

.torso-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(0deg, var(--graphite) 4%, rgba(18, 17, 16, 0) 42%);
}

/* Scrim: only needed on mobile where copy sits over the figure */
.hero-scrim { display: none; }

/* --- Feature sections ------------------------------------------------------------ */

.feature { border-top: 1px solid var(--hairline); }

.feature-inner {
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(4.5rem, 12vh, 8rem) var(--pad-x);
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
  margin-top: 2.5rem;
}

.feature-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.feature-accent {
  display: block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 0.72em;
  line-height: 1.25;
  color: var(--bronze-hi);
  margin-top: 0.5em;
}

.feature-body p {
  color: var(--ash);
  max-width: 34em;
}

.stat {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--bronze) !important;
  margin-top: 1.75rem;
}

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

.cta { border-top: 1px solid var(--hairline); }

.cta-inner {
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 9rem) var(--pad-x);
  text-align: center;
}

.cta-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.cta .waitlist { margin: 2.75rem auto 0; }
.cta .founding { margin-top: 1.5rem; }

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

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  padding: 3.5rem var(--pad-x);
  text-align: center;
}

.wordmark-small { font-size: 1.25rem; }

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ash);
  margin-top: 0.75rem;
}

.copyright {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ash);
  opacity: 0.6;
  margin-top: 1.5rem;
}

/* --- Scroll reveals -------------------------------------------------------------------
   Gated behind .js-motion (added by script.js only when motion is allowed),
   so content is never hidden without JS or under reduced motion. */

.js-motion .rv {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.js-motion .rv-group.is-in .rv {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 880px) {
  /* Three-layer mobile hero.
     Layer 1 (back): the torso at full strength, anchored to the top half
     of the viewport where no text sits. No global opacity fade. */
  .torso-visual {
    top: 0;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(440px, 118vw);
    height: 56svh;
    transform: translateX(-44%);   /* centered, biased slightly right */
  }

  .torso { height: 100%; }

  .torso-visual::before { display: none; }

  /* Layer 2 (middle): the scrim does the legibility work instead of fading
     the figure. Transparent over the top 35%, ramping to near-opaque where
     the copy sits. */
  .hero-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
      180deg,
      rgba(18, 17, 16, 0) 0%,
      rgba(18, 17, 16, 0) 35%,
      rgba(18, 17, 16, 0.55) 52%,
      rgba(18, 17, 16, 0.92) 72%,
      rgba(18, 17, 16, 0.92) 100%
    );
  }

  /* Layer 3 (front): copy and form in the lower portion of the viewport */
  .hero { align-items: flex-end; }

  .hero-inner {
    padding-top: clamp(16rem, 42svh, 26rem);
    padding-bottom: 5rem;
  }

  .hero-copy { position: relative; }

  /* Subtle radial darkening directly behind the text block only */
  .hero-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -6% -14%;
    background: radial-gradient(
      ellipse 75% 60% at 50% 55%,
      rgba(18, 17, 16, 0.78),
      rgba(18, 17, 16, 0) 100%
    );
    pointer-events: none;
  }

  .headline { font-size: clamp(2.3rem, 10vw, 3.2rem); }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .waitlist-row { flex-direction: column; }
  .waitlist-btn { padding: 1rem 1.6rem; }
}

/* --- Reduced motion --------------------------------------------------------------------------
   Movement is disabled (parallax, slide-in reveals, shake, scroll hint,
   cursor blink; the JS side gates parallax, reveals, and the ticker cycle).
   Gentle opacity-only pulses stay on the region glows and the ticker dot,
   since opacity fades are not vestibular triggers. */

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

  .ticker-cursor,
  .scroll-hint,
  .waitlist-input.is-shake {
    animation: none;
  }

  /* Fully lit regions with a slow opacity breathe */
  .glow {
    animation: glow-breathe 6s ease-in-out infinite;
  }

  .torso { will-change: auto; }
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.5; }
}
