/*
 * The two web pages (ADR-006).
 *
 * Every colour here is a var() from tokens.css, which is generated from
 * src/design/tokens.json — the same file the app's theme comes from. A hex
 * literal in this file would be the one place the app and the web could drift,
 * so there is not one.
 *
 * The page is on the NIGHT surface, like the island screen. DESIGN 1.1: "on
 * regarde un objet lumineux dans une pièce sombre." The product's whole visual
 * argument is that it is calm, and a bright marketing page would contradict it
 * before a single word was read.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

:root {
  --measure: 34rem;
  --frame: min(64rem, 100%);
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --rhythm: clamp(3.5rem, 9vw, 7rem);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body.page {
  background: var(--bw-surfaces-night-bg);
  color: var(--bw-surfaces-night-fg);
  font-family: var(--bw-font-body-family), ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
 * Type
 * ------------------------------------------------------------------------ */

h1,
h2,
h3 {
  font-family: var(--bw-font-display-family), var(--bw-font-body-family), system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 7.5vw, 4rem);
}

h2 {
  font-size: clamp(1.65rem, 4.6vw, 2.5rem);
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

.lead {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--bw-surfaces-night-fgsecondary);
  max-width: var(--measure);
}

.prose {
  color: var(--bw-surfaces-night-fgsecondary);
  max-width: var(--measure);
  font-size: 1.0625rem;
}

.prose + .prose {
  margin-top: 1rem;
}

.muted {
  color: var(--bw-surfaces-night-fgmuted);
  font-size: 0.9375rem;
}

.eyebrow {
  color: var(--bw-surfaces-night-accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
 * Chrome
 * ------------------------------------------------------------------------ */

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: var(--gutter);
  z-index: 10;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--bw-surfaces-night-accent);
  color: var(--bw-surfaces-night-bg);
  font-weight: 700;
}

.topbar {
  width: var(--frame);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand img {
  width: 2.125rem;
  height: 2.125rem;
}

/* The other language. A link to a real page, never a flag. */
.lang {
  display: inline-flex;
  align-items: center;
  /* DESIGN 10.3: nothing tappable under 48px. */
  min-height: 3rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--bw-surfaces-night-border);
  color: var(--bw-surfaces-night-fgsecondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: border-color 160ms ease, color 160ms ease;
}

.lang:hover {
  border-color: var(--bw-surfaces-night-accent);
  color: var(--bw-surfaces-night-accent);
}

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

.hero {
  width: var(--frame);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem) var(--gutter) var(--rhythm);
  display: grid;
  gap: clamp(2rem, 6vw, 3.5rem);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.island {
  width: 100%;
  height: auto;
  max-width: 30rem;
  display: block;
  margin-inline: auto;
  overflow: visible;
}

/* A world that floats. Slow enough to be felt rather than watched. */
.island-body {
  transform-origin: 210px 180px;
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-9px) rotate(-0.5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .island-body {
    animation: none;
  }
}

/* Honest about the stage the product is at: not published yet. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--bw-surfaces-night-surface);
  border: 1px solid var(--bw-surfaces-night-border);
  color: var(--bw-surfaces-night-fgsecondary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--bw-surfaces-night-accent);
}

/* --------------------------------------------------------------------------
 * Sections
 * ------------------------------------------------------------------------ */

.section {
  width: var(--frame);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--rhythm);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.section--tight {
  max-width: 52rem;
}

.section--card > * {
  position: relative;
}

.section--card {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 3.75rem);
  margin-bottom: var(--rhythm);
  border-radius: 1.75rem;
  background: var(--bw-surfaces-night-surface);
  border: 1px solid var(--bw-surfaces-night-border);
  width: min(64rem, calc(100% - 2 * var(--gutter)));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.4rem;
  border-radius: 1.15rem;
  background: var(--bw-surfaces-night-surfaceraised);
}

.tile p {
  color: var(--bw-surfaces-night-fgsecondary);
  font-size: 0.9375rem;
}

.steps {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 1.35rem;
  border-top: 2px solid var(--bw-surfaces-night-border);
}

.step-index {
  color: var(--bw-surfaces-night-accent);
  font-family: var(--bw-font-display-family), system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.step p {
  color: var(--bw-surfaces-night-fgsecondary);
  font-size: 0.9375rem;
}

.never {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.never li {
  position: relative;
  padding-left: 2rem;
  color: var(--bw-surfaces-night-fgsecondary);
}

/*
 * A rule, not a cross. DESIGN reserves red for technical errors, and a page of
 * red crosses would read as a page about faults — which is the opposite of
 * what this list says.
 */
.never li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 1.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--bw-surfaces-night-accent);
}

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

.footer {
  width: var(--frame);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--bw-surfaces-night-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
  color: var(--bw-surfaces-night-fgsecondary);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
 * Reveal
 *
 * Hidden ONLY once the script has run. Without JavaScript, or with reduced
 * motion, every section is visible from the first paint — the page is never
 * blank because a feature failed.
 * ------------------------------------------------------------------------ */

.animate .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.animate .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
 * The invitation page
 * ------------------------------------------------------------------------ */

.frame {
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: var(--gutter);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.15rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.35rem;
  border-radius: 1.15rem;
  background: var(--bw-surfaces-night-surface);
  border: 1px solid var(--bw-surfaces-night-border);
}

.label {
  color: var(--bw-surfaces-night-fgmuted);
  font-size: 0.875rem;
  font-weight: 700;
}

.body {
  font-size: 1.125rem;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  background: var(--bw-surfaces-night-accent);
  color: var(--bw-surfaces-night-bg);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  background: var(--bw-surfaces-night-accent);
  color: var(--bw-surfaces-night-bg);
}

/* --------------------------------------------------------------------------
 * Focus
 * ------------------------------------------------------------------------ */

:focus-visible {
  outline: 3px solid var(--bw-surfaces-night-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
