/* UIMU website. Night Glass system: values from design/tokens.json and docs/screens.md "Website".
   Layout: "narrow" (portrait art, no phone) is the default; "wide" (landscape art, phone on the right) is
   (min-width: 840px) and (orientation: landscape), (min-width: 1100px) — the same query the <picture> sources use. */

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("../assets/fonts/nunito-wght.woff2") format("woff2");
}

:root {
  --night: #0B1B33;
  --cream: #F7EBD8;
  --text-2: #D5DCE8;
  --text-3: #C3CCDA;
  --moon: #F6C887;
  --glass-fill: rgba(255, 255, 255, .07);
  --glass-edge: rgba(255, 255, 255, .14);
  --glass-top: rgba(255, 255, 255, .16);
  --soft-out: cubic-bezier(.22, .61, .36, 1);
  --fade: 1800ms;
  /* page gutter: 16 on phones, growing on tablets, 96 at 1440, content never wider than 2000 */
  --pad: clamp(16px, 4.2vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: Nunito, ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
/* One sentence (or one half of a headline): it moves to the next line whole, and only wraps inside itself
   when it is longer than the line, then into balanced lines. */
.s { display: inline-block; text-wrap: balance; }
.nowrap { white-space: nowrap; }
/* below the narrowest checked width (360) a kept-together phrase still moves to the next line whole, but breaks
   inside rather than run off the screen when it is longer than the line (larger text spacing, 400 % zoom:
   WCAG 1.4.10, 1.4.12) */
@media (max-width: 359.98px) { .nowrap { display: inline-block; white-space: normal; } }
ul { padding: 0; list-style: none; }
img { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }

:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

/* Skip link: the first keyboard stop, shown only while it has focus. <main> takes the focus it hands over
   (tabindex -1) without drawing a ring round the whole page. */
.skip-link {
  position: absolute;
  z-index: 30;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 22px;
  background: var(--night);
  color: var(--cream);
  font-size: 15px;
  text-decoration: none;
}
.skip-link:not(:focus) {
  width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
#main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-top);
}

.caps {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.site-header {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  right: 12px;
}
.nav {
  height: 52px;
  padding: 0 4px 0 20px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Logo lockup (design/logo/uimu-lockup-on-dark.svg, viewBox -110 -130 1147 400). The viewBox leaves room for the
   glow and the ripple: the U starts and the last u ends about 96 units (.24 of the height) inside the edges, and the
   wordmark's x-height (about 145 units) sits 13 units above the middle. --logo-h makes that x-height read as large
   as the cap height of the text mark it replaced; the margins put the U where the text began, the shift centres
   the x-height on the bar. The footer stays on one row at 390 px wide. */
.logo { display: block; width: auto; height: var(--logo-h); }
.nav__mark, .footer__mark { display: flex; flex: none; border-radius: 8px; }
.nav__mark .logo, .footer__mark .logo {
  margin: 0 calc(var(--logo-h) * -.24);
  translate: 0 calc(var(--logo-h) * .0325);
}
.nav__mark { --logo-h: 43px; }
.nav__links, .nav__modes { display: flex; align-items: center; gap: 2px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 300ms ease, color 300ms ease;
}
.nav__link:hover { background: rgba(255, 255, 255, .1); color: var(--cream); }
.nav__link:disabled:hover { background: transparent; }
/* selected scene: lighter fill and cream ink (driven by the root class so it is right before the script runs) */
.nav__mode { transition: background-color var(--fade) ease, color var(--fade) ease, box-shadow var(--fade) ease; }
/* the hairline ring gives the selected state 3:1 against the glass (WCAG 1.4.11); the fill alone is about 1.4:1 */
.nav__mode { box-shadow: inset 0 0 0 1px rgba(247, 235, 216, 0); }
:root:not(.is-focus) .nav__mode--sleep,
.is-focus .nav__mode--focus { background: rgba(255, 255, 255, .14); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(247, 235, 216, .5); }
.nav__extra { display: none; }

@media (min-width: 600px) {
  .nav__extra { display: inline-flex; }
}

/* ---------- Hero: geometry ----------
   The scene box is the art at its own aspect ratio, scaled to cover the hero and placed so that the
   moon (focal point fx, fy in image units) lands at (tx, ty) of the hero where the cover allows it.
   Everything drawn over the art (glow, shimmer, ripples, water, mist) is positioned in image units * --u. */

/* The hero is a column at least a screen tall that grows with its text when the text needs more room (200 % zoom,
   larger text spacing: WCAG 1.4.10, 1.4.12). The art sits on .hero__stage, a size container that always covers the
   hero, so the cover maths below is unchanged; the text's cqw units refer to the hero's width. */
.hero {
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  min-height: clamp(560px, calc(100vh - 72px), 1000px);
  min-height: clamp(560px, calc(100svh - 72px), 1000px);
  background: var(--night);
  /* narrow art: lake2 / dawn2, 472 x 844 units, moon at (165, 397) */
  --iw: 472; --ih: 844; --cw: 1.21;
  --fx: 165; --fy: 397; --tx: .318; --ty: .47;
  --ty-min: 340px; /* on short screens the moon still sits below the copy */
  --moon-x: 165; --moon-y: 397; --moon-r: 90;
  --sun-x: 235; --sun-y: 507; --sun-r: 90;
  --shim-x: 90; --shim-y: 560; --shim-w: 150; --shim-h: 150;
  --water-night: .66; --water-dawn: 1;
  --mist-y: 388; --mist-h: 260; --mist-o: .55;
}

.hero__stage { position: absolute; inset: 0; container-type: size; }

.scene {
  --u: max(calc(100cqw * var(--cw) / var(--iw)), calc(100cqh / var(--ih)));
  position: absolute;
  width: calc(var(--iw) * var(--u));
  height: calc(var(--ih) * var(--u));
  left: clamp(calc(100cqw - var(--iw) * var(--u)), calc(100cqw * var(--tx) - var(--fx) * var(--u)), 0px);
  top: clamp(calc(100cqh - var(--ih) * var(--u)), calc(max(100cqh * var(--ty), var(--ty-min)) - var(--fy) * var(--u)), 0px);
  transform-origin: calc(var(--fx) * var(--u)) calc(var(--fy) * var(--u));
  animation: slow-scale 50s ease-in-out infinite alternate;
}

.fx-defs { position: absolute; width: 0; height: 0; }

.layer {
  position: absolute;
  inset: 0;
  background: var(--lqip) center / cover no-repeat;
}
.layer__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.layer--night { --lqip: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAQTGF2YzYyLjI4LjEwMgD/2wBDAAgKCgsKCw0NDQ0NDRAPEBAQEBAQEBAQEBASEhIVFRUSEhIQEBISFBQVFRcXFxUVFRUXFxkZGR4eHBwjIyQrKzP/xABnAAEBAQEBAAAAAAAAAAAAAAAFAAIDBwEBAQEBAAAAAAAAAAAAAAAAAQUAAhABAAEBBgYDAQAAAAAAAAAAAQACERITMZEDBCEU0VFSgnGBQREBAQEBAQAAAAAAAAAAAAAAACERkQH/wAARCAAgABIDASIAAhEAAxEA/9oADAMBAAIRAxEAPwDya7K5HqOA3NxbpbYL+BaznVwt3ND7SU4nULdZXWNdMeadSXTHmnUjG31jax6myhrbBch5HNznY4irKqx+NjqQenfrpyU/kzis54TWOerq9pY56ur2guIyxGIx/9k="); visibility: visible; transition: visibility 0s; }
.layer--dawn {
  --lqip: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAQTGF2YzYyLjI4LjEwMgD/2wBDAAgKCgsKCw0NDQ0NDRAPEBAQEBAQEBAQEBASEhIVFRUSEhIQEBISFBQVFRcXFxUVFRUXFxkZGR4eHBwjIyQrKzP/xABrAAEAAwEBAQAAAAAAAAAAAAAHAAECAwQGAQADAQEAAAAAAAAAAAAAAAAAAQMFBBAAAgAEBQMFAQAAAAAAAAAAAQBhAlEVExQDBaExBIFiEhEiwUERAAMBAQAAAAAAAAAAAAAAAAACExIB/8AAEQgAIAASAwEiAAIRAAMRAP/aAAwDAQACEQMRAD8A+Yyho1lDRRDt3pcW+D0UUzcsH2VNGZU0UK3wZb4JTgZY9ku5AapmOrIZP5J7ennq9Z910fj6nTBiCf0Jhixc4sWUlK0YVLt29ZeW7t29ZeUqxYsxYqko6sf/2Q==");
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fade) ease, visibility 0s linear var(--fade);
}
/* dawn fades in over the night, so the scene never dips to dark half-way */
.is-focus .layer--dawn { opacity: 1; visibility: visible; transition: opacity var(--fade) ease, visibility 0s; }
.is-focus .layer--night { visibility: hidden; transition: visibility 0s linear var(--fade); }

/* Water: the lower part of the art again, drawn twice with two still displacements (#water-a, #water-b) and
   cross-faded. Each state is filtered once and then only its opacity changes, which the compositor does:
   an animated noise filter cost a full repaint of the strip on every frame. The image URL is copied in by site.js. */
.water {
  --w: var(--water-night);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(var(--w) * 100%);
}
.layer--dawn .water { --w: var(--water-dawn); }
.water__state {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: opacity;
}
.water__state--a { filter: url("#water-a"); }
.water__state--b {
  filter: url("#water-b");
  opacity: .5; /* the still value under Reduce Motion: half-way between the two */
  animation: water-swap 6s ease-in-out infinite alternate;
}
.water__state::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% / (1 - var(--w)));
  background: var(--water-img, none) center / cover no-repeat;
}

.fx-glow {
  position: absolute;
  left: calc((var(--moon-x) - var(--moon-r)) * var(--u));
  top: calc((var(--moon-y) - var(--moon-r)) * var(--u));
  width: calc(2 * var(--moon-r) * var(--u));
  height: calc(2 * var(--moon-r) * var(--u));
}
.fx-glow--sun {
  left: calc((var(--sun-x) - var(--sun-r)) * var(--u));
  top: calc((var(--sun-y) - var(--sun-r)) * var(--u));
  width: calc(2 * var(--sun-r) * var(--u));
  height: calc(2 * var(--sun-r) * var(--u));
}
.fx-glow__light {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 200, 135, .5), rgba(246, 200, 135, 0) 66%);
  opacity: .5; /* the still value under Reduce Motion: mid-breath */
  animation: breath 10s ease-in-out infinite;
}
.fx-glow--sun .fx-glow__light { background: radial-gradient(circle, rgba(255, 240, 214, .55), rgba(255, 240, 214, 0) 64%); }

