/* Self-hosted fonts (latin subsets from Google Fonts, all SIL OFL). Geist and Geist Mono are variable: one file covers every weight. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Archivo Black"; src: url("/fonts/archivo-black.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nabla"; src: url("/fonts/nabla.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #f3f0f2fb;
  --text: #0b4012;
  --muted: #34503a; /* 6:1 on the pink background */
  --border: #0b4012;
  --accent: #ff00d9;
  /* Ocean characters, calm water to crest: teal, turquoise, cerulean, cobalt, coral foam. */
  --ocean-ramp: #002505, #05521c, #048b08, #00ab55, #ff00d9;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Magenta is too light to read as text on pink, so links use the text color with a magenta underline. */
a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 4px; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Home: ocean hero ---------- */

.hero {
  position: relative;
  height: 100vh; /* fallback for browsers without dvh */
  height: 100dvh;
  min-height: 420px;
  overflow: hidden;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.hero.is-live canvas { opacity: 1; }

/* Plain type only when JavaScript is off; otherwise the canvas fades in over an empty hero. */
.hero-title {
  position: absolute;
  left: 5vw;
  bottom: 12%;
  margin: 0;
  font-family: "Nabla", "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(2.5rem, 10vw, 9rem);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
}

.js .hero-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Home: app list ---------- */

.apps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 48px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 96px 5vw 128px;
}

.apps-intro h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 500;
}

.apps-intro p {
  margin: 0;
  max-width: 32ch;
  color: var(--muted);
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.app-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 24px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.app-name {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  transition: transform 0.5s var(--ease-out), color 0.3s var(--ease-out);
}

.app-desc {
  grid-column: 1;
  color: var(--muted);
  transition: transform 0.5s var(--ease-out);
}

.app-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 1.75rem;
  color: var(--muted);
  transition: transform 0.5s var(--ease-out), color 0.3s var(--ease-out);
}

.app-row:hover .app-name,
.app-row:focus-visible .app-name { color: var(--accent); transform: translateX(10px); }
.app-row:hover .app-desc,
.app-row:focus-visible .app-desc { transform: translateX(10px); }
.app-row:hover .app-arrow,
.app-row:focus-visible .app-arrow { color: var(--accent); transform: translateX(6px); }
.app-row:active .app-name { transform: translateX(10px) scale(0.99); }

.app-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 767px) {
  .apps {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 56px 16px 80px;
  }
}

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

footer.site {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site.wide .container,
header.site.wide .container { max-width: 1400px; padding: 0 5vw; }

@media (max-width: 767px) {
  footer.site.wide .container,
  header.site.wide .container { padding: 0 16px; }
}

/* ---------- Subpages ---------- */

header.site {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

header.site a.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page { padding-top: 56px; padding-bottom: 80px; }

.page h1 { font-size: 2.6rem; line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; }
.page h2 { font-size: 1.3rem; margin: 48px 0 16px; }
.lead { color: var(--muted); font-size: 1.15rem; margin: 0; }

.links { padding-left: 20px; }

/* Long legal text (privacy policy). */
.policy h3 { font-size: 1.05rem; margin: 32px 0 12px; }
.policy ul { padding-left: 20px; }
.policy li { margin: 6px 0; }
.links li { margin: 6px 0; }

.breadcrumb { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }

/* ---------- App page ---------- */
/* Shape rule: screenshots get a 28px radius (matching the phone corners); everything else is square. */

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding-inline: 5vw;
}

.app-page h2 {
  margin: 0 0 40px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.app-page img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 1px 2px rgb(90 20 70 / 0.08), 0 18px 40px -12px rgb(90 20 70 / 0.35);
}

/* Hero: text left, one screen right, both within the first viewport. */
.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100dvh - 64px);
  padding-block: 48px;
}

