/* Kinpath homepage.
 *
 * Loaded after policy.css, which owns the shared tokens, the font faces and the
 * policy-page furniture. Nothing here may change how the policy routes render —
 * every rule is scoped under .home or a home- prefix.
 *
 * Two principles, both from the brief:
 *
 *   1. The page is complete before any script runs. Every section carries its
 *      own background and its own contrast, so the palette passage from warm
 *      paper through evening plum to quiet dawn happens in CSS alone. The
 *      canvas deepens it; it does not deliver it. Delete the canvas and this
 *      page still reads as intended.
 *   2. Stillness is the register. Long measures, generous rests, one accent
 *      colour used sparingly, and no motion that asks to be watched.
 */

.home {
  --paper-warm: #fffaf7;
  --paper-deep: #f6ece5;
  --plum: #241b33;
  --plum-soft: #33254a;
  --plum-ink: #efe6f5;
  --plum-muted: #b7a6c9;
  --dawn: #f9efe9;
  --dawn-ink: #34243a;
  --rule: rgba(41, 36, 58, 0.14);
  --measure: 34rem;
  --step: clamp(1.25rem, 0.6rem + 2.4vw, 2.25rem);
  background: var(--paper-warm);
}

/* ---------------------------------------------------------------- scaffolding */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--coral-dark);
  padding: 0.9rem 1.2rem;
  z-index: 20;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* The scene sits behind everything and never takes a pointer event, so it can
 * never intercept a tap meant for a link. */
.home .scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1600ms ease;
}

/* Set by the scene once it has actually drawn a frame. Until then the canvas is
 * invisible, so a failed or absent renderer leaves no empty rectangle behind. */
.home .scene[data-ready="true"] {
  opacity: 1;
}

/* A wash between the scene and the words, protecting the TEXT COLUMN rather
 * than the whole viewport. An even overlay is the obvious approach and it is
 * wrong: it costs the ring its presence everywhere in order to win contrast in
 * one place. On narrow screens the text runs full width, so the wash becomes a
 * vertical one instead and the ring sits above it. */
.home .scene-wash {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 250, 247, 0) 0%,
    rgba(255, 250, 247, 0.42) 46%,
    rgba(255, 250, 247, 0.82) 72%,
    var(--paper-warm) 100%
  );
}

@media (min-width: 56rem) {
  .home .scene-wash {
    background: linear-gradient(
      to right,
      rgba(255, 250, 247, 0.88) 0%,
      rgba(255, 250, 247, 0.72) 26%,
      rgba(255, 250, 247, 0.22) 52%,
      rgba(255, 250, 247, 0) 68%
    );
  }
}

.home > *:not(.scene):not(.scene-wash) {
  position: relative;
  z-index: 2;
}

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

.home-header {
  background: transparent;
  border-bottom: none;
  padding-top: 0.5rem;
}

.home-header .header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

.home-header .brand {
  font-family: Literata, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  /* 44pt minimum, met by padding rather than by a larger glyph. */
  padding: 0.75rem 0;
  display: inline-block;
  min-height: 44px;
  line-height: 1.6;
}

.home-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-header nav a {
  display: inline-block;
  /* 44pt in BOTH directions. Short words like "Help" fail the width half of
   * the rule long before the height half, which is why min-width is here. */
  min-height: 44px;
  min-width: 44px;
  text-align: center;
  padding: 0.75rem 0;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 240ms ease, border-color 240ms ease;
}

.home-header nav a:hover,
.home-header nav a:focus-visible {
  color: var(--coral-dark);
  border-bottom-color: currentColor;
}

/* ---------------------------------------------------------------------- hero */

.home-main {
  margin: 0;
  padding: 0;
}

.home .hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 8rem) 1.5rem clamp(5rem, 14vh, 10rem);
}

.home .eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin: 0 0 1.5rem;
}

.home h1 {
  font-family: Literata, Georgia, serif;
  /* Editorial scale: big, but tied to the viewport so it never crowds a phone. */
  font-size: clamp(2.6rem, 1.2rem + 5.4vw, 5.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 1.75rem;
  max-width: 18ch;
  text-wrap: balance;
}

.home .lede {
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.62;
  color: var(--ink);
  max-width: var(--measure);
  margin: 0 0 2.5rem;
  text-wrap: pretty;
}

.home .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  margin: 0 0 2.5rem;
}

.home .hero-note {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 30rem;
  margin: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}

/* ------------------------------------------------------------------- buttons */

.home .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: var(--coral-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--coral-dark);
  transition: background-color 220ms ease, border-color 220ms ease,
    transform 220ms ease;
}

.home .button:hover,
.home .button:focus-visible {
  background: #6f1c32;
  border-color: #6f1c32;
}