.fx-shimmer {
  position: absolute;
  left: calc(var(--shim-x) * var(--u));
  top: calc(var(--shim-y) * var(--u));
  width: calc(var(--shim-w) * var(--u));
  height: calc(var(--shim-h) * var(--u));
  overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 68%);
}
.fx-shimmer__lines {
  position: absolute;
  left: 0;
  right: 0;
  top: -44px;
  bottom: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(246, 200, 135, 0) 0px, rgba(246, 200, 135, .34) 3px, rgba(246, 200, 135, 0) 7px, rgba(246, 200, 135, 0) 22px);
  animation: shimmer 7s linear infinite;
}

.fx-sky { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fx-sky--wide { display: none; }
.ripple {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ripple 10s linear infinite;
}
.star { opacity: .55; animation: twinkle 7s ease-in-out infinite; }

.mist {
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(var(--mist-y) * var(--u));
  height: calc(var(--mist-h) * var(--u));
  overflow: hidden;
  opacity: var(--mist-o);
  pointer-events: none;
}
.mist::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 100%;
  background: url("../assets/img/mist.png") repeat-x 0 0 / 50% 100%;
  background-image: image-set(url("../assets/img/mist.webp") type("image/webp"), url("../assets/img/mist.png") type("image/png"));
  animation: drift 150s linear infinite;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8, 14, 28, .62) 0%, rgba(8, 14, 28, .2) 34%, rgba(8, 14, 28, 0) 52%, rgba(11, 27, 51, .7) 82%, var(--night) 100%);
}
/* Dawn is brighter than night; a little more scrim behind the text keeps it above 4.5:1. */
.hero__scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(to bottom, rgba(8, 14, 28, .45) 0, rgba(8, 14, 28, .45) max(40%, 300px), rgba(8, 14, 28, 0) max(64%, 440px), rgba(8, 14, 28, .2) 82%, rgba(8, 14, 28, 0) 100%);
  /* never below the page colour where the hero meets the cards */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 96%);
  transition: opacity var(--fade) ease;
}
.is-focus .hero__scrim::after { opacity: 1; }

