/* Layer order is repeated in every file: browsers use the first declaration they see, and files load alphabetically. */
@layer tokens, base, components, pages;

@layer pages {
  .wrap--wide { max-width: calc(64rem + 2 * var(--gutter)); }

  /* The hero: a quiet looping video behind a teal wash, text on the left. */
  .hero { position: relative; isolation: isolate; overflow: hidden; padding-bottom: var(--space-lg); }

  .hero__video {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 72% 40%;
  }

  .hero__shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, color-mix(in srgb, var(--teal-deep) 86%, transparent) 0%, color-mix(in srgb, var(--teal) 74%, transparent) 50%, color-mix(in srgb, var(--teal-deep) 88%, transparent) 100%);
  }

  /* On wide screens the text only covers the left: keep it dark there and let
     the warm light of the video through on the right. */
  @media (min-width: 48rem) {
    .hero--video .hero__shade {
      background:
        linear-gradient(90deg, color-mix(in srgb, var(--teal-deep) 90%, transparent) 0%, color-mix(in srgb, var(--teal-deep) 72%, transparent) 42%, color-mix(in srgb, var(--teal-deep) 18%, transparent) 75%, transparent 100%),
        linear-gradient(180deg, color-mix(in srgb, var(--teal-deep) 60%, transparent) 0%, transparent 22%, transparent 70%, color-mix(in srgb, var(--teal-deep) 55%, transparent) 100%);
    }
  }

  /* Hero without video: a few quiet "windows" drawn in SVG behind the wash. */
  .hero__windows {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    color: var(--on-teal-muted);
  }
  .hero--windows { background: var(--teal); }
  .hero__avatar--initials, .person__photo--initials {
    display: inline-grid;
    place-items: center;
    flex: none;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
  }
  .hero__avatar--initials { background: var(--teal-soft); color: var(--on-teal); }
  .person__photo--initials { width: 72px; height: 72px; border-radius: 50%; background: var(--teal); color: var(--on-teal); }

  .hero__content { position: relative; }
  .hero__body { padding-block: var(--space-lg); }
  .hero .lead { color: var(--on-teal); }

  .hero__foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); }
  .hero__person { display: flex; align-items: center; gap: 0.875rem; }
  .hero__avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 2px solid var(--on-teal-muted); }
  @media (min-width: 48rem) { .hero__avatar { width: 80px; height: 80px; } }
  .hero__caption { font-size: 0.9375rem; line-height: 1.4; }
  .hero__caption strong { display: block; font-weight: 600; }
  .hero__caption span { color: var(--on-teal-muted); }

  .hero__pause {
    display: grid;
    place-items: center;
    flex: none;
    width: var(--tap);
    height: var(--tap);
    border: 1px solid var(--on-teal-muted);
    border-radius: 50%;
    background: color-mix(in srgb, var(--teal-deep) 55%, transparent);
    color: var(--on-teal);
    cursor: pointer;
  }

  .hero__pause:hover { background: color-mix(in srgb, var(--teal-deep) 85%, transparent); }
  .hero__pause[data-state="paused"] .hero__pause-icon--pause,
  .hero__pause[data-state="playing"] .hero__pause-icon--play { display: none; }
  .hero__pause[hidden] { display: none; }

  .intro { padding-top: var(--space-xl); }
  .intro .serif { font-size: 1.5rem; line-height: 1.35; }

  .section { padding-block: var(--space-xl) 0; }

  /* Two small previews of the app, built in HTML so the text stays sharp. */
  .previews { display: grid; gap: var(--space-md); }
  .preview { margin: 0; display: flex; flex-direction: column; gap: 0.625rem; }

  .preview__card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .preview__eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
  .preview__prompt { font-weight: 600; }
  .preview__hint, .preview__note { font-size: var(--text-sm); color: var(--muted); }
  .preview__field { min-height: 5.5rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); }
  .preview__button { padding: 0.75rem; border-radius: var(--radius-md); background: var(--teal); color: var(--on-teal); font-weight: 600; text-align: center; }
  .preview__entry { display: flex; flex-direction: column; gap: 0.125rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }

  .hero__alt { font-size: 0.9375rem; color: var(--on-teal-muted); }
  .hero__alt a { color: var(--on-teal); }

  /* Two ways in: the free Vooraf, or straight to the free module 1. */
  .start-choice { display: grid; gap: var(--space-md); }
  .start-choice__card { padding: 1.5rem; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--peach-line); }
  .start-choice__card .button { margin-top: auto; }
  .start-choice__eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); }

  .signup { padding-bottom: 2.5rem; }

  @media (min-width: 48rem) {
    .hero { min-height: 34rem; display: flex; }
    .hero__content { display: flex; flex-direction: column; justify-content: space-between; min-height: 30rem; }
    .hero__shade { background: linear-gradient(90deg, color-mix(in srgb, var(--teal-deep) 94%, transparent) 0%, color-mix(in srgb, var(--teal) 86%, transparent) 42%, color-mix(in srgb, var(--teal) 35%, transparent) 100%); }
    .hero__body { max-width: 34rem; }
    .hero__body h1 { font-size: 3.5rem; }
    .hero__button { display: inline-flex; width: auto; align-self: flex-start; }

    .previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .start-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  .hero__note { font-size: var(--text-sm); color: var(--on-teal-muted); }

  .outcomes > li { font-size: var(--text-lg); }

  .faq { display: grid; border-top: 1px solid var(--line); }
  .faq__item { border-bottom: 1px solid var(--line); }
  .faq__question { cursor: pointer; padding-block: 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
  .faq__question::-webkit-details-marker { display: none; }
  .faq__question::after { content: "+"; flex: none; font-weight: 400; font-size: 1.25rem; line-height: 1; color: var(--teal); }
  .faq__item[open] .faq__question::after { content: "−"; }
  .faq__answer { padding-bottom: 1.125rem; color: var(--ink-soft); }

  /* Phones only: the start button stays within reach after the hero. */
  .sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--cream) 94%, transparent);
    border-top: 1px solid var(--line);
  }
  @media (min-width: 48rem) { .sticky-cta { display: none; } }

}
