/* The home page. The colours are the clip's own: the night sky at its top, the lake below, and the soft mint of
   the sit's line of light. The fonts are the app's: Fluxisch Else for the words, Hanken Grotesk for the rest. */

@font-face {
  font-family: "Fluxisch Else";
  src: url("/fonts/FluxischElse-Light.otf") format("opentype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/HankenGrotesk-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --sky: #20234e;
  --night: #1d2046;
  --deep: #17192f;
  --ink: #eeedf7;
  --soft: rgba(238, 237, 247, 0.76);
  --faint: rgba(238, 237, 247, 0.5);
  --mint: #a8e0cc;
  --words: "Fluxisch Else", ui-sans-serif, system-ui, sans-serif;
  --plain: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* One colour for the whole page, the night's: Safari on an iPhone paints the bands behind the status bar and
   behind its toolbar with the page's own colour, so both are one with the page. */
html { background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 17px/1.6 var(--plain);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--words); font-weight: 300; margin: 0; text-wrap: balance; }
p { margin: 0; }

.name { font: 300 22px/1 var(--words); letter-spacing: 0.01em; }
.soon {
  font: 600 12px/1 var(--plain);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
}
/* The beta's TestFlight link: a mint pill with the night's colour for its words, tall enough to tap. */
.join {
  display: inline-block;
  padding: 16px 24px 15px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--night);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(6, 7, 20, 0.35);
  transition: background-color 0.2s;
}
.join:hover, .join:focus-visible { background: #c4ecdd; }

/* The hero: the night clip filling the screen, the words in the open sky to the left of the tree. */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--sky);
}
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Cropped from the right on a narrower window, so the tree moves right and the open sky stays by the words,
     and from the bottom on a wider one, so the treetop stays in view. */
  object-position: 0% 15%;
  background: url("/media/night-wide.jpg?v=2") 0% 15% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(29, 32, 70, 0.55), rgba(29, 32, 70, 0) 46%),
    linear-gradient(to bottom, rgba(29, 32, 70, 0) 78%, var(--night) 100%);
}
.copy {
  position: absolute;
  z-index: 1;
  left: max(24px, 6vw);
  top: 16svh;
  width: min(30rem, 31vw);
}
.copy .name { margin-bottom: 28px; }
.copy h1 {
  font-size: clamp(34px, 3.7vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.copy .lede {
  font: 300 clamp(19px, 1.5vw, 23px)/1.4 var(--words);
  color: var(--soft);
  margin-bottom: 26px;
}

/* On a tall screen the clip stands under the words, its empty sky behind them, with the whole tree and a little
   of the lake on the first screen. */
@media (max-aspect-ratio: 3/4) {
  /* The words first and the clip under them, pulled up so its empty sky is behind them, however many lines they take. */
  .hero { display: flex; flex-direction: column-reverse; height: auto; min-height: 0; background: none; }   /* the page's sky-to-night shows through the clip's faded edges */
  .hero::after { display: none; }
  .scene {
    position: relative;
    display: block;
    height: auto;
    aspect-ratio: 780 / 1000;
    margin-top: calc(15px - 19.6vw);   /* the crown 15px under the join link: it stands 19.6vw into the clip */
    object-position: center;
    background: url("/media/night-tall.jpg?v=3") center / cover no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 90%, transparent 100%);
  }
  .copy { position: relative; left: 0; top: 0; width: auto; padding: 32px 24px 0; }
  .copy .name { margin-bottom: 20px; }
  .copy h1 { font-size: clamp(30px, 8.4vw, 48px); margin-bottom: 12px; }
  .copy .lede { font-size: clamp(18px, 4.8vw, 22px); margin-bottom: 22px; }
}

/* A new leaf: the sunrise clip in the shape of a phone's screen, beside one line. */
main { padding: 0 24px; }
.leaf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 7vw, 96px);
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(64px, 11vw, 140px) 0 clamp(56px, 9vw, 120px);
}
/* A plain bezel: a dark rim with a faint edge of light, no buttons or island. */
.device {
  flex: 0 0 auto;
  width: min(318px, 74vw);
  padding: 9px;
  border-radius: 46px;
  background: #0b0c17;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 30px 80px rgba(6, 7, 20, 0.55);
}
.phone {
  display: block;
  width: 100%;
  aspect-ratio: 640 / 1386;
  border-radius: 37px;
  object-fit: cover;
  background: var(--deep) url("/media/leaf.jpg?v=3") center / cover no-repeat;
}
.leaf .text { max-width: 26rem; }
.leaf h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
}
@media (max-width: 720px) {
  .leaf { flex-direction: column; text-align: center; }
}