/* ---------- Hero: text and buttons ---------- */

.hero__text {
  position: relative;
  flex: 1 0 auto;
  padding: clamp(96px, 16cqw, 150px) max(24px, var(--pad)) 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero__title {
  display: block;
  font-weight: 300;
  font-size: clamp(40px, 11.8cqw, 76px);
  line-height: 1.04;
  letter-spacing: -.02em;
}
.hero__sub {
  max-width: 28em;
  font-size: clamp(16px, 4.1cqw, 21px);
  line-height: 1.5;
  color: var(--text-2);
}
/* Sleep / Focus text: the hidden version is display: none, so a screen reader reads one. The new one fades in
   while the scene cross-fades (nothing fades out: the cut happens at once, the art carries the change). */
.for-focus,
.is-focus .for-sleep { display: none; }
.is-focus .for-focus { display: revert; }
.hero .for-sleep, .hero .for-focus { animation: mode-in calc(var(--fade) * .5) ease both; }
.is-instant .hero .for-sleep, .is-instant .hero .for-focus { animation: none; }
@keyframes mode-in { from { opacity: 0; } to { opacity: 1; } }
.hero__eyebrow { font-size: 11px; }
.hero__mode, .hero__line { display: block; }
.hero__line { margin-top: 10px; }
/* the phone screen swaps with the scene: out in the first 40%, in during the rest */
.phone__text--focus,
.is-focus .phone__text--sleep {
  opacity: 0;
  visibility: hidden;
  transition: opacity calc(var(--fade) * .4) ease, visibility 0s linear calc(var(--fade) * .4);
}
.phone__text--sleep,
.is-focus .phone__text--focus {
  opacity: 1;
  visibility: visible;
  transition: opacity calc(var(--fade) * .6) ease calc(var(--fade) * .4), visibility 0s linear calc(var(--fade) * .4);
}

/* The moon button with its caption under it, and the pill centred on the button */
.hero__actions {
  --size: 72px;
  --pill-h: 52px;
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 480px;
}
.hero__actions .pill { margin-top: calc((var(--size) - var(--pill-h)) / 2); }
.listen { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.listen__label {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-3);
  white-space: nowrap;
}
.no-js .listen__label, .listen__label[hidden] { display: none; }
.hero__caps { margin-top: 4px; }

/* The one solid, glowing control. Moon amber in Sleep, dawn teal in Focus (the teal layer fades over the amber).
   It plays the sound sample: a play glyph, a pause glyph while the sample sounds, a slow pulse while it loads. */
.moon {
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--night);
  background: radial-gradient(circle at 35% 28%, #FBDDAE, #F6C887 55%, #E2AE6C);
  box-shadow: 0 0 44px rgba(246, 200, 135, .4), inset 0 1px 0 rgba(255, 255, 255, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--fade) ease, transform 400ms var(--soft-out);
}
.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 35% 28%, #CDECEC, #A9D9DA 55%, #86BFC1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
  opacity: 0;
  transition: opacity var(--fade) ease;
}
.is-focus .moon { box-shadow: 0 0 44px rgba(169, 217, 218, .34), inset 0 1px 0 rgba(255, 255, 255, .45); }
.is-focus .moon::before { opacity: 1; }
.moon svg { position: relative; width: 36%; height: 36%; }
.moon__pause, .moon[aria-pressed="true"] .moon__play { display: none; }
.moon[aria-pressed="true"] .moon__pause { display: block; }
.moon.is-loading svg { animation: sample-wait 1.4s ease-in-out infinite; }
.moon:not(:disabled):hover { transform: scale(1.05); }
.moon:focus-visible { outline-offset: 5px; }
@keyframes sample-wait { 50% { opacity: .3; } }

.pill {
  flex: 1;
  height: var(--pill-h, 52px);
  padding: 0 30px;
  border-radius: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  transition: background-color 300ms ease;
}
.pill:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Hero: the phone (wide only) ---------- */

.phone-slot { display: none; }

/* ---------- Wide layout ---------- */