.app-hero h1 {
  margin: 0 0 20px;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.app-hero-lead {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.45;
}

.app-hero .app-hero-shot {
  justify-self: center;
  width: auto;
  height: min(72dvh, 640px);
  transform: rotate(3deg);
}

/* Steps: four screens, every other one dropped a little so the row has rhythm. */
.steps { padding-block: 96px; }

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.step:nth-child(even) { margin-top: 72px; }

.step h3 {
  margin: 24px 0 6px;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
}

/* Statement: one large line, no imagery. */
.statement { padding-block: 96px 112px; }

.statement-big {
  margin: 0 0 24px;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: clamp(2.25rem, 6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.statement-body {
  margin: 0;
  max-width: 52ch;
  font-size: 1.15rem;
  color: var(--muted);
}

.support { padding-block: 0 96px; }
.support h2 { font-size: 1.25rem; margin-bottom: 16px; }

.support-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 1.1rem;
}

/* Steps fade up as they scroll in (CSS scroll-driven; browsers without it just show them). */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .step {
      animation: step-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
    @keyframes step-in {
      from { opacity: 0; transform: translateY(32px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* Tablet and phone: steps become a swipeable row (a 2-column grid makes each screen too tall). */
@media (max-width: 1023px) {
  .steps { padding-inline: 0; }
  .steps h2 { padding-inline: 5vw; }
  .steps-list {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 5vw;
    padding: 0 5vw 8px;
  }
  .step { flex: 0 0 min(68vw, 300px); scroll-snap-align: start; }
  .step:nth-child(even) { margin-top: 0; }
}

/* Phone: hero stacks, steps become a swipeable row. */
@media (max-width: 767px) {
  .wrap { padding-inline: 16px; }
  .app-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 40px;
    padding-block: 32px 16px;
  }
  .app-hero .app-hero-shot { height: auto; width: 72%; }
  .steps { padding-block: 64px; padding-inline: 0; }
  .steps h2 { padding-inline: 16px; }
  .steps-list { gap: 16px; scroll-padding-inline: 16px; padding-inline: 16px; }
  .statement { padding-block: 32px 72px; }
  .support { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Invite landing (/<app>/invite/) ---------- */

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 40px 0 24px;
}

.invite-button {
  display: inline-block;
  padding: 14px 24px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.invite-button:hover { background: var(--accent); }

.invite-link { color: var(--text); font-weight: 600; }

.invite-note { color: var(--muted); max-width: 52ch; }

/* ---------- Account deletion (/<app>/delete-account/) ---------- */
/* The primary action reuses .invite-button. Everything stays square. */

.delete-flow button { font-family: inherit; font-size: inherit; line-height: inherit; cursor: pointer; border-radius: 0; }
.delete-flow button.invite-button { border: 0; }
.delete-flow button:disabled { opacity: 0.5; cursor: progress; }
.delete-flow button:focus-visible,
.delete-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.delete-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 24px 0;
}

.button-outline {
  padding: 13px 23px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
}

.button-outline:hover { background: var(--text); color: var(--bg); }

/* A button that reads as a link: text color with the magenta underline. */
.button-text {
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.button-text:hover { text-decoration-thickness: 4px; }

.delete-or { color: var(--muted); margin: 32px 0 8px; }

.delete-form {
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.delete-form label { font-weight: 600; margin-top: 10px; }

.delete-form input {
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0;
  font: inherit;
}

.delete-message { min-height: 1.6em; margin: 0; color: var(--muted); max-width: 52ch; }
.delete-message.is-error { color: #b00020; font-weight: 600; }

[hidden] { display: none !important; }

/* ---------- Support (/<app>/support/) ---------- */
/* Topics are h2s and questions h3s. The email button reuses .invite-button, the topic list .support-links, answer lists .links. */

.faq h2 { scroll-margin-top: 24px; }
.faq h3 { font-size: 1.05rem; margin: 32px 0 8px; }
.faq h3 + p,
.faq h3 + .links { margin-top: 0; }

.faq-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 24px 0;
}

.faq-contact .invite-link { overflow-wrap: anywhere; }
