/* The home page — five scroll sections over one persistent subject.
 *
 * # The composition
 *
 * A fixed canvas carries a white organic mass and a field of wavefronts behind
 * it. The sections scroll over that; the subject drifts and shrinks as they go,
 * so it hands the stage to the copy instead of following it down the page. The
 * reference is a product plate: display serif with an italic counterpart, exact
 * data set small beside it, and a great deal of empty space doing the work.
 *
 * # Why the serif is scoped
 *
 * Every other surface in this application is a working tool and uses the system
 * sans. This page is the only one whose job is to introduce rather than operate,
 * so the serif is confined to .home-display and .sec-title and inherited by
 * nothing else.
 *
 * # Legibility over a moving background
 *
 * The field animates, so at some point in its cycle a bright ribbon passes
 * behind every line on this page. Contrast that depends on where an animation
 * happens to be is contrast that fails intermittently and never appears in a
 * screenshot, so each section carries its own scrim rather than trusting the
 * composition.
 */

.home {
  /* shell.css sets `body { display:grid; place-items:center; padding:24px }`,
   * which every other page wants. This page is full-bleed; inheriting that grid
   * pushed the whole composition below the fold. Display and padding must both
   * be undone, not just the padding. */
  display: block;
  place-items: normal;
  margin: 0;
  padding: 0;
  color: var(--ink);
  /* This gradient is the design when WebGL is unavailable, not a placeholder
   * for it. See portal-field.js. */
  background:
    radial-gradient(120% 90% at 68% 12%, #1e1c30 0%, transparent 58%),
    radial-gradient(90% 70% at 18% 88%, #2b1c2e 0%, transparent 60%),
    var(--bg);
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}
#field.is-live { opacity: 1; }

/* --- masthead ----------------------------------------------------------- */
.home-mast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px clamp(20px, 4vw, 54px);
  background: linear-gradient(to bottom, rgba(10,10,13,.82), rgba(10,10,13,0));
  pointer-events: none;
}
.home-mast > * { pointer-events: auto; }
.home-mast .wordmark { font-weight: 700; letter-spacing: .22em; font-size: 12px; }
.home-skip {
  margin-left: auto;
  font-size: 12.5px;
  letter-spacing: .02em;
  text-decoration: none;
  padding: 7px 15px;
  border: 1px solid var(--edge-solid);
  border-radius: 999px;
  background: rgba(18,18,21,.55);
}
.home-skip:hover { border-color: var(--core-dim); }

/* --- sections ----------------------------------------------------------- */
.home-scroll { position: relative; z-index: 1; }

.sec {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: 18px;
  max-width: 560px;
  margin: 0;
  padding: 96px clamp(20px, 4vw, 54px);
  box-sizing: border-box;
}
/* Per-section scrim: strongest at the left where the type lives, clearing to
 * nothing on the right so the subject is still the thing you look at. */
.sec::before {
  content: "";
  position: absolute;
  inset: 0;
  /* MUST be negative. A positioned ::before at z-index 0 paints ABOVE its
   * non-positioned in-flow siblings, and at 0 this covered the copy it exists
   * to protect. */
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg,
    rgba(10,10,13,.93) 0%,
    rgba(10,10,13,.86) 34%,
    rgba(10,10,13,.52) 62%,
    rgba(10,10,13,0)   88%);
}

.sec-num {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .3em;
  color: var(--core);
}

/* --- display type ------------------------------------------------------- */
.home-display,
.sec-title {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
               "Times New Roman", serif;
  font-weight: 400;
  margin: 0;
  line-height: .98;
  letter-spacing: -0.015em;
  text-shadow: 0 6px 40px rgba(0,0,0,.6);
}
.home-display {
  font-size: clamp(56px, 11vw, 150px);
  line-height: .92;
  color: color-mix(in srgb, var(--ink) 94%, transparent);
}
.sec-title {
  font-size: clamp(34px, 5.4vw, 70px);
  color: color-mix(in srgb, var(--ink) 92%, transparent);
}
.home-display em,
.sec-title em {
  font-style: italic;
  /* The reference's title colour: a slate that recedes rather than an accent
   * that shouts. Lifted toward the ink so it stays legible on the dark ground. */
  color: color-mix(in srgb, var(--slate) 62%, var(--ink));
}

.home-lede,
.sec-body {
  max-width: 42ch;
  margin: 0;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.62;
  color: var(--ink-dim);
}

/* --- spec block --------------------------------------------------------- */
/* Small, exact, aligned left. Every line is a claim the product actually makes;
 * none of it is filler. */
.home-spec { font-size: 13px; line-height: 1.5; color: var(--ink-dim); }
.home-spec b {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 9px;
}
.home-spec span {
  display: block;
  padding-left: 15px;
  margin-bottom: 5px;
  position: relative;
  color: color-mix(in srgb, var(--ink) 74%, transparent);
}
.home-spec span::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 6px; height: 1px;
  background: var(--core);
  opacity: .8;
}

/* --- actions ------------------------------------------------------------ */
.home-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 6px;
}
/* This page is not a form; a full-width button would read as one. */
.home .btn { width: auto; padding: 13px 26px; }
.home-quiet { font-size: 13px; text-decoration: none; }
.home-quiet:hover { text-decoration: underline; }

.home-links {
  margin-top: 26px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-dim);
}
.home-links a { text-decoration: none; }
.home-links a:hover { text-decoration: underline; }

.sec-hint {
  margin: 30px 0 0;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink-dim) 70%, transparent);
}

/* --- motion ------------------------------------------------------------- */
/* Sections rise slightly as they enter. Anything that ANIMATES IN must have a
 * visible resting state first: `animation-timeline` is not supported
 * everywhere, and a section that starts at opacity 0 waiting for an animation
 * that never runs is an invisible page. So the base state is fully visible and
 * the effect is added only where it is supported. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sec > * {
      animation: sec-rise linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 26%;
    }
    @keyframes sec-rise {
      from { opacity: 0; transform: translateY(22px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

@media (max-width: 720px) {
  .sec { max-width: none; padding-top: 110px; }
  .home-skip { display: none; }
}