@media (min-width: 840px) and (orientation: landscape), (min-width: 1100px) {
  :root { --pad: max(clamp(32px, 6.67vw, 160px), calc(50vw - 1000px)); }

  .site-header {
    top: clamp(14px, 1.95vw, 32px);
    left: max(12px, calc(var(--pad) - 48px));
    right: max(12px, calc(var(--pad) - 48px));
  }
  .nav { height: 60px; padding: 0 12px 0 28px; border-radius: 30px; }
  .nav__mark { --logo-h: 51px; }
  .nav__links { gap: 4px; }
  .nav__modes { gap: 4px; }
  .nav__link { padding: 0 16px; font-size: 16px; }
  .nav__extra { display: inline-flex; }

  .hero {
    min-height: clamp(600px, 100vh, 62.5vw);
    min-height: clamp(600px, 100svh, 62.5vw);
    /* landscape art: lake-wide / dawn-wide, 1600 x 900 units, moon at (1054, 278) */
    --iw: 1600; --ih: 900; --cw: 1;
    --fx: 1054; --fy: 278; --tx: .624; --ty: .311; --ty-min: 0px;
    --moon-x: 1055; --moon-y: 280; --moon-r: 300;
    --sun-x: 927; --sun-y: 587; --sun-r: 300;
    --shim-x: 925; --shim-y: 566; --shim-w: 260; --shim-h: 230;
    --water-night: .626; --water-dawn: .72;
    --mist-y: 400; --mist-h: 340; --mist-o: .5;
  }
  .layer--night { --lqip: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAQTGF2YzYyLjI4LjEwMgD/2wBDAAgKCgsKCw0NDQ0NDRAPEBAQEBAQEBAQEBASEhIVFRUSEhIQEBISFBQVFRcXFxUVFRUXFxkZGR4eHBwjIyQrKzP/xABpAAEAAwEBAAAAAAAAAAAAAAAAAwEEBwUBAQEBAQAAAAAAAAAAAAAAAAEABQIQAAIBAwEGBwEAAAAAAAAAAAECABEhQQQDsRKR0RMFMUJxoWFRUhEBAQEBAAAAAAAAAAAAAAAAAAFB0f/AABEIABIAIAMBIgACEQADEQD/2gAMAwEAAhEDEQA/AOYjTscGSjSOcR3UOBzPWWNps/5HNus1Gc0J4eWVm40FKWqatfFARb7IkR0lMj53+U17N9P23JZlYU4AC1De/qkLaqv43vfeZzN4bjxoiIlcREk//9k="); }
  .layer--dawn { --lqip: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD//gAQTGF2YzYyLjI4LjEwMgD/2wBDAAgKCgsKCw0NDQ0NDRAPEBAQEBAQEBAQEBASEhIVFRUSEhIQEBISFBQVFRcXFxUVFRUXFxkZGR4eHBwjIyQrKzP/xABvAAACAwEBAAAAAAAAAAAAAAABBQIEAAMGAQEBAQEAAAAAAAAAAAAAAAAEAQIAEAABBAEDAgcBAAAAAAAAAAABAAIRUQMxEgUUQaGRYYEEEyFTEQADAAICAwEAAAAAAAAAAAABAAIRQjFB8KGBYf/AABEIABIAIAMBIgACEQADEQD/2gAMAwEAAhEDEQA/AL5+CaUeiNLkzPja/eHvnWYEm+6djlcH8/ELJNjrKYCDycefip6I0h0ZpPX8lga1p+rUTq09/RUXcrj3AgANjSB++8qCrOvsOqiBtn4XwkmyhuNlZBJTJ3Gz5oSbKyiuY//Z"); }
  .fx-sky--wide { display: block; }
  .fx-sky--tall { display: none; }
  .mist::before { width: 225%; }

  /* The side scrim follows the text block (--tw = the wider of headline and copy), not the hero width,
     so the text keeps it when the window narrows. At 1440 the stops land where the prototype has them (36%, 62%). */
  .hero__scrim {
    --tw: max(calc(6.4 * clamp(56px, 6.11vw, 112px)), calc(24 * clamp(17px, 1.46vw, 24px)));
    background:
      linear-gradient(90deg, rgba(11, 27, 51, .8) 0, rgba(11, 27, 51, .46) calc(var(--pad) + .75 * var(--tw)), rgba(11, 27, 51, 0) calc(var(--pad) + var(--tw) + 234px)),
      linear-gradient(to bottom, rgba(8, 14, 28, .5) 0%, rgba(8, 14, 28, 0) 22%, rgba(11, 27, 51, 0) 74%, var(--night) 100%);
  }
  .hero__scrim::after {
    background: linear-gradient(90deg, rgba(8, 14, 28, .4) 0, rgba(8, 14, 28, .3) calc(var(--pad) + .8 * var(--tw)), rgba(8, 14, 28, 0) calc(var(--pad) + var(--tw) + 200px));
  }

  /* centred in the hero; the equal top and bottom padding (the navigation's height and 12 px) only shows when the
     text is taller than the room, and then keeps it clear of the navigation */
  .hero__text {
    --clear: calc(clamp(14px, 1.95vw, 32px) + 72px);
    width: calc(var(--pad) + clamp(440px, 46vw, 760px));
    padding: var(--clear) 0 var(--clear) var(--pad);
    justify-content: center;
    gap: clamp(18px, 1.8vw, 30px);
  }
  .hero__title { font-size: clamp(56px, 6.11vw, 112px); line-height: 1.02; }
  .hero__sub { max-width: 24em; font-size: clamp(17px, 1.46vw, 24px); }
  .hero__actions { --size: clamp(64px, 5.56vw, 96px); --pill-h: clamp(48px, 3.9vw, 64px); margin-top: 10px; gap: 18px; }
  .listen { gap: 8px; }
  .listen__label { font-size: 14px; line-height: 20px; }
  .hero__caps { margin-top: 0; font-size: 12px; letter-spacing: .22em; }
  .hero__eyebrow { font-size: 12px; letter-spacing: .22em; }
  .moon { box-shadow: 0 0 54px rgba(246, 200, 135, .4), inset 0 1px 0 rgba(255, 255, 255, .45); }
  .is-focus .moon { box-shadow: 0 0 54px rgba(169, 217, 218, .34), inset 0 1px 0 rgba(255, 255, 255, .45); }
  .pill {
    flex: none;
    padding: 0 clamp(24px, 2.08vw, 36px);
    border-radius: 999px;
    font-size: clamp(16px, 1.25vw, 20px);
  }

  /* a layer over the whole hero (a size container, so the phone keeps sizing itself by the hero's height) */
  .phone-slot {
    display: block;
    position: absolute;
    inset: 0;
    container-type: size;
    pointer-events: none;
  }
}

.phone {
  --ph: min(760px, clamp(400px, 68.2cqh, 46cqw));
  position: absolute;
  right: calc(var(--pad) + 3.75cqw);
  top: calc(50% - var(--ph) / 2);
  width: calc(var(--ph) * 286 / 614);
  height: var(--ph);
  border-radius: calc(var(--ph) * 50 / 614);
  background: #05080F;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .16), inset 0 0 0 2px rgba(255, 255, 255, .06);
  animation: floaty 9s ease-in-out infinite;
}
.phone__screen {
  position: absolute;
  inset: calc(var(--ph) * 9 / 614);
  border-radius: calc(var(--ph) * 42 / 614);
  overflow: hidden;
  background: var(--night);
  isolation: isolate;
}
.phone__screen svg,
.phone__layer,
.phone__layer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.phone__layer img { object-fit: cover; }
.phone__layer--focus { opacity: 0; visibility: hidden; transition: opacity var(--fade) ease, visibility 0s linear var(--fade); }
.is-focus .phone__layer--focus { opacity: 1; visibility: visible; transition: opacity var(--fade) ease, visibility 0s; }
.phone__mist {
  position: absolute;
  left: 0;
  right: 0;
  top: 20.85%;
  height: 46.2%;
  overflow: hidden;
  opacity: .6;
}
.phone__mist::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 726%;
  height: 100%;
  background: url("../assets/img/mist.png") repeat-x 0 0 / 50% 100%;
  background-image: image-set(url("../assets/img/mist.webp") type("image/webp"), url("../assets/img/mist.png") type("image/png"));
  animation: drift 110s linear infinite;
}
.p-glow { opacity: .44; animation: glow-soft 10s ease-in-out infinite; }
.p-glass { fill: #fff; fill-opacity: .07; stroke: #fff; stroke-opacity: .14; }
.p-caps { font-size: 11px; letter-spacing: 1.98px; fill: var(--text-3); }
.p-caps--light { fill: var(--text-2); }
.p-time { font-size: 28px; font-weight: 300; letter-spacing: -.28px; fill: var(--cream); }
.p-now { font-size: 15px; fill: var(--cream); }
.p-btn { font-size: 14px; font-weight: 500; fill: var(--cream); }

/* ---------- Three cards ---------- */

.features {
  padding: 8px var(--pad) 0;
  scroll-margin-top: 24px;
}
.features__title { font-weight: 400; margin: 0 4px 18px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card {
  border-radius: 24px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 500ms var(--soft-out), background-color 400ms ease;
}
.card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .1); }
.card__icon { flex: none; width: 34px; height: 34px; color: var(--moon); }
.card__text { display: flex; flex-direction: column; gap: 4px; }
.card__title { font-size: 17px; font-weight: 500; line-height: 1.3; }
.card__text p { font-size: 14px; line-height: 1.45; color: var(--text-3); }

/* three across from 900px (narrower columns break the lines too often); the icon sits above the text until a
   card is about 330px wide */
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .card { flex-direction: column; align-items: flex-start; padding: 22px; }
}
@media (min-width: 840px) and (orientation: landscape), (min-width: 1100px) {
  .features { padding-top: 12px; }
  .features__title { font-size: 12px; letter-spacing: .22em; margin: 0 6px 22px; }
  .card__title { font-size: 19px; }
  .card__text p { font-size: 15px; }
}
@media (min-width: 1180px) {
  .card { flex-direction: row; align-items: center; padding: 24px 26px; }
}