/* Three short notes, each under a small line of light like the sit's. */
.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px);
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 clamp(72px, 10vw, 128px);
}
@media (max-width: 820px) {
  .points { grid-template-columns: minmax(0, 1fr); max-width: 30rem; }
}
.points h3 { font-size: 26px; line-height: 1.15; margin-bottom: 10px; }
.points p { color: var(--soft); }
.line {
  position: relative;
  display: block;
  width: 44px;
  height: 2px;
  margin-bottom: 22px;
  border-radius: 1px;
  background: linear-gradient(to right, rgba(168, 224, 204, 0.15), var(--mint));
}
.line::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f4fffa;
  box-shadow: 0 0 8px 3px rgba(168, 224, 204, 0.55);
}

/* The sound button, top right while the page scrolls: off until tapped (a page may not start sound by itself),
   then the chosen loop plays softly and its waves breathe in mint. sound.js shows it where it can play. */
.sound-toggle {
  position: fixed;
  z-index: 950;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px 9px 11px;
  font: 300 17px/1 var(--words);
  color: var(--soft);
  background: rgba(23, 25, 47, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.sound-toggle[hidden] { display: none; }
.sound-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.sound-toggle .speaker { fill: currentColor; fill-opacity: 0.15; }
.sound-toggle .wave { opacity: 0; transition: opacity 0.4s; }
.sound-toggle[aria-pressed="true"] { color: var(--mint); border-color: rgba(168, 224, 204, 0.35); }
.sound-toggle[aria-pressed="true"] .wave { opacity: 1; animation: wave-breath 3s ease-in-out infinite alternate; }
.sound-toggle[aria-pressed="true"] .wave.far { animation-delay: -1.5s; }
.sound-toggle.loading .wave { opacity: 0.4; animation: none; }
@keyframes wave-breath { from { opacity: 0.35; } to { opacity: 1; } }
@media (hover: hover) { .sound-toggle:hover { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .sound-toggle[aria-pressed="true"] .wave { animation: none; } }

/* Sit for a minute: the sit's timer on black, as the app shows it in the dark (QuietLine.swift): a thin line of
   mint light filling along a faint track, a soft point of light at its tip, breathing in for three seconds and out
   for three, and the time beneath. Faint marks show where the bells on the way ring; each sends out a ripple as
   it rings. sound.js plays it, and shows the section only where it can. */
.listen {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(8px, 3vw, 32px) 0 clamp(48px, 8vw, 96px);
  text-align: center;
}
.listen h2 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; margin-bottom: 10px; }
.listen .hint { color: var(--faint); font-size: 15px; margin-bottom: 28px; }
.sit {
  background: #000;
  border-radius: 28px;
  padding: clamp(64px, 10vw, 96px) 24px clamp(20px, 3vw, 28px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 60px rgba(6, 7, 20, 0.5);
}
.quiet { position: relative; width: min(100%, 320px); height: 40px; margin: 0 auto; --p: 0%; }
.quiet span { position: absolute; top: 50%; }
.quiet .track {
  left: 0; right: 0; height: 1px; margin-top: -0.5px;
  background: rgba(255, 255, 255, 0.12);
  animation: track-breath 3s ease-in-out infinite alternate;
}
.quiet .fill {
  left: 0; width: var(--p); height: 1.5px; margin-top: -0.75px;
  border-radius: 1px;
  background: rgba(168, 224, 204, 0.6);
  animation: fill-breath 3s ease-in-out infinite alternate;
}
.quiet .tip { left: var(--p); width: 0; height: 0; }
.quiet .tip::before, .quiet .tip::after { content: ""; position: absolute; border-radius: 50%; }
.quiet .tip::before {
  left: -20px; top: -20px; width: 40px; height: 40px;
  background: radial-gradient(closest-side, rgba(168, 224, 204, 0.5), rgba(168, 224, 204, 0.3) 30%,
              rgba(168, 224, 204, 0.12) 62%, rgba(168, 224, 204, 0));
  animation: glow-breath 3s ease-in-out infinite alternate;
}
.quiet .tip::after {
  left: -2px; top: -2px; width: 4px; height: 4px;
  background: rgba(168, 224, 204, 0.95);
  animation: point-breath 3s ease-in-out infinite alternate;
}
.sit.resetting .fill { transition: width 0.9s ease-in-out; }
.sit.resetting .tip { transition: left 0.9s ease-in-out; }
@keyframes track-breath { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes fill-breath { from { transform: scaleY(1); } to { transform: scaleY(2); } }
@keyframes glow-breath { from { transform: scale(0.65); opacity: 0.55; } to { transform: scale(1.2); opacity: 1; } }
@keyframes point-breath { from { transform: scale(1); } to { transform: scale(1.4); } }
.quiet .mark { width: 0; height: 0; }
.quiet .mark::before {
  content: ""; position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}
.quiet .mark.end::before { display: none; }
.quiet .mark::after {
  content: ""; position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  opacity: 0; transform: scale(0.1);
}
.quiet .mark.rung::after { animation: ripple 3.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes ripple { 0% { opacity: 0; transform: scale(0.1); } 12% { opacity: 0.7; } 100% { opacity: 0; transform: scale(1.6); } }
.sit .time {
  margin-top: 14px;
  font: 300 21px/1 var(--words);
  color: rgba(255, 255, 255, 0.4);
}
/* Each figure centred in a cell of one width, as in the app, so the time doesn't shift as it ticks. */
.sit .time span { display: inline-block; width: 0.54em; text-align: center; }
.sit .time .colon { width: 0.3em; }
.sit .begin {
  margin-top: clamp(44px, 8vw, 72px);
  padding: 14px 32px;
  font: 300 22px/1 var(--words);
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  transition: opacity 0.3s, color 0.2s;
}
.sit .begin:focus-visible { color: var(--mint); }
@media (hover: hover) { .sit .begin:hover { color: var(--mint); } }   /* a phone keeps a tapped button's hover */
.sit.loading .begin { opacity: 0.45; }
.sounds { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; margin-top: 14px; }
.sounds button {
  position: relative;
  padding: 14px 10px 18px;
  font: 300 19px/1 var(--words);
  color: var(--faint);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s;
}
.sounds button:focus-visible { color: var(--soft); }
@media (hover: hover) { .sounds button:hover { color: var(--soft); } }
.sounds button[aria-pressed="true"] { color: var(--ink); }
.sounds button[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 6px 2px rgba(168, 224, 204, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .quiet .track, .quiet .fill, .quiet .tip::before, .quiet .tip::after { animation: none; }
}

/* The closing thought: two quiet lines on the night, with room around them. */
.close {
  font: 300 clamp(26px, 2.6vw, 36px)/1.35 var(--words);
  color: var(--soft);
  text-align: center;
  padding: clamp(24px, 5vw, 64px) 0 clamp(96px, 14vw, 200px);
}

.end {
  text-align: center;
  padding: clamp(32px, 6vw, 64px) 0 clamp(72px, 10vw, 120px);
}
.end .icon {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 32px rgba(6, 7, 20, 0.45);
}
.end .name { font-size: 30px; margin-bottom: 16px; }

footer {
  padding: 28px 24px 40px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-bottom: 12px; }
footer a, footer button { color: var(--soft); text-decoration: none; }
footer button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
footer button[hidden] { display: none; }
footer a:hover, footer button:hover { color: var(--ink); }

/* The opt-out bar of the implied consent model (consent.js). */
.implied-consent-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900;
  max-width: 720px; margin: 0 auto; padding: 14px 16px;
  background: rgba(23, 25, 47, 0.94); color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 20px;
  box-shadow: 0 12px 40px rgba(6, 7, 20, 0.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.implied-consent-banner[hidden] { display: none; }
.implied-consent-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.implied-consent-copy { flex: 1 1 260px; margin: 0; font-size: 15px; line-height: 1.45; color: var(--soft); }
.implied-consent-actions { display: flex; gap: 8px; }
.implied-consent-button {
  font: 600 15px/1.2 var(--plain); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1.5px solid rgba(238, 237, 247, 0.5);
}
.implied-consent-button.primary { background: var(--mint); color: var(--deep); border-color: var(--mint); }
#privacy-choice-status { display: block; margin-top: 8px; color: var(--ink); }

/* The privacy page: plain text on the night. */
.page { max-width: 40rem; margin: 0 auto; padding: 40px 24px 72px; }
.page .home { display: inline-block; margin-bottom: 56px; color: var(--ink); text-decoration: none; }
.page h1 { font-size: clamp(36px, 6vw, 52px); line-height: 1.1; margin-bottom: 10px; }
.page .updated { color: var(--faint); font-size: 14px; margin-bottom: 32px; }
.page .lede { font: 300 clamp(20px, 2.4vw, 23px)/1.45 var(--words); color: var(--ink); }
.page h2 { font-size: 26px; line-height: 1.2; margin: 44px 0 12px; }
.page p { color: var(--soft); margin-bottom: 14px; }
.page a { color: var(--mint); text-decoration: none; border-bottom: 1px solid rgba(168, 224, 204, 0.4); }
.page a.home { color: var(--ink); border-bottom: none; }
.facts { list-style: none; margin: 0; padding: 0; color: var(--soft); }
.facts li { margin-bottom: 6px; }
.facts strong { color: var(--ink); font-weight: 600; }

/* The 404 page. */
.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.lost h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; }
.lost a { color: var(--mint); text-decoration: none; border-bottom: 1px solid rgba(168, 224, 204, 0.4); }
