/* Echo's website. One family (Nunito, as in the app); the home page opens on
   Echo's own world, a day sky over its hills, and the reading pages sit on the
   app's paper with white cards. Dark mode turns the sky to night. */

:root {
  --sky-top: #5fb3ec;
  --sky-bottom: #cde9fa;
  --ridge: #b08a6a;
  --tree: #4f9a4a;
  --hill: #8cc56b;
  --hill-near: #74b356;
  --ink: #1e1f3a;
  --ink-soft: #3b3d5c;
  --ink-mute: #6b6e8c;
  --paper: #f5f6fa;
  --card: #ffffff;
  --line: #e4e6f0;
  --lilac: #5b4ba8;
  --lilac-bg: #ece6ff;
  --coral: #b23a2b;
  --coral-bg: #ffe4de;
  --sun: #fff3c4;
  --cloud: rgba(255, 255, 255, 0.92);
  --radius: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #1b1d45;
    --sky-bottom: #4a3f80;
    --ridge: #3c3358;
    --tree: #2d4f3b;
    --hill: #2f5a3f;
    --hill-near: #264b34;
    --ink: #f1f2fa;
    --ink-soft: #c9cbe2;
    --ink-mute: #9b9ebd;
    --paper: #121328;
    --card: #1d1f3d;
    --line: #2c2f55;
    --lilac: #c4b8ff;
    --lilac-bg: #2a2350;
    --coral: #ff9f92;
    --coral-bg: #3f211e;
    --sun: #f2efe0;
    --cloud: rgba(255, 255, 255, 0.12);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: var(--lilac);
  font-weight: 700;
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 8px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

/* ---------- Header ---------- */

.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
}

.doc .top {
  position: static;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.brand svg {
  width: 40px;
  height: 40px;
}

.top nav {
  display: flex;
  gap: 4px;
}

.top nav a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
}

.top nav a:hover,
.top nav a[aria-current='page'] {
  background: var(--cloud);
}

.doc .top nav a:hover,
.doc .top nav a[aria-current='page'] {
  background: var(--lilac-bg);
}

/* ---------- Hero: Echo's world ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 24px;
  min-height: 680px;
  padding: 120px max(24px, calc((100vw - 1120px) / 2)) 200px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}

.hero-text {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 60px);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tagline {
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  margin: 14px 0 0;
}

.lede {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 18px 0 28px;
}

.sun {
  position: absolute;
  top: 70px;
  right: 18%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 26px color-mix(in srgb, var(--sun) 35%, transparent), 0 0 0 58px color-mix(in srgb, var(--sun) 16%, transparent);
}

.cloud {
  position: absolute;
  height: 44px;
  border-radius: 999px;
  background: var(--cloud);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  bottom: 14px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 20%;
  width: 56px;
  height: 56px;
}

.cloud::after {
  left: 48%;
  width: 40px;
  height: 40px;
}

.c1 {
  top: 120px;
  right: 10%;
  width: 150px;
}

.c2 {
  top: 76px;
  left: 40%;
  width: 96px;
  transform: scale(0.7);
}

.echo-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
}

.echo {
  width: min(380px, 80%);
  height: auto;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 30px 30px rgba(40, 50, 120, 0.18));
}

@keyframes float {
  50% {
    transform: translateY(-14px);
  }
}

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

.hills {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 240px;
}

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

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  padding: 10px 20px 10px 16px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  box-shadow: 0 8px 20px rgba(20, 22, 48, 0.18);
  transition: transform 0.15s ease;
}

.store:hover {
  transform: translateY(-2px);
}

.store[aria-disabled='true'] {
  pointer-events: none;
}

.store svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.store small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.soon {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-weight: 700;
}

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

.features,
.promise {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 24px;
}

.features h2,
.promise h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.features ul {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 56px;
}

.features li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.features img {
  flex: none;
}

.features h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.features p,
.promise p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 46ch;
}

.promise {
  padding-bottom: 88px;
}

.promise h2 {
  margin-bottom: 12px;
}

.promise p + p {
  margin-top: 14px;
}

/* ---------- Reading pages ---------- */

.paper article {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.paper h1 {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.updated {
  color: var(--ink-mute);
  font-weight: 700;
  margin: 6px 0 24px;
}

.paper article > p,
.paper section p,
.paper li {
  color: var(--ink-soft);
}

.paper section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-top: 16px;
}

.paper section h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  scroll-margin-top: 16px;
}

.paper section p {
  margin: 10px 0 0;
}

.paper ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.paper li + li {
  margin-top: 6px;
}

.toc {
  margin: 28px 0 8px;
}

.toc h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-mute);
}

.toc ol {
  columns: 2;
  column-gap: 32px;
  margin: 10px 0 0;
  padding-left: 22px;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 4px;
}

/* ---------- Support ---------- */

.contact {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 24px 0 16px;
}

.contact p {
  margin: 0;
}

.contact p + p {
  margin-top: 16px;
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.crisis {
  background: var(--coral-bg);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 40px;
}

.crisis h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--coral);
}

.crisis p {
  margin: 8px 0 0;
  color: var(--ink);
}

.paper article > h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
}

details {
  background: var(--card);
  border-radius: 18px;
  padding: 0 22px;
  margin-top: 10px;
}

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 18px;
  padding: 18px 28px 18px 0;
  position: relative;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-mute);
}

details[open] summary::after {
  content: '–';
}

details p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

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

.foot {
  border-top: 1px solid var(--line);
}

.foot-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  color: var(--ink-mute);
  font-size: 15px;
}

.foot p {
  margin: 0;
}

.foot p + p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
}

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .top {
    padding: 16px;
  }

  .top nav a {
    padding: 6px 8px;
    font-size: 15px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 96px 16px 170px;
    text-align: left;
  }

  .echo-wrap {
    order: -1;
  }

  .echo {
    width: 200px;
  }

  .sun {
    top: 88px;
    right: 8%;
    width: 64px;
    height: 64px;
  }

  .c1,
  .c2 {
    display: none;
  }

  .hills {
    height: 150px;
  }

  .features,
  .promise {
    padding: 48px 16px 16px;
  }

  .promise {
    padding-bottom: 56px;
  }

  .features ul {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .paper article {
    padding: 16px 16px 48px;
  }

  .paper section,
  .contact,
  .crisis {
    padding: 20px 18px;
  }

  .toc ol {
    columns: 1;
  }

  .foot-in {
    padding: 24px 16px 32px;
  }
}