/* ---------- Sleep and Focus panels ---------- */

.modes { padding: 12px var(--pad) 0; }
.panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* The panel keeps its ratio but grows when its text needs more room (overflow: clip, unlike hidden, keeps the
   content-based minimum height of a box with an aspect ratio). The art is a 16:9 box that covers it. */
.panel {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 358 / 200;
  min-width: 0; /* grows taller, never wider: no width carried over from the height through the ratio */
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  overflow: hidden;
  overflow: clip;
  background: var(--night);
  isolation: isolate;
  transition: border-color var(--fade) ease;
}
/* selected: an edge of 3:1 against the page (WCAG 1.4.11) */
:root:not(.is-focus) .panel--sleep,
.is-focus .panel--focus { border-color: rgba(255, 255, 255, .45); }
.panel__art {
  position: absolute;
  height: max(100%, 56.25cqw);
  aspect-ratio: 16 / 9;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  transition: scale 2400ms var(--soft-out);
}
.panel__art img { width: 100%; height: 100%; object-fit: cover; }
.panel__glow {
  position: absolute;
  width: 42%;
  aspect-ratio: 1;
  left: calc(65.9% - 21%);
  top: calc(31% - 21% * 16 / 9);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 200, 135, .45), rgba(255, 240, 214, 0) 66%);
  opacity: .5;
  animation: breath 10s ease-in-out infinite;
}
.panel--focus .panel__glow {
  left: calc(57.9% - 21%);
  top: calc(65.2% - 21% * 16 / 9);
  background: radial-gradient(circle, rgba(255, 240, 214, .5), rgba(255, 240, 214, 0) 66%);
  animation-delay: -4s;
}
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  /* deeper than the prototype (.82 to 0 at 64%): the dawn horizon runs behind the title and needs it for 4.5:1 */
  background: linear-gradient(to top, rgba(8, 14, 28, .86) 0%, rgba(8, 14, 28, .58) 38%, rgba(8, 14, 28, 0) 74%);
  pointer-events: none;
}
.panel--focus::after { background: linear-gradient(to top, rgba(8, 14, 28, .9) 0%, rgba(8, 14, 28, .68) 40%, rgba(8, 14, 28, 0) 80%); }
/* not positioned, so the button's ::after below takes the whole panel as its box */
.panel__text {
  z-index: 1;
  margin: 0 16px clamp(18px, 4.6cqw, 34px) clamp(22px, 5.2cqw, 40px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.panel__title { font-size: clamp(34px, calc(14px + 7.5cqw), 72px); font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.panel__btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
/* the whole panel is the button's hit area */
.panel__btn::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 24px; }
.panel__btn:focus-visible { outline: none; }
.panel:has(.panel__btn:focus-visible) { outline: 2px solid var(--cream); outline-offset: 3px; }
.panel__line { font-size: clamp(14px, 2.6cqw, 17px); color: var(--text-2); }
.js .panel:hover .panel__art { scale: 1.05; }

@media (min-width: 600px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (min-width: 840px) and (orientation: landscape), (min-width: 1100px) {
  .modes { padding-top: 20px; }
  .panel { aspect-ratio: 614 / 310; border-radius: 28px; }
  .panel__btn::after { border-radius: 28px; }
}

/* ---------- New sections: shape of a session, harmony, research, closing call ---------- */

.sec { padding: clamp(72px, 10vw, 150px) var(--pad) 0; scroll-margin-top: 24px; }
.sec--cta { padding-bottom: clamp(24px, 4vw, 56px); }
.sec__inner { max-width: 1400px; margin: 0 auto; }
.eyebrow { margin-bottom: 14px; }
.sec__title {
  font-size: clamp(30px, 4.2vw, 56px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 17em;
}
.sec__lede { margin-top: 22px; max-width: 34em; font-size: clamp(16px, 1.45vw, 19px); line-height: 1.6; color: var(--text-2); }

/* a plate holds a chart: the glass look without a blur (it is a large area) */
.plate {
  margin: 0;
  padding: 14px 14px 18px;
  border-radius: 24px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-top);
}
.plate__cap { margin: 14px 4px 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.cq { container-type: inline-size; }
.chart { display: none; width: 100%; height: auto; overflow: visible; }
.chart.v-a { display: block; }
@container (min-width: 380px) { .chart.v-a { display: none; } .chart.v-b { display: block; } }
@container (min-width: 560px) { .chart.v-b { display: none; } .chart.v-c { display: block; } }

/* chart ink: thin cream and blue-grey lines; the moon colour only for the small dots */
.chart text { font-family: inherit; }
.chart .ink { fill: var(--text-2); }
.chart .ink2 { fill: var(--text-3); }
.chart .axis { stroke: rgba(247, 235, 216, .38); stroke-width: 1; }
.chart .rule { stroke: rgba(213, 220, 232, .2); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .tint { fill: rgba(255, 255, 255, .035); }
.chart .bed { stroke: rgba(247, 235, 216, .6); stroke-width: 1.2; stroke-dasharray: 5 5; }
.chart path.l1, .chart path.l2, .chart path.l3, .chart path.l4,
.chart path.t1, .chart path.t2, .chart path.t3, .chart path.t4 { stroke: var(--night); stroke-width: 1.6; stroke-linejoin: round; }
:root {
  --l1: #4C6A99; --l2: #7F9AC2; --l3: #AEBFD9; --l4: #F7EBD8;
  --t1: #3E7A86; --t2: #6EA5AD; --t3: #8FBCC0; --t4: #CBE5E1;
}
.l1 { fill: var(--l1); } .l2 { fill: var(--l2); } .l3 { fill: var(--l3); } .l4 { fill: var(--l4); }
.t1 { fill: var(--t1); } .t2 { fill: var(--t2); } .t3 { fill: var(--t3); } .t4 { fill: var(--t4); }
.chart .bl { font-weight: 600; fill: var(--night); letter-spacing: .01em; }
.chart .bl1 { fill: var(--cream); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 4px 0; font-size: 13px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw.l1 { background: var(--l1); fill: none; } .sw.l2 { background: var(--l2); } .sw.l3 { background: var(--l3); } .sw.l4 { background: var(--l4); }
.sw { display: block; width: 14px; height: 14px; border-radius: 4px; }

/* Shape */
.shape { display: grid; gap: 28px; }
.shape__steps { display: block; }
.steps { display: grid; gap: 0; list-style: none; padding: 0; margin: 0; }
.steps li { padding: 20px 0 22px; border-top: 1px solid rgba(255, 255, 255, .14); }
.step__title { font-size: 12px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--moon); margin-bottom: 8px; }
.step__text { font-size: 16px; line-height: 1.55; color: var(--text-2); max-width: 26em; }
.shape__plate { max-width: 780px; }

@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .steps li { padding-bottom: 6px; }
}
@media (min-width: 1000px) {
  .shape { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 88px); row-gap: 36px; align-items: start; }
  .shape__head { grid-column: 1 / -1; }
  .shape__plate { max-width: none; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { padding: 22px 0 24px; }
  .steps li:first-child { padding-top: 22px; }
}

/* Harmony */
.harmony { display: grid; gap: 36px; }
.harmony__plate { max-width: 860px; }
.rules { display: grid; gap: 0; }
.rules li { padding: 18px 0 20px; border-top: 1px solid rgba(255, 255, 255, .14); }
.rule__lead { font-size: 17px; font-weight: 600; color: var(--cream); margin-bottom: 4px; }
.rule__text { font-size: 15px; line-height: 1.55; color: var(--text-3); }
@media (min-width: 640px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; column-gap: clamp(32px, 5vw, 80px); }
}
@media (min-width: 1000px) {
  .harmony { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: clamp(40px, 5vw, 88px); row-gap: clamp(48px, 5vw, 72px); align-items: center; }
  .harmony__plate { max-width: none; }
  .rules { grid-column: 1 / -1; }
  .rule__lead { font-size: 18px; }
  .rule__text { font-size: 16px; }
}

/* chart 2 */
.chart .line { fill: none; stroke: var(--cream); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.chart .fill .g0, .chart stop.g0 { stop-color: #C9D6EA; stop-opacity: .3; }
.chart stop.g1 { stop-color: #C9D6EA; stop-opacity: 0; }
.chart .drop { stroke: rgba(247, 235, 216, .2); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .dip { fill: var(--moon); stroke: var(--night); stroke-width: 2; }
.chart .avoid { fill: #8C99B1; stroke: var(--night); stroke-width: 2; }
/* one calm draw-in when the chart scrolls into view; without script, or under Reduce Motion, it is simply there */
.js [data-draw] .line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js [data-draw] .fill, .js [data-draw] .after { opacity: 0; }
.js [data-draw].is-in .line { stroke-dashoffset: 0; transition: stroke-dashoffset 2600ms cubic-bezier(.45, .05, .25, 1); }
.js [data-draw].is-in .fill, .js [data-draw].is-in .after { opacity: 1; transition: opacity 1400ms ease 1600ms; }
.js [data-draw].is-in .fill { transition-delay: 800ms; }

/* Research */
.findings { margin-top: clamp(32px, 4vw, 56px); display: grid; }
.finding { padding: 26px 0 28px; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; gap: 14px; }
.finding:last-child { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.finding__said { font-size: clamp(20px, 2.1vw, 28px); font-weight: 300; line-height: 1.3; letter-spacing: -.01em; max-width: 22em; }
.finding__did { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.5; color: var(--text-2); }
.finding__did .s { max-width: 24em; }
.so { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--text-3); }
.research__note { margin-top: 26px; max-width: 36em; font-size: 15px; color: var(--text-3); }
@media (min-width: 900px) {
  .finding { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(40px, 6vw, 110px); align-items: baseline; padding: 32px 0 34px; }
  .finding__did { font-size: 17px; }
  .so { margin-top: 3px; }
  .research__note { font-size: 16px; }
}

/* Closing call */
.cta {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 110px) 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-radius: 32px;
  background: radial-gradient(ellipse 60% 70% at 50% 100%, rgba(246, 200, 135, .13), rgba(246, 200, 135, 0) 70%);
}
.cta__title { max-width: none; font-size: clamp(36px, 5.4vw, 76px); }
.cta__line { font-size: clamp(16px, 1.6vw, 21px); color: var(--text-2); }
.pill--cta { flex: none; margin-top: 14px; padding: 0 clamp(28px, 3vw, 44px); height: 52px; font-size: 17px; }
@media (min-width: 840px) { .pill--cta { height: 60px; font-size: 19px; } }

/* ---------- Name line and footer ---------- */

/* the lockup alone; its content is centred in its viewBox, the padding allows for the room around the glow and ripple */
.nameline {
  --logo-h: 80px;
  padding: 30px var(--pad) 18px;
  display: flex;
  justify-content: center;
}

.footer {
  margin: 0 var(--pad);
  padding: 14px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 14px;
  color: var(--text-3);
}
.footer__mark { --logo-h: 35px; }
.footer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-right: -12px; }
.footer__links .nav__link { padding: 0 12px; font-size: 14px; color: var(--text-3); }
.footer__links .nav__link:hover { color: var(--cream); }
.footer__by { padding: 0 12px; line-height: 44px; }
.footer__by a { position: relative; color: var(--cream); text-decoration: none; border-bottom: 1px solid rgba(247, 235, 216, .35); }
.footer__by a:hover { border-bottom-color: var(--cream); }
/* a 44 px tall hit area round the short inline link, drawn nowhere */
.footer__by a::after { content: ""; position: absolute; inset: -12px -6px; }

/* Pause motion: the logo takes the free space, so the links and the switch sit at the right; on a phone the switch
   wraps onto its own line under them, its word lined up with the logo. */
.footer__mark { margin-right: auto; }
.footer__motion {
  position: relative;
  padding: 0 12px;
  margin-left: -12px;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 300ms ease, color 300ms ease, box-shadow 300ms ease;
}
.footer__motion:hover { color: var(--cream); }
.footer__motion:has(:checked) { background: rgba(255, 255, 255, .14); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(247, 235, 216, .5); }
.footer__motion:has(:focus-visible) { outline: 2px solid var(--cream); outline-offset: 3px; }

@media (min-width: 840px) and (orientation: landscape), (min-width: 1100px) {
  .nameline { --logo-h: 110px; padding: 44px var(--pad) 32px; }
  .footer { padding: 22px 0 34px; font-size: 15px; }
  .footer__mark { --logo-h: 43px; }
  .footer__links .nav__link { font-size: 15px; padding: 0 16px; }
  .footer__by { padding-left: 16px; }
  .footer__motion { font-size: 15px; padding: 0 16px; margin-left: 0; }
}

/* ---------- Privacy page ---------- */

.page {
  background:
    radial-gradient(520px 520px at 84% -60px, rgba(246, 200, 135, .16), rgba(246, 200, 135, 0) 70%),
    linear-gradient(to bottom, #13294A 0, var(--night) 560px);
  background-repeat: no-repeat;
}
.nav__link[aria-current="page"] { background: rgba(255, 255, 255, .14); color: var(--cream); }
.footer__links .nav__link[aria-current="page"] { background: none; color: var(--cream); }
.doc {
  max-width: calc(720px + 2 * var(--pad));
  margin: 0 auto;
  padding: 120px var(--pad) 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.doc__title { font-size: clamp(44px, 9vw, 64px); font-weight: 300; line-height: 1.05; letter-spacing: -.02em; }
.doc__lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--text-2); margin-bottom: 18px; }
.doc__card { border-radius: 24px; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.doc__card h2 { font-size: 19px; font-weight: 500; color: var(--cream); }
.doc__card ul { display: flex; flex-direction: column; gap: 10px; }
.doc__card strong { font-weight: 600; color: var(--cream); }
.doc__card a { color: var(--cream); text-decoration-color: rgba(247, 235, 216, .4); text-underline-offset: 3px; }
.doc__updated { margin-top: 6px; color: var(--text-2); }
.page .footer { margin-top: 24px; }
@media (min-width: 840px) and (orientation: landscape), (min-width: 1100px) {
  .doc { padding-top: 160px; }
  .page .footer { margin-left: var(--pad); margin-right: var(--pad); }
}

/* ---------- Entrance and ambient motion (docs/screens.md, Website) ---------- */

.rise { animation: rise 1400ms var(--soft-out) both; }
.rise--1 { animation-delay: 100ms; }
.rise--2 { animation-delay: 200ms; }
.rise--3 { animation-delay: 450ms; }
.rise--4 { animation-delay: 600ms; }
.rise--5 { animation-delay: 700ms; }
.rise--6 { animation-delay: 900ms; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slow-scale { from { transform: scale(1); } to { transform: scale(1.045); } }
@keyframes breath { 0%, 100% { opacity: .3; transform: scale(1); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes glow-soft { 0%, 100% { opacity: .28; } 50% { opacity: .6; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes ripple { from { transform: scale(.12); opacity: .5; } to { transform: scale(1.4); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: .9; } }
@keyframes water-swap { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { transform: translateY(0); } to { transform: translateY(44px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* off-screen hero: ambient loops wait (site.js also pauses the water filter) */
.hero.is-idle *, .hero.is-idle *::before, .hero.is-idle *::after { animation-play-state: paused; }

/* #focus on load: start in Focus without a cross-fade */
.is-instant *, .is-instant *::before, .is-instant *::after { transition: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --fade: 300ms; }
  *, *::before, *::after { animation: none !important; }
  .water { display: none; }
  .moon:not(:disabled):hover, .card:hover { transform: none; }
  .moon.is-loading svg { opacity: .5; }
  .card { transition: background-color 400ms ease; }
  .js .panel:hover .panel__art { scale: none; }
  .js [data-draw] .line { stroke-dashoffset: 0; transition: none; }
  .js [data-draw] .fill, .js [data-draw] .after { opacity: 1; transition: none; }
  .footer__motion { display: none; } /* nothing left to pause */
}

/* "Pause motion" in the footer: the same still page as Reduce Motion (keep the two blocks in step) */
:root:has(#motion-still:checked) { --fade: 300ms; scroll-behavior: auto; }
:root:has(#motion-still:checked) *, :root:has(#motion-still:checked) *::before, :root:has(#motion-still:checked) *::after { animation: none !important; }
:root:has(#motion-still:checked) .water { display: none; }
:root:has(#motion-still:checked) .moon:not(:disabled):hover, :root:has(#motion-still:checked) .card:hover { transform: none; }
:root:has(#motion-still:checked) .moon.is-loading svg { opacity: .5; }
:root:has(#motion-still:checked) .card { transition: background-color 400ms ease; }
.js:has(#motion-still:checked) .panel:hover .panel__art { scale: none; }
.js:has(#motion-still:checked) [data-draw] .line { stroke-dashoffset: 0; transition: none; }
.js:has(#motion-still:checked) [data-draw] .fill, .js:has(#motion-still:checked) [data-draw] .after { opacity: 1; transition: none; }

/* Reduce Transparency: the glass becomes a near-solid tint with the same edge (docs/screens.md). */
@media (prefers-reduced-transparency: reduce) {
  .glass, .plate { background: rgba(26, 43, 69, .92); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Increase Contrast: solid glass with a clear edge, and the secondary text lighter. */
@media (prefers-contrast: more) {
  :root { --text-2: #E9EDF3; --text-3: #DDE3EC; --glass-edge: rgba(255, 255, 255, .5); }
  .glass, .plate { background: #1A2B45; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .skip-link { border-color: var(--cream); }
}

@media (forced-colors: active) {
  .moon, .moon::before { forced-color-adjust: none; }
  /* backgrounds are replaced in this mode, so the selected states also get an underline */
  :root:not(.is-focus) .nav__mode--sleep, .is-focus .nav__mode--focus,
  .panel__btn[aria-pressed="true"], .footer__motion:has(:checked) { text-decoration: underline; text-underline-offset: 5px; }
}
