/* The public landing page at /, over its WebGL scene (js/landing-scene.js). It shares
 * tokens.css with the app - palette, type, both themes - so colours come from tokens.css
 * only. Every block of copy sits on a scrim, so headline and body keep at least 7:1
 * contrast whatever the scene shows behind them. */

.landing {
  overflow-x: hidden;
  font-size: 16px;
}

.landing__scene,
.landing__still {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.landing__scene {
  display: block;
}

/* Two blank sheets on a soft ground, where the scene doesn't run. */
.landing__still {
  background:
    radial-gradient(60% 50% at 30% 20%, color-mix(in srgb, var(--surface) 90%, transparent), transparent 70%),
    radial-gradient(50% 60% at 75% 70%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 70%),
    var(--bg);
}

.landing__still::before,
.landing__still::after {
  content: "";
  position: absolute;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--popover-shadow);
  opacity: 0.6;
}

.landing__still::before {
  top: 22%;
  left: 18%;
  width: 22vw;
  height: 30vw;
  transform: rotate(-8deg);
}

.landing__still::after {
  top: 40%;
  right: 16%;
  width: 20vw;
  height: 28vw;
  transform: rotate(6deg);
}

.landing__vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 50%, transparent 40%, color-mix(in srgb, var(--bg) 40%, transparent) 100%);
}

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

/* Fixed on top while the page scrolls, on the same near-opaque scrim as the copy, so it
   stays readable over any sheet. */
.landing__header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.9rem clamp(1rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.landing__brand {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--ink);
  text-decoration: none;
}

.landing__brand::after {
  content: ".";
  letter-spacing: 0;
  color: var(--accent);
}

.landing__brand:hover {
  color: var(--ink);
}

/* The language switch and theme toggle, then the account actions. On a narrow screen
   the account actions wrap onto a second row. */
.landing__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem 1.2rem;
}

.landing__settings,
.landing__account {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.landing__lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}

.landing__lang button {
  padding: 0.32rem 0.6rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.landing__lang button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.landing__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--ink);
}

.landing__theme .icon {
  width: 18px;
  height: 18px;
}

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

.landing__main {
  position: relative;
  z-index: 2;
}

.landing__section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100svh;
  padding: 8rem clamp(1.4rem, 8vw, 9rem) 6rem;
}

.landing__section--end {
  align-items: flex-end;
}

.landing__section--centre {
  align-items: center;
  text-align: center;
}

/* A set width, so the copy never decides how narrow its block is - and in rem, not ch:
   Chromium can keep a ch measured in the fallback font after the web font arrives,
   which left the hero narrower in one theme than the other. 37.5rem is 60ch of Inter. */
.landing__block {
  width: min(100%, 37.5rem);
  padding: 2rem 2.2rem;
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  border-radius: var(--radius-lg);
  background: var(--scrim);
  backdrop-filter: blur(6px);
}

.landing__block--wide {
  width: min(100%, 47.5rem);
}

.landing__eyebrow {
  margin: 0 0 1.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing__title,
.landing__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink);
}

.landing__title {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
}

.landing__heading {
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.landing__lede {
  max-width: 27.5em;
  margin: 1.4rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  text-wrap: pretty;
  color: var(--ink-soft);
}

.landing__section--centre .landing__lede {
  margin-inline: auto;
}

.landing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.landing__section--centre .landing__actions {
  justify-content: center;
}

.landing__button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.landing__button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.landing__button--primary {
  background: var(--ink);
  color: var(--bg);
}

.landing__button--primary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

/* In the header. */
.landing__button--small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* While a stored session is being checked, the account actions wait unseen (landing.js). */
.landing--checking-session [data-account-actions] {
  visibility: hidden;
}

.landing__button .icon {
  width: 16px;
  height: 16px;
}

/* The play button shows play or pause by its pressed state. */
.landing__button .icon--pause,
.landing__button[aria-pressed="true"] .icon--play {
  display: none;
}

.landing__button[aria-pressed="true"] .icon--pause {
  display: inline;
}

/* How it works: three numbered steps. */
.landing__steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 2.2rem 0 0;
  padding: 0;
  counter-reset: step;
}

.landing__step {
  padding: 1.2rem 1.2rem 1.4rem;
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.landing__step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--muted);
}

.landing__step h3 {
  margin: 0.5rem 0 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.landing__step p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.landing__footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem clamp(1.4rem, 8vw, 9rem);
  border-top: 1px solid var(--line);
  background: var(--scrim);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.landing__footer .landing__brand {
  font-size: 0.9rem;
}

/* Blocks rise into view once the script is running; without it they simply show. */
.landing--animate .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

.landing--animate .reveal.reveal--in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .landing--animate .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .landing__steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing__block {
    padding: 1.4rem 1.5rem;
  }

  .landing__section--end {
    align-items: flex-start;
  }

  /* The header takes two rows: the brand and the settings, then the account actions
     across the full width. */
  .landing__controls {
    display: contents;
  }

  .landing__account {
    flex-basis: 100%;
  }

  .landing__account .landing__button {
    flex: 1;
    justify-content: center;
  }

  .landing__section {
    padding-top: 9rem;
  }
}
