/* EchoInside landing page.
   The base rules are the still page: it reads top to bottom with no scripts and no motion.
   Rules under `.motion` (set on <html> by a script, unless the visitor asks for reduced motion)
   turn the same markup into the pinned, scroll-driven version. */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/Newsreader-Roman.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/Newsreader-Italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Roman.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* From the app's DesignSystem.swift. */
  --ink: #2a2118;
  --ink-soft: #4a3b2a;
  --ink-muted: #7d6a55;
  --ink-faint: #a8927a;
  /* Small labels on light paper: dark enough to pass 4.5 to 1. */
  --ink-label: #6b5843;
  --honey: #e8aa4e;
  --honey-lit: #f2bf6b;
  --honey-ink: #844100;
  --honey-soft: #f6e2c0;
  --oat: #f3e7d2;
  --oat-deep: #ead6b3;
  --paper: #fbf2df;
  --night: #231a13;
  --night-deep: #1c140e;
  --night-lift: #3b2a1c;
  --cream: #f5e9d6;

  --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  --edge: max(var(--gutter), calc((100vw - 1240px) / 2));

  /* Set by the scripts as the day turns. */
  --nav-ink: var(--ink);
  --nav-paper: var(--cream);
  --g1: #f7e3d6;
  --g2: #f3d9c3;
  --day-ink-rgb: 42, 33, 24;
  --day-accent: var(--honey-ink);
}

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--oat);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain over the light sections. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .5 -.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; }
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
.defs { position: absolute; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--honey-ink);
  outline-offset: 4px;
  border-radius: 6px;
}
.day :focus-visible, .lines :focus-visible, .get :focus-visible, .footer :focus-visible {
  outline-color: var(--honey);
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 18px var(--edge);
  color: var(--nav-ink);
  transition: color 0.35s ease;
}
.motion .nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
}
/* After the day, words scroll under the bar. A veil of the night ground keeps the bar readable. */
.motion .nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -22px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(var(--nav-veil, transparent) 58%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; }

.nav-links { display: flex; gap: clamp(16px, 2.6vw, 36px); }
.nav-links a {
  font-style: italic;
  text-decoration: none;
  padding: 6px 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s ease;
}
.nav-links a:hover { background-size: 100% 1px; }

.nav-get {
  padding: 9px 20px 10px;
  border-radius: 999px;
  background: var(--nav-ink);
  color: var(--nav-paper);
  font-style: italic;
  text-decoration: none;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px 17px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#3b2d20, #231a12);
  color: var(--cream);
  font: italic 1.3rem/1 var(--serif);
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 28px -14px rgba(42, 33, 24, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button svg {
  width: 22px;
  height: 22px;
  color: var(--honey);
  transition: transform 0.25s ease;
}
.button:hover svg { transform: translateX(4px); }
.button:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 14px -10px rgba(42, 33, 24, 0.7);
}
.button-quiet {
  background: rgba(245, 233, 214, 0.08);
  box-shadow: inset 0 0 0 1px rgba(245, 233, 214, 0.28);
}

/* ---------- Hero: the doorway ---------- */

.hero { background: var(--oat); position: relative; }
.hero-pin {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  overflow: clip;
  background:
    radial-gradient(60% 50% at 78% 8%, rgba(242, 205, 176, 0.55), transparent 70%),
    var(--oat);
}
.hero-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
  padding: 88px var(--edge) 40px;
}

.doorway {
  position: relative;
  justify-self: center;
  width: min(100%, calc((100svh - 150px) * 1.283));
  aspect-ratio: 862 / 672;
}
.doorway-tilt, .doorway-flat { position: absolute; inset: 0; }
.door-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.door-left, .door-right { transform-origin: 0 0; }
/* The room drawing carries the shadow of the open right-hand leaf in its corner. Shut, that shadow has no door. */
.door-room { clip-path: polygon(0 0, 100% 0, 100% 95%, 94% 95%, 94% 100%, 0 100%); }
.door-light {
  position: absolute;
  inset: auto 4% -9% 4%;
  height: 34%;
  background: radial-gradient(ellipse at 50% 8%, rgba(255, 226, 170, 0.95), rgba(255, 226, 170, 0) 68%);
  filter: blur(14px);
}
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }

.hero-copy h1 {
  max-width: 11.5em;
  font-size: clamp(2.5rem, 4.5vw + 0.4rem, 4.9rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.squiggle { position: relative; white-space: nowrap; font-style: italic; }
.squiggle svg {
  position: absolute;
  left: -1%;
  bottom: -0.14em;
  width: 102%;
  height: 0.2em;
  overflow: visible;
}
.squiggle path {
  fill: none;
  stroke: var(--honey);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 1 2;
}
.hero-sub {
  max-width: 25em;
  margin-top: clamp(18px, 2.6vh, 30px);
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 1.1vw + 0.8rem, 1.45rem);
  font-style: italic;
  line-height: 1.42;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(22px, 3.4vh, 38px);
}
.store-note {
  color: var(--ink-label);
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
a.store-note { border-bottom: 1px solid currentColor; }
.facts {
  display: flex;
  flex-wrap: wrap;
  margin-top: clamp(20px, 3.4vh, 40px);
  color: var(--ink-label);
  font-size: 1rem;
  font-style: italic;
}
.facts li { padding: 0 16px; border-left: 1px solid rgba(42, 33, 24, 0.22); }
.facts li:first-child { padding-left: 0; border-left: 0; }

.hero-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(#f7e3d6, #f3d9c3);
}

.motion .hero { height: 200vh; height: 200svh; z-index: 3; pointer-events: none; background: none; }
.motion .hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; pointer-events: auto; will-change: opacity; }
.motion .doorway { perspective: 1400px; }
.motion .doorway-tilt { transform-style: preserve-3d; transform-origin: 50% 56%; will-change: transform; }
.motion .door-left, .motion .door-right { will-change: transform; }
/* Nearer the viewer than the doors, and scaled back so it still registers with them at rest. */
.motion .door-front { transform: translateZ(46px) scale(0.9671); }
.motion .dust { display: block; }
.motion .hero-copy { will-change: transform, opacity; }
.motion .squiggle path {
  stroke-dashoffset: 1.01;
  animation: draw 1.1s 1.5s cubic-bezier(0.3, 0, 0.15, 1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- The day ---------- */

.day {
  padding: 72px var(--gutter) 40px;
  background: linear-gradient(var(--oat), var(--oat-deep));
}
.day-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 880px;
  margin: 0 auto;
  color: rgb(var(--day-ink-rgb));
}
/* Still page: the wrappers step aside and each moment's room, words and screen follow one another. */
.room, .room-art, .moments, .phone-wrap, .phone, .phone-body, .phone-front, .screens { display: contents; }
.sky, .candle, .hotspot, .trace, .stars, .room-light, .pointer-glow, .phone-back, .phone-shadow, .phone-island, .phone-slice, .phone-side, .moment-try { display: none; }

.room-frame { position: relative; width: 100%; }
.room-img { display: block; width: 100%; height: auto; }
.room-frame[data-i="0"] { order: 0; }
.room-frame[data-i="1"] { order: 3; }
.room-frame[data-i="2"] { order: 6; }
.room-frame[data-i="3"] { order: 9; }
.room-frame[data-i="4"] { order: 12; }
.moment[data-i="0"] { order: 1; }
.moment[data-i="1"] { order: 4; }
.moment[data-i="2"] { order: 7; }
.moment[data-i="3"] { order: 10; }
.moment[data-i="4"] { order: 13; }
.screen[data-i="0"] { order: 2; }
.screen[data-i="1"] { order: 5; }
.screen[data-i="2"] { order: 8; }
.screen[data-i="3"] { order: 11; }
.screen[data-i="4"] { order: 14; }

.moment { max-width: 34rem; margin: 20px 0 32px; text-align: center; }
.moment-time {
  color: var(--day-accent);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.moment-time span { margin-left: 0.9em; opacity: 0.9; }
.moment h2 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 2.6vw + 0.9rem, 3.2rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.moment-body {
  margin-top: 14px;
  color: rgba(var(--day-ink-rgb), 0.78);
  font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.22rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.moment-try {
  margin-top: 16px;
  color: var(--day-accent);
  font-style: italic;
}
.sky-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky-arc path {
  fill: none;
  stroke: rgba(var(--day-ink-rgb), 0.42);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1.5 7;
}
.sky-tick {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.sky-tick::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(var(--day-ink-rgb), 0.5);
  transition: transform 0.2s ease;
}
.sky-tick:hover::after { transform: scale(1.5); }
.sun {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 0 14px rgba(240, 189, 98, 0.75));
}
.sun:active { cursor: grabbing; }
.sun svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sun-day { opacity: calc(1 - var(--moon, 0)); }
.sun-night { opacity: var(--moon, 0); }
.sky-hint {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translateX(-50%);
  color: rgba(var(--day-ink-rgb), 0.82);
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.5s ease;
}
.sky-hint.is-gone { opacity: 0; }
@keyframes flicker {
  0%, 100% { scale: 1; }
  18% { scale: 0.93; }
  31% { scale: 1.04; }
  52% { scale: 0.96; }
  70% { scale: 1.06; }
  84% { scale: 0.95; }
}
.hotspot-ring, .hotspot-ring::after {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid #fff3d6;
  box-shadow: 0 0 0 1px rgba(132, 65, 0, 0.45), 0 0 16px rgba(255, 220, 150, 0.9);
}
.hotspot-ring::after {
  content: "";
  inset: -2px;
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.3); opacity: 0; }
}

/* ---------- The phone ---------- */

.phone-wrap { font-size: 10px; }

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: none;
  width: 27em;
  height: 56em;
  margin-bottom: 72px;
  padding: 5.6em 1.8em 0;
  overflow: hidden;
  border: 0.85em solid #1d150f;
  border-radius: 4.4em;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.3;
  text-align: left;
  box-shadow: 0 30px 50px -30px rgba(42, 33, 24, 0.6);
}
.screen.dark { background: linear-gradient(#2d2119, #1e150f); color: var(--cream); }

.sb {
  position: absolute;
  top: 1.7em;
  left: 2.8em;
  right: 2.8em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sb span { font: 600 1.3em/1 -apple-system, "SF Pro Text", system-ui, sans-serif; }
.sb i { width: 2.4em; height: 1.1em; border-radius: 0.35em; background: currentColor; opacity: 0.75; }

/* Today */
.st-room { display: block; width: calc(100% + 2.4em); max-width: none; height: auto; margin: -0.6em -1.2em 0; }
.st-label {
  margin: 2em 0 1em;
  color: var(--honey-ink);
  font: 500 0.95em/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.st-card {
  padding: 1.7em 1.7em 1.4em;
  border-radius: 1.5em;
  background: #fffaf0;
  box-shadow: 0 0.1em 0 rgba(42, 33, 24, 0.06), 0 1.4em 2.2em -1.6em rgba(42, 33, 24, 0.55);
}
.st-card p { font-size: 2.35em; font-style: italic; line-height: 1.14; }
.st-card span { display: block; margin-top: 1.3em; color: var(--ink-faint); font: 500 0.9em/1 var(--mono); letter-spacing: 0.1em; }
.st-week { display: flex; justify-content: space-between; margin: 1.7em 0.2em 0; }
.st-week i {
  display: grid;
  place-items: center;
  width: 2.7em;
  height: 2.7em;
  border: 0.12em solid rgba(42, 33, 24, 0.16);
  border-radius: 50%;
  color: var(--ink-muted);
  font: normal 500 0.95em/1 var(--mono);
}
.st-week .on { border-color: var(--honey); background: var(--honey-soft); color: var(--honey-ink); }
.st-week .now { border-color: var(--ink); color: var(--ink); }
.st-set {
  display: flex;
  align-items: center;
  gap: 1.3em;
  margin-top: 1.6em;
  padding: 1.1em 1.4em;
  border: 0.1em solid rgba(42, 33, 24, 0.12);
  border-radius: 1.5em;
}
.st-set img { flex: none; width: 4.6em; height: auto; }
.st-set b { display: block; font-size: 1.6em; font-weight: 500; line-height: 1.15; }
.st-set span { display: block; color: var(--ink-muted); font-size: 1.2em; font-style: italic; }
.st-start, .se-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  margin-top: auto;
  padding: 1.3em;
  border-radius: 99em;
  background: linear-gradient(#3b2d20, #231a12);
  color: var(--cream);
}
.st-start span { font-size: 1.75em; font-style: italic; line-height: 1; }
.st-start svg { width: 1.9em; height: 1.9em; color: var(--honey); }
.tabs {
  display: flex;
  justify-content: space-around;
  margin: 1.3em -1.8em 0;
  padding: 1.1em 0 2.3em;
  border-top: 0.1em solid rgba(42, 33, 24, 0.1);
}
.tabs span { color: var(--ink-faint); font-size: 1.3em; }
.tabs .on { color: var(--ink); }

/* Editor */
.se-title { font-size: 2.7em; line-height: 1.1; letter-spacing: -0.01em; }
.se-sub { margin: 0.35em 0 0.9em; color: var(--ink-muted); font-size: 1.25em; font-style: italic; }
.se-lines { counter-reset: line; }
.se-lines li {
  counter-increment: line;
  display: flex;
  gap: 0.5em;
  padding: 0.6em 0;
  border-bottom: 0.07em solid rgba(42, 33, 24, 0.12);
  font-size: 1.42em;
  line-height: 1.2;
}
.se-lines li::before {
  content: counter(line);
  flex: none;
  width: 1.5em;
  padding-top: 0.3em;
  color: var(--honey-ink);
  font: 500 0.68em/1 var(--mono);
}
.se-lines .editing {
  margin: 0 -0.5em;
  padding: 0.6em 0.5em;
  border-bottom-color: transparent;
  border-radius: 0.55em;
  background: #fff7e6;
  box-shadow: 0 0 0 0.09em var(--honey);
}
.se-lines .editing span::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 0.08em;
  vertical-align: -0.14em;
  background: var(--honey-ink);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.se-save { margin-bottom: 2.3em; font-size: 1.75em; font-style: italic; line-height: 1; padding: 0.75em; }

/* Recorder */
.sr-dots { display: flex; justify-content: center; gap: 0.75em; margin-top: 0.9em; }
.sr-dots i { width: 0.7em; height: 0.7em; border-radius: 50%; background: rgba(245, 233, 214, 0.2); }
.sr-dots .done { background: rgba(245, 233, 214, 0.75); }
.sr-dots .now { background: var(--honey); box-shadow: 0 0 0 0.3em rgba(232, 170, 78, 0.22); }
.sr-count {
  margin: 3.4em 0 1.3em;
  color: var(--honey);
  font: 500 0.95em/1 var(--mono);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}
.sr-line { overflow-wrap: anywhere; font-size: 3.1em; line-height: 1.08; letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
.sr-hint { margin: 1em 1.2em 0; color: rgba(245, 233, 214, 0.58); font-size: 1.3em; font-style: italic; text-align: center; }
.sr-trace { display: block; width: 100%; height: 6.6em; margin-top: auto; overflow: visible; }
.sr-trace path {
  fill: none;
  stroke: var(--honey);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.sr-clock { margin: 0.7em 0 1.3em; color: rgba(245, 233, 214, 0.7); font: 500 1.2em/1 var(--mono); text-align: center; }
.sr-shutter {
  display: grid;
  place-items: center;
  flex: none;
  width: 7em;
  height: 7em;
  margin: 0 auto 3.2em;
  border: 0.34em solid var(--cream);
  border-radius: 50%;
}
.sr-shutter i {
  width: 5.4em;
  height: 5.4em;
  border-radius: 50%;
  background: #d9643a;
  transition: width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
}
.sr-shutter.is-rec i { width: 2.6em; height: 2.6em; border-radius: 0.6em; }

/* Player */
.sp-title {
  margin: 0.9em 0 2.2em;
  color: var(--honey);
  font: 500 0.95em/1 var(--mono);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}
.sp-lines { text-align: center; }
.sp-lines li { padding: 0.45em 0; color: rgba(245, 233, 214, 0.3); font-size: 1.5em; line-height: 1.25; }
.sp-lines .now { overflow-wrap: anywhere; padding: 0.3em 0; color: var(--cream); font-size: 2.6em; line-height: 1.1; }
.sr-line.is-long { font-size: 2.2em; }
.sp-lines .now.is-long { font-size: 1.9em; }
.se-lines li span { min-width: 0; overflow-wrap: anywhere; }
.sp-bar { flex: none; height: 0.36em; margin-top: auto; overflow: hidden; border-radius: 1em; background: rgba(245, 233, 214, 0.16); }
.sp-bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--honey); }
.sp-clock { margin: 1em 0 1.3em; color: rgba(245, 233, 214, 0.7); font: 500 1.1em/1 var(--mono); text-align: center; }
.sp-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  flex: none;
  width: 6.4em;
  height: 6.4em;
  margin: 0 auto 1.6em;
  border-radius: 50%;
  background: linear-gradient(var(--honey-lit), var(--honey));
}
.sp-play i { width: 0.8em; height: 2.2em; border-radius: 0.2em; background: #3a2a18; }
.sp-chips { display: flex; justify-content: center; gap: 0.8em; margin-bottom: 2.6em; }
.sp-chips span { padding: 0.45em 1em; border: 0.08em solid rgba(245, 233, 214, 0.25); border-radius: 9em; font-size: 1.15em; line-height: 1.2; }
.sp-chips .on { border-color: var(--honey); background: rgba(232, 170, 78, 0.2); color: #f6d9a3; }

/* Privacy */
.sv-art { display: block; width: 15em; height: auto; margin: 3.2em auto 1.8em; }
.sv-title { margin-bottom: 0.5em; font-size: 2.8em; line-height: 1.1; letter-spacing: -0.01em; text-align: center; }
.sv-list { margin: 0 0.4em; }
.sv-list li { position: relative; padding: 0.7em 0 0.7em 1.9em; border-bottom: 0.07em solid rgba(42, 33, 24, 0.12); font-size: 1.45em; line-height: 1.2; }
.sv-list li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.95em;
  width: 0.85em;
  height: 0.45em;
  border-left: 0.14em solid var(--honey-ink);
  border-bottom: 0.14em solid var(--honey-ink);
  transform: rotate(-45deg);
}
/* At night the privacy screen is dark, like the recorder and the player. */
.dark .sv-list li { border-bottom-color: rgba(245, 233, 214, 0.14); }
.dark .sv-list li::before { border-color: var(--honey); }
.dark .sv-delete { border-color: rgba(240, 150, 120, 0.5); color: #f0a488; }
.sv-delete {
  margin: auto 0 2.4em;
  padding: 0.8em;
  border: 0.08em solid rgba(162, 69, 42, 0.38);
  border-radius: 9em;
  color: #a2452a;
  font-size: 1.45em;
  font-style: italic;
  line-height: 1.1;
  text-align: center;
}
.phone-back svg { width: 46%; aspect-ratio: 1; }

/* ---------- The day, pinned: wide windows only ---------- */

@media (min-width: 900px) {
  .motion .day {
    position: relative;
    z-index: 1;
    height: 520vh;
    height: 520svh;
    margin-top: -100vh;
    margin-top: -100svh;
    padding: 0;
    background: none;
  }
  .motion .day-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    align-content: center;
    align-items: start;
    column-gap: clamp(28px, 5vw, 88px);
    padding: 76px var(--edge) 28px;
    overflow: hidden;
    overflow: clip;
    background: linear-gradient(var(--g1), var(--g2));
  }
  .motion .sky {
    display: block;
    position: relative;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: min(940px, 122svh);
    height: clamp(44px, 9svh, 88px);
    margin-bottom: 6px;
    z-index: 4;
  }
  .motion .room {
    display: block;
    position: relative;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: min(940px, 122svh);
    perspective: 1600px;
    z-index: 1;
  }
  .motion .room-art {
    display: block;
    position: relative;
    aspect-ratio: 1471 / 561;
    will-change: transform, opacity;
  }
  /* Stars sit behind everything on the stage. The shaft of light is cut to the painting's torn edge. */
  .motion .stars {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
  }
  .motion .room-light {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: screen;
    -webkit-mask: url("../img/room-dawn.webp") center / 100% 100% no-repeat;
    mask: url("../img/room-dawn.webp") center / 100% 100% no-repeat;
  }
  /* A warm glow the pointer carries at night. */
  .motion .pointer-glow {
    display: block;
    position: absolute;
    left: -260px;
    top: -260px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 196, 120, 0.5), rgba(255, 170, 80, 0.16) 38%, transparent 68%);
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    will-change: transform, opacity;
  }

  /* The five lights are stacked and cross-fade. Only the live recorder takes a press. */
  .motion .room-frame {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
  }
  .motion .room-frame[data-i="0"] { opacity: 1; }
  .motion .room-img { width: 100%; height: 100%; }
  .motion .room-frame .candle {
    display: block;
    position: absolute;
    left: 55.2%;
    top: 50%;
    width: 46%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.6), rgba(255, 170, 80, 0.2) 34%, transparent 66%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: flicker 4.2s ease-in-out infinite;
  }
  .motion .hotspot {
    display: block;
    position: absolute;
    left: 40.4%;
    top: 67%;
    width: 60px;
    height: 60px;
    margin: -30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
  }
  .motion .hotspot.is-live { pointer-events: auto; }
  .motion .moments {
    display: block;
    position: relative;
    grid-column: 1;
    grid-row: 3;
    height: clamp(12.5rem, 30svh, 17rem);
    margin-top: clamp(14px, 3svh, 30px);
    z-index: 2;
  }
  .motion .moment {
    position: absolute;
    inset: 0 auto auto 0;
    width: min(100%, 35rem);
    margin: 0;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
  }
  .motion .moment[data-i="0"] { opacity: 1; }
  .motion .moment-try { display: block; }
  .motion .phone-wrap {
    display: block;
    position: relative;
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    width: 27em;
    height: 56em;
    font-size: clamp(6.4px, 1.42svh, 10.6px);
    perspective: 1500px;
    z-index: 3;
  }
  .motion .phone { display: block; position: absolute; inset: 0; transform-style: preserve-3d; will-change: opacity; }
  .motion .phone-body { display: block; position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
  .motion .phone-slice { display: block; position: absolute; inset: 0; border-radius: 4.4em; }
  .motion .phone-side {
    display: block;
    position: absolute;
    top: 4.2em;
    bottom: 4.2em;
    width: 1.5em;
    background: linear-gradient(90deg, #2c2017, #8d6b47 45%, #6a4f35 60%, #2c2017);
  }
  .motion .phone-side.is-left { left: -0.75em; transform: rotateY(90deg); }
  .motion .phone-side.is-right { right: -0.75em; transform: rotateY(90deg); }
  .motion .phone-front {
    display: block;
    position: absolute;
    inset: 0;
    padding: 0.85em;
    border-radius: 4.4em;
    background: #1d150f;
    box-shadow: inset 0 0 0 0.14em #7a5c3f;
    transform: translateZ(0.76em);
    backface-visibility: hidden;
  }
  .motion .phone-back {
    display: grid;
    place-items: center;
    position: absolute;
    inset: 0;
    border-radius: 4.4em;
    background: radial-gradient(circle at 56% 50%, #5a4129, #2b1f16 72%);
    box-shadow: inset 0 0 0 0.14em #7a5c3f;
    color: #f3e7d2;
    transform: rotateY(180deg) translateZ(0.76em);
    backface-visibility: hidden;
  }
  .motion .screens {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 3.6em;
    background: var(--paper);
  }
  .motion .screen {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    visibility: hidden;
    will-change: transform;
  }
  .motion .phone-island {
    display: block;
    position: absolute;
    top: 1.95em;
    left: 50%;
    width: 7.6em;
    height: 2.2em;
    margin-left: -3.8em;
    border-radius: 2em;
    background: #120c08;
  }
  .motion .phone-shadow {
    display: block;
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: -5.5em;
    height: 6em;
    background: radial-gradient(ellipse, rgba(30, 20, 12, 0.42), transparent 68%);
    filter: blur(8px);
    will-change: transform, opacity;
  }
}

/* ---------- The day, in flow: narrow windows ---------- */

/* The voice trace is fixed to the window in both layouts. */
.motion .trace {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 899px) {
  /* Five blocks, one per moment: the room in that light, the words, that moment's screen. */
  .motion .day {
    position: relative;
    z-index: 1;
    margin-top: -100vh;
    margin-top: -100svh;
    padding: 56px var(--gutter) 64px;
    background: var(--g1);
  }
  .motion .day-pin { max-width: 560px; }

  /* Stars fill the window behind the day's content. */
  .motion .stars {
    display: block;
    position: sticky;
    top: 0;
    order: -2;
    flex: none;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    margin-bottom: -100vh;
    margin-bottom: -100svh;
    z-index: -1;
    pointer-events: none;
  }

  /* The sky stays under the top bar. Its ground hides what scrolls beneath both. */
  .motion .sky {
    display: block;
    position: sticky;
    top: 56px;
    order: -1;
    width: 100%;
    height: 52px;
    margin-bottom: 4px;
    z-index: 7;
  }
  .motion .sky::before {
    content: "";
    position: absolute;
    inset: -56px calc(-1 * var(--gutter)) -28px;
    z-index: -1;
    background: linear-gradient(var(--g1) 82%, transparent);
    pointer-events: none;
  }
  .sky-hint { top: 62%; }

  .motion .room-frame { width: 128%; max-width: 640px; }
  .motion .hotspot {
    display: block;
    position: absolute;
    left: 40.4%;
    top: 67%;
    width: 60px;
    height: 60px;
    margin: -30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
  }
  .motion .room-frame .candle {
    display: block;
    position: absolute;
    left: 55.2%;
    top: 50%;
    width: 46%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 120, 0.6), rgba(255, 170, 80, 0.2) 34%, transparent 66%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: flicker 4.2s ease-in-out infinite;
  }

  /* Above the voice trace, so it never crosses the words. */
  .motion .moment { position: relative; z-index: 6; margin: 18px 0 28px; }
  .motion .moment-try { display: block; }

  /* A screen starts lowered and a little askew, and settles when it comes into view. */
  .motion .phone-wrap { font-size: 8.6px; }
  .motion .screen {
    margin-bottom: 104px;
    opacity: 0;
    transform: translate3d(0, 44px, 0) rotate(-3deg) scale(0.95);
    transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.85, 0.2, 1);
  }
  .motion .screen.is-seen { opacity: 1; transform: none; }
  .motion .screen[data-i="4"] { margin-bottom: 24px; }
}

/* A short phone: a smaller screen, so all of it fits under the sky strip. */
@media (max-width: 899px) and (max-height: 620px) {
  .motion .phone-wrap { font-size: 7.4px; }
}

@media (pointer: coarse) {
  .sky-tick { width: 44px; height: 44px; margin: -22px; }
  .sky-tick::after { inset: 18px; }
}

/* ---------- Lines: the card stack ---------- */

.lines {
  overflow: hidden;
  overflow: clip;
  padding: clamp(88px, 15vh, 170px) var(--edge);
  background: linear-gradient(var(--night-deep), var(--night));
  color: var(--cream);
}
.lines-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}
.lines-copy h2, .get h2 {
  font-size: clamp(2.2rem, 3.4vw + 0.9rem, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.lines-copy p { max-width: 24em; margin-top: 18px; color: rgba(245, 233, 214, 0.72); font-size: 1.25rem; font-style: italic; }
.lines-controls { display: none; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 34px; }
.lines-copy .lines-hint { flex-basis: 100%; margin: 0; color: rgba(245, 233, 214, 0.62); font-size: 1rem; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  padding: 24px 24px 18px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 40%),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 24px 40px -22px rgba(0, 0, 0, 0.7);
}
.card p { font-size: 1.5rem; font-style: italic; line-height: 1.16; letter-spacing: -0.01em; text-wrap: balance; }
.card img { align-self: flex-end; width: auto; height: 46px; margin-top: 14px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.cards { counter-reset: card; }
.card::after {
  counter-increment: card;
  content: counter(card) " of 6";
  position: absolute;
  left: 24px;
  bottom: 20px;
  color: var(--ink-label);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lines-controls.has-scripts { display: flex; }
.lines-copy .lines-note {
  flex-basis: 100%;
  margin: 0;
  color: rgba(245, 233, 214, 0.62);
  font: 500 0.7rem/1.5 var(--mono);
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* A card of the visitor's own. */
.card-yours::after { counter-increment: none; content: "yours"; color: var(--honey-ink); }
.card-yours p, .card-write textarea { overflow-wrap: anywhere; }
.card-yours p.is-long { font-size: 1.25rem; }
.card-write { display: none; flex-direction: column; align-items: flex-start; gap: 12px; }
.card-yours.is-editing p { display: none; }
.card-yours.is-editing .card-write { display: flex; }
.card-write textarea {
  width: 100%;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px dashed rgba(132, 65, 0, 0.45);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: italic 1.5rem/1.16 var(--serif);
  letter-spacing: -0.01em;
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}
.card-write textarea:focus { outline: none; border-bottom-color: var(--honey-ink); }
.card-done {
  padding: 8px 20px 9px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(#3b2d20, #231a12);
  color: var(--cream);
  font: italic 1.05rem/1 var(--serif);
  cursor: pointer;
}
.card .card-done:focus-visible { outline-color: var(--honey-ink); }
.motion .card-yours.is-editing { cursor: auto; }
.motion .card-yours p.is-long { font-size: 1.85rem; }
.motion .card-write textarea { font-size: clamp(1.7rem, 3vw, 2.1rem); line-height: 1.1; }

/* Their line echoes: three rings out from the card. */
.echo-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  aspect-ratio: 1;
  margin: -50% 0 0 -50%;
  border: 2px solid var(--honey);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: echo 1.2s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
@keyframes echo {
  from { transform: scale(0.3); opacity: 0.8; }
  to { transform: scale(2); opacity: 0; }
}
.motion .cards {
  display: block;
  position: relative;
  justify-self: center;
  width: min(340px, 82vw);
  height: 400px;
  perspective: 1300px;
}
.motion .card {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 38px 34px 28px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.2, 1), opacity 0.4s ease;
}
.motion .card.is-held { cursor: grabbing; transition: none; }
.motion .card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(132, 65, 0, 0.16);
  border-radius: 5px;
  pointer-events: none;
}
.motion .card::after { left: 36px; bottom: 36px; }
.motion .card p { font-size: clamp(2.3rem, 4vw, 3rem); line-height: 1.06; }
.motion .card img { height: 92px; margin-right: 4px; }

/* ---------- Get the app ---------- */

.get {
  padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(72px, 12vh, 130px);
  background: radial-gradient(70% 46% at 50% 30%, #4a3421, rgba(35, 26, 19, 0) 72%), var(--night);
  color: var(--cream);
  text-align: center;
}
/* The room in the light of the visitor's own hour. */
.get-room { position: relative; width: min(620px, 100%); margin: 0 auto; }
.get-room img { display: block; width: 100%; height: auto; }
.get-room.is-night .candle {
  display: block;
  position: absolute;
  left: 55.2%;
  top: 50%;
  width: 46%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.6), rgba(255, 170, 80, 0.2) 34%, transparent 66%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flicker 4.2s ease-in-out infinite;
}
.get-mark { display: block; width: 44px; aspect-ratio: 1; margin: 30px auto 0; color: #f3e7d2; }
.get h2 { margin-top: 20px; font-style: italic; }
.get-now { margin-top: 14px; color: rgba(245, 233, 214, 0.78); font-size: 1.2rem; font-style: italic; }
.get-yours {
  max-width: 22em;
  margin: 26px auto -12px;
  color: var(--honey-lit);
  font-size: clamp(1.2rem, 1.2vw + 0.9rem, 1.6rem);
  font-style: italic;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.get-sub { margin-top: 6px; color: rgba(245, 233, 214, 0.72); font-size: 1.1rem; }
.store {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 36px;
  padding: 14px 40px 16px;
  border-radius: 18px;
  background: linear-gradient(var(--honey-lit), var(--honey));
  color: #2a2118;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 22px 60px -14px rgba(232, 170, 78, 0.6);
}
a.store[href] { transition: transform 0.15s ease; }
a.store[href]:hover { transform: translateY(-2px); }
.store-small { font: 500 0.7rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.store-big { font-size: 1.9rem; font-weight: 600; line-height: 1; letter-spacing: -0.01em; }
.get-terms { max-width: 30em; margin: 30px auto 0; color: rgba(245, 233, 214, 0.66); font-size: 0.98rem; font-style: italic; }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
  padding: 30px var(--edge) 40px;
  border-top: 1px solid rgba(245, 233, 214, 0.12);
  background: var(--night);
  color: rgba(245, 233, 214, 0.62);
  font-size: 0.98rem;
}
.footer .brand { margin-right: 0; color: var(--cream); font-size: 1.3rem; }
.footer .brand-mark { width: 24px; height: 24px; }
.footer p { flex: 1 1 22em; font-style: italic; }
.footer nav { display: flex; gap: 24px; }

/* ---------- Narrow windows ---------- */

@media (max-width: 899px) {
  .nav-links { display: none; }
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(8px, 2svh, 24px);
    padding-top: 64px;
    padding-bottom: 24px;
  }
  .doorway { width: min(116%, 600px, calc(46svh * 1.283)); }
  .hero-copy h1 { font-size: clamp(2.1rem, 8.6vw, 3.4rem); }
  .facts { font-size: 0.92rem; }

  .sun { width: 48px; height: 48px; margin: -24px; }
  .lines-inner { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  /* Narrow enough that the leaning cards clear the window's edges. */
  .motion .cards { width: min(300px, 72vw); height: 372px; }
  .motion .card { padding: 30px 28px 24px; }
  .motion .card::after { left: 30px; bottom: 30px; }
  .motion .card p { font-size: 2.3rem; }
  .motion .card img { height: 78px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer p { flex-basis: auto; }
}

@media (max-width: 899px) and (max-height: 700px) {
  .facts { display: none; }
  .moment h2 { font-size: 1.7rem; }
  .moment-body { font-size: 1rem; line-height: 1.4; }
}

/* A very short phone: a smaller doorway and tighter words, so "Step inside" stays on the first screen. */
@media (max-width: 899px) and (max-height: 600px) {
  .doorway { width: min(100%, calc(31svh * 1.283)); }
  .hero-copy h1 { font-size: clamp(1.75rem, 7.6vw, 2.1rem); }
  .hero-sub { margin-top: 10px; font-size: 1rem; line-height: 1.35; }
  .hero-actions { gap: 10px 20px; margin-top: 14px; }
  .button { padding: 13px 26px 14px; font-size: 1.15rem; }
}

@media (min-width: 900px) and (max-height: 680px) {
  .hero-copy h1 { font-size: clamp(2.2rem, 7.2svh, 3.6rem); }
  .facts { display: none; }
  .moment h2 { font-size: clamp(1.7rem, 5.4svh, 2.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