.home .button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
  font-weight: 600;
}

.home .button-quiet:hover,
.home .button-quiet:focus-visible {
  background: rgba(41, 36, 58, 0.05);
  border-color: rgba(41, 36, 58, 0.32);
  color: var(--ink);
}

.home .button-large {
  font-family: Literata, Georgia, serif;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  padding: 1.1rem 2.2rem;
  font-weight: 600;
}

/* ----------------------------------------------------------------- passages */

.home .passage {
  padding: clamp(4rem, 12vh, 8rem) 1.5rem;
}

.home .passage > * {
  max-width: 72rem;
  margin-inline: auto;
}

.home .passage h2 {
  font-family: Literata, Georgia, serif;
  font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
}

/* The first passage sits on warm paper, opaque enough to read over the scene. */
.home .passage:not(.passage-quiet):not(.passage-close) {
  background: linear-gradient(
    to bottom,
    rgba(255, 250, 247, 0) 0%,
    var(--paper-warm) 12%,
    var(--paper-deep) 100%
  );
}

.home .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.home .card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--rule);
  border-radius: 1.1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.home .card h3 {
  font-family: Literata, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.85rem;
}

.home .card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

/* --------------------------------------------- evening plum: the deep passage */

.home .passage-quiet {
  background: linear-gradient(to bottom, var(--paper-deep) 0%, var(--plum) 22%, var(--plum) 100%);
  color: var(--plum-ink);
}

.home .passage-quiet h2 {
  color: var(--plum-ink);
}

.home .stance {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 56rem) {
  .home .stance {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

.home .stance-lead {
  font-family: Literata, Georgia, serif;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem);
  line-height: 1.5;
  margin: 0;
  color: var(--plum-ink);
  text-wrap: pretty;
}

.home .stance-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.home .stance-list li {
  padding-left: 1.4rem;
  border-left: 2px solid rgba(201, 64, 94, 0.55);
  color: var(--plum-muted);
  line-height: 1.68;
  max-width: var(--measure);
}

.home .stance-list strong {
  display: block;
  color: var(--plum-ink);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* ------------------------------------------------- quiet dawn: the last light */

.home .passage-close {
  background: linear-gradient(to bottom, var(--plum) 0%, #6b4a63 34%, var(--dawn) 100%);
  color: var(--dawn-ink);
  text-align: center;
}

.home .passage-close h2 {
  color: #fdf3ee;
}

.home .close-lede {
  font-family: Literata, Georgia, serif;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.7rem);
  line-height: 1.5;
  max-width: 32rem;
  margin: 0 auto clamp(2rem, 5vh, 3rem);
  color: #f6e9e2;
  text-wrap: pretty;
}

.home .close-actions {
  margin: 0 0 2.5rem;
}

.home .passage-close .button-large {
  background: #fdf3ee;
  color: #4a1226;
  border-color: #fdf3ee;
  /* An email address is long; let it wrap rather than overflow a phone. */
  word-break: break-word;
}

.home .passage-close .button-large:hover,
.home .passage-close .button-large:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #4a1226;
}

.home .close-note {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--dawn-ink);
  opacity: 0.82;
  line-height: 1.68;
}

/* -------------------------------------------------------------------- footer */

.home-footer {
  /* policy.css caps .site-footer at 72rem and centres it, which is right for a
   * policy page and wrong here: this footer carries a background colour that
   * closes the dawn gradient, so a capped width leaves two pale strips down the
   * sides. The content inside is still held to a readable measure by its own
   * children. */
  max-width: none;
  border-top: none;
  background: var(--dawn);
  color: var(--dawn-ink);
  padding: clamp(2.5rem, 6vh, 4rem) 1.5rem clamp(3rem, 8vh, 5rem);
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  text-align: center;
  font-size: 0.95rem;
}

.home-footer .footer-identity {
  margin: 0;
  max-width: 34rem;
  opacity: 0.75;
}

.home-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-footer nav a {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
  padding: 0.75rem 0;
  line-height: 1.6;
  color: var(--dawn-ink);
}

/* ------------------------------------------------------------- accommodations */

@media (prefers-reduced-motion: reduce) {
  .home *,
  .home *::before,
  .home *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  /* The scene still renders — one still frame, drawn once. An accommodation
   * that hides the artwork entirely is a worse experience, not a safer one. */
  .home .scene {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  .home .scene {
    display: none;
  }

  .home .card p,
  .home .close-note {
    color: var(--ink);
    opacity: 1;
  }

  .home .stance-list li {
    color: #fff;
  }
}

@media print {
  .home .scene,
  .home .scene-wash {
    display: none;
  }
}
