/* SOMA's website. Spacing, motion and the head's blink come from the app's design tokens
 * (tokens.css, copied from web/src/ui by build.mjs). Colours, type and corners follow the
 * desktop-first design (greys, one brass accent, Inter, small corners) that the app has not
 * taken yet; once its tokens carry that look, these --w-* values come from there instead. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

/* The brand's face: the wordmark and the big titles (one weight) */
@font-face {
  font-family: "Belleza";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/belleza-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Belleza";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/belleza-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Light greys: the page, and the pictures' light walls in either theme */
:root,
.paper {
  --w-page: #ffffff;
  --w-chrome: #f7f7f6;
  --w-hover: #efefee;
  --w-line: #e6e6e4;
  --w-line-strong: #d4d4d1;
  --w-text: #1f1f1e;
  --w-muted: #6b6b69;
  --w-faint: #9b9b98;
  --w-accent: #6b573d;
  --w-accent-hover: #584832;
  --w-accent-soft: #f2ede5;
  --w-on-accent: #ffffff;
  --w-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --w-font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-brand: "Belleza", "Inter", "Segoe UI", system-ui, sans-serif;
  --w-display: var(--font-brand);
  --w-radius: 8px;
  --w-radius-sm: 6px;
  /* The pictures' own paper and the blue of their night */
  --w-band: transparent;
  --night-bg: #2c3854;
}

@media (prefers-color-scheme: dark) {
  :root {
    --w-page: #191919;
    --w-chrome: #202020;
    --w-hover: #2a2a2a;
    --w-line: #2f2f2f;
    --w-line-strong: #3d3d3b;
    --w-text: #ececeb;
    --w-muted: #a5a5a2;
    --w-faint: #727270;
    --w-accent: #d0b992;
    --w-accent-hover: #ddcaa8;
    --w-accent-soft: #2e2a23;
    --w-on-accent: #1b1916;
    --w-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --w-band: #fdf8ec;
  }
}

/* The pictures are light in either theme, so what lies on them keeps the light greys
 * (repeated after the dark block so it wins there too) */
.paper {
  --w-page: #ffffff;
  --w-chrome: #f7f7f6;
  --w-hover: #efefee;
  --w-line: #e6e6e4;
  --w-line-strong: #d4d4d1;
  --w-text: #1f1f1e;
  --w-muted: #5f5f5c;
  --w-accent: #6b573d;
  --w-accent-hover: #584832;
  --w-accent-soft: #f2ede5;
  --w-on-accent: #ffffff;
  color: var(--w-text);
}

/* ...and the night pictures keep the dark ones */
.dusk {
  --w-text: #ececeb;
  --w-muted: #c4c6cc;
  color: var(--w-text);
}

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

html {
  color-scheme: light dark;
}

/* The footer sits at the foot of the window however short the page */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--w-page);
  color: var(--w-text);
  font-family: var(--w-font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Every page fills at least the window: the footer always starts below it */
main {
  flex: 1;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 6rem;
}

main:has(> .story:first-child) {
  padding-top: 0;
}

a {
  color: inherit;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--w-accent);
  outline-offset: 2px;
  border-radius: var(--w-radius-sm);
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

/* Titles of 24 px and more are in the brand's face, which has one weight */
h1,
h2 {
  font-family: var(--w-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.25rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
}

/* Smaller headings stay in the text's face */
.card h2,
.prose h2,
.way h2,
.steps-head,
.foot-cols h2 {
  font-family: var(--w-font);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 var(--space-3);
}

.frame {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  background: var(--w-page);
  border-radius: var(--w-radius);
}

.skip:focus {
  top: var(--space-3);
}

/* One unit for the page's frame, bar and words: a pixel of a 1872-wide window, a little
 * smaller on smaller windows. The type scale: one size for every big title and sentence,
 * then the lead, the text, the small text and the labels. */
:root {
  --u: clamp(0.62px, 100vw / 1872, 1.2px);
  --inset: max(10px, calc(23 * var(--u)));
  --frame-radius: max(14px, calc(24 * var(--u)));
  --bar-fill: rgba(250, 247, 242, 0.8);
  /* The top bar's paper by day and by night: nine tenths, the page behind a little blurred */
  --bar-light: rgba(250, 247, 242, 0.9);
  --bar-dark: rgba(32, 32, 32, 0.9);
  /* Type grows straight from a 640 px window to a 1920 px one, then stays */
  --grow: calc((100vw - 640px) / 1280);
  --title: clamp(40px, 40px + 32 * var(--grow), 72px);
  --t-lead: clamp(16px, 16px + 4 * var(--grow), 20px);
  --t-head: clamp(17px, 17px + 5 * var(--grow), 22px);
  --t-text: clamp(15px, 15px + 3 * var(--grow), 18px);
  --t-small: clamp(13px, 13px + 2.5 * var(--grow), 15.5px);
  --t-label: clamp(12px, 12px + 1.5 * var(--grow), 13.5px);
}

/* Every big title and sentence: the brand's face, close-set */
.day-text h1,
.say p,
.held-screen p,
.panel h2,
.glow-words h2 {
  font-family: var(--w-display);
  font-size: var(--title);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

/* The wordmark: the name in the brand's face, in capitals, set wide */
.brand,
.foot-cta .foot-mark,
.foot-name b {
  font-family: var(--font-brand);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Top bar: the little head on the left, the links on the right, always there, a little in
 * from the frame's edge. The pills' inner corners follow the outer ones. */
.top {
  position: fixed;
  inset: calc(var(--inset) + 17 * var(--u)) calc(var(--inset) + 17 * var(--u)) auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  pointer-events: none;
}

.top > * {
  pointer-events: auto;
}

/* The bar keeps one size on every window, as a toolbar does */
.brand,
.links {
  display: flex;
  align-items: center;
  height: 53px;
  padding: 5px;
  border-radius: 15px;
  background: var(--bar-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #17190f;
  /* over the night it turns dark gently, never at once */
  transition:
    background-color 0.6s var(--ease-standard),
    color 0.6s var(--ease-standard);
}

/* The mark alone on its own square of the bar's paper */
.brand {
  justify-content: center;
  width: 53px;
  text-decoration: none;
}

/* The mark in Ink, the design system's own colours, the same by day and night */
.brand .mark {
  display: block;
  width: 43px;
  height: 43px;
}

.links {
  gap: 2px;
  height: 61px;
  padding: 6px;
  border-radius: 17px;
}

.links a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px 0 16px;
  border-radius: 11.5px;
  color: rgba(23, 25, 15, 0.62);
  font-size: 15.5px;
  font-weight: 450;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition:
    background-color 0.6s var(--ease-standard),
    color 0.6s var(--ease-standard);
}

.links a:hover,
.links a[aria-current="page"] {
  color: #17190f;
}

.links a.get {
  margin-left: 6px;
  padding: 0 20px;
  background: #6b573d;
  color: #ffffff;
  font-size: 15.5px;
  font-weight: 500;
}

.links a.get:hover {
  background: #584832;
  color: #ffffff;
}

/* On the home page the bar darkens with the evening's words: story.js sets --dusk (0 by
 * day, 1 once the words on the amber screen have turned black) as they turn, so the bar
 * follows the scroll exactly, with no lag of its own */
.top[style*="--dusk"] .brand,
.top[style*="--dusk"] .links {
  background: color-mix(in srgb, var(--bar-dark) calc(var(--dusk) * 100%), var(--bar-light));
  color: color-mix(in srgb, #ececeb calc(var(--dusk) * 100%), #17190f);
  transition: none;
}

.top[style*="--dusk"] .links a {
  color: color-mix(in srgb, rgba(236, 236, 235, 0.62) calc(var(--dusk) * 100%), rgba(23, 25, 15, 0.62));
  transition: none;
}

.top[style*="--dusk"] .links a:hover,
.top[style*="--dusk"] .links a[aria-current="page"] {
  color: color-mix(in srgb, #ececeb calc(var(--dusk) * 100%), #17190f);
}

.top[style*="--dusk"] .links a.get {
  background: color-mix(in srgb, #d0b992 calc(var(--dusk) * 100%), #6b573d);
  color: color-mix(in srgb, #1b1916 calc(var(--dusk) * 100%), #ffffff);
}

/* Over the night the pills turn dark, the same grey as on Download; in the dark theme
 * they are dark on a page with no story of light pictures (Download, Privacy, the page
 * that is not there) */
.top.night .brand,
.top.night .links {
  background: var(--bar-dark);
  color: #ececeb;
}

.top.night .links a {
  color: rgba(236, 236, 235, 0.62);
}

.top.night .links a:hover,
.top.night .links a[aria-current="page"] {
  color: #ececeb;
}

.top.night .links a.get {
  background: #d0b992;
  color: #1b1916;
}

.top.night .links a.get:hover {
  background: #ddcaa8;
  color: #1b1916;
}

@media (prefers-color-scheme: dark) {
  body:not(:has([data-story])) .top .brand,
  body:not(:has([data-story])) .top .links {
    background: var(--bar-dark);
    color: #ececeb;
  }

  body:not(:has([data-story])) .top .links a {
    color: rgba(236, 236, 235, 0.62);
  }

  body:not(:has([data-story])) .top .links a:hover,
  body:not(:has([data-story])) .top .links a[aria-current="page"] {
    color: #ececeb;
  }

  body:not(:has([data-story])) .top .links a.get {
    background: #d0b992;
    color: #1b1916;
  }

  body:not(:has([data-story])) .top .links a.get:hover {
    background: #ddcaa8;
    color: #1b1916;
  }
}

/* The menu on a narrow window. Its button sits beside Sign in: the three lines draw back
 * one after another and a cross draws itself in their place, then back again on close. */
.menu-button {
  display: none;
  place-items: center;
  width: 49px;
  height: 100%;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 11.5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-button svg {
  width: 24px;
  height: 24px;
  overflow: visible;
}

.menu-button rect {
  fill: currentColor;
  transform-box: fill-box;
  transition:
    transform 300ms cubic-bezier(0.2, 0, 0, 1),
    opacity 240ms var(--ease-standard);
}

/* Shut: the lines are there, coming back once the cross has gone, top one first */
.menu-button .line {
  transform-origin: left center;
}

.menu-button .line:nth-child(1) {
  transition-delay: 200ms;
}

.menu-button .line:nth-child(2) {
  transition-delay: 260ms;
}

.menu-button .line:nth-child(3) {
  transition-delay: 320ms;
}

.menu-button .cross {
  transform-origin: center;
  opacity: 0;
}

.menu-button .cross:nth-child(4) {
  transform: rotate(45deg) scaleX(0);
  transition-delay: 60ms;
}

.menu-button .cross:nth-child(5) {
  transform: rotate(-45deg) scaleX(0);
}

/* Open: the lines draw back from the bottom up, then the cross draws itself */
.top.open .menu-button .line {
  transform: scaleX(0);
  opacity: 0;
}

.top.open .menu-button .line:nth-child(3) {
  transition-delay: 0ms;
}

.top.open .menu-button .line:nth-child(2) {
  transition-delay: 60ms;
}

.top.open .menu-button .line:nth-child(1) {
  transition-delay: 120ms;
}

.top.open .menu-button .cross {
  opacity: 1;
}

.top.open .menu-button .cross:nth-child(4) {
  transform: rotate(45deg) scaleX(1);
  transition-delay: 220ms;
}

.top.open .menu-button .cross:nth-child(5) {
  transform: rotate(-45deg) scaleX(1);
  transition-delay: 300ms;
}

/* The pages over everything, on the bar's own paper: it fades in while coming the last
 * few steps from the left, and goes back the same way a little faster */
.menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  flex-direction: column;
  padding: calc(var(--inset) + 17 * var(--u) + 61px + 48px) calc(var(--inset) + 17 * var(--u) + 4px)
    calc(var(--inset) + 28px);
  background: var(--bar-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #17190f;
  opacity: 0;
  transform: translateX(-44px);
  visibility: hidden;
  transition:
    opacity 260ms var(--ease-standard),
    transform 260ms var(--ease-standard),
    visibility 0s linear 260ms;
}

.top.open .menu {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition:
    opacity 320ms cubic-bezier(0, 0, 0.2, 1),
    transform 380ms cubic-bezier(0.2, 0, 0, 1),
    visibility 0s;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-links a {
  position: relative;
  align-self: flex-start;
  padding: 4px 0;
  color: inherit;
  font-family: var(--w-display);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* The page you are on: a small brass dot just left of its name */
.menu-links a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -15px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #6b573d;
}

.menu-write {
  margin: 40px 0 0;
  color: rgba(23, 25, 15, 0.62);
  font-size: var(--t-small);
}

.menu-write a {
  color: #17190f;
}

.menu-foot {
  margin: auto 0 0;
  color: rgba(23, 25, 15, 0.5);
  font-size: var(--t-label);
}

/* While it is open the page behind stays where it is */
html.menu-open {
  overflow: hidden;
}

/* Open, the bar wears the menu's paper, whatever it lay over */
.top.open.open .brand,
.top.open.open .links {
  background: var(--bar-light);
  color: #17190f;
}

.top.open.open .links a.get {
  background: #6b573d;
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .menu {
    background: var(--bar-dark);
    color: #ececeb;
  }

  .menu-links a[aria-current="page"]::before {
    background: #d0b992;
  }

  .menu-write {
    color: rgba(236, 236, 235, 0.62);
  }

  .menu-write a {
    color: #ececeb;
  }

  .menu-foot {
    color: rgba(236, 236, 235, 0.5);
  }

  .top.open.open .brand,
  .top.open.open .links {
    background: var(--bar-dark);
    color: #ececeb;
  }

  .top.open.open .links a.get {
    background: #d0b992;
    color: #1b1916;
  }
}

@media (max-width: 52rem) {
  .menu-button {
    display: grid;
  }

  .menu {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .top.open .menu,
  .menu-button rect {
    transition-duration: 0s;
    transition-delay: 0s;
  }

  .menu {
    transform: none;
  }
}

/* Bands */
.band {
  padding-top: var(--space-6);
}

.narrow {
  max-width: calc(46rem + 2 * var(--gutter));
}

.center {
  text-align: center;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--w-muted);
  max-width: 36rem;
}

.small {
  font-size: 0.8125rem;
}

.muted {
  color: var(--w-muted);
}

/* Buttons: the text keeps its colour on hover */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-3);
}

.button {
  display: inline-flex;
  align-items: center;
  height: 2.75rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--w-line-strong);
  border-radius: var(--w-radius);
  background: var(--w-page);
  color: var(--w-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-quick) var(--ease-standard);
}

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

.button.primary {
  background: var(--w-accent);
  border-color: var(--w-accent);
  color: var(--w-on-accent);
}

.button.primary:hover {
  background: var(--w-accent-hover);
  border-color: var(--w-accent-hover);
  color: var(--w-on-accent);
}

/* Cards */
.card {
  padding: var(--space-5);
  background: var(--w-page);
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
}

.card h2 {
  font-size: 1.25rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.platform {
  margin-bottom: var(--space-4);
}

.soon {
  color: var(--w-accent);
  font-weight: 600;
}

/* Questions: answers that open in place, one at a time. answers.js grows and shrinks them
 * (every row below moves with it, in one motion) and marks one that is closing (.closing),
 * so its + turns back at once: half a circle with a little spring, its upright melting into
 * the bar on the way to −. Without the script they open at once */
.faq {
  --faq-ink: var(--w-faint);
  border-top: 1px solid var(--w-line);
  margin-top: var(--space-5);
}

.faq details {
  border-bottom: 1px solid var(--w-line);
  padding: var(--space-4) 0;
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

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

.faq summary::after {
  content: "";
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: auto;
  border-radius: 50%;
  background:
    linear-gradient(var(--faq-ink), var(--faq-ink)) center / 0.625rem 1.5px no-repeat,
    linear-gradient(var(--faq-ink), var(--faq-ink)) center / 1.5px 0.625rem no-repeat;
  transition:
    transform 520ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background-size 300ms var(--ease-standard),
    background-color 300ms var(--ease-standard);
}

.faq summary:hover::after {
  background-color: var(--w-hover);
}

.faq details[open]:not(.closing) {
  --faq-ink: var(--w-accent);
}

.faq details[open]:not(.closing) summary::after {
  transform: rotate(180deg);
  background-color: var(--w-accent-soft);
  background-size:
    0.625rem 1.5px,
    1.5px 0;
}

.faq details p {
  margin: var(--space-2) 0 0;
  color: var(--w-muted);
}

@media (prefers-reduced-motion: reduce) {
  .faq summary::after {
    transition: none;
  }
}

/* The assistant asleep under its blanket on the page that is not there: the painted head's
 * resting loop, 61 frames at 12 a second in one strip; with reduced motion its first frame */
.resting {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-5);
  background: url("/assets/mascot/resting.webp") 0 0 / 5856px 96px no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  .resting {
    animation: resting 5.083s steps(61) infinite;
  }
}

@keyframes resting {
  to {
    background-position: -5856px 0;
  }
}

/* The home page is one day, told by scrolling. Its own colours hold whatever the theme:
 * a light room by day, a sunset, then night. story.js sets them as it goes. */
.story {
  position: relative;
  /* the wall's last window-height reaches past the story; it ends with the story */
  overflow: clip;
  /* The wall's colour under everything too: Firefox on an iPhone shows the page below its
   * bottom bar, past the window that holds the wall, and the page's own ground (dark in
   * the dark theme) showed there as a band */
  background: var(--wall, var(--paper-wall));
  --ink: #1f1f1e;
  --ink-muted: #5f5f5c;
  /* the wall by day, at sunset, and the glow of the screen at night: bronze, not orange */
  --paper-wall: #efece6;
  --sunset: #e7b38f;
  --bronze: #d1822f;
  color: var(--ink);
}

/* The wall behind the story, with the window's light and the plant's shadow on it; it
 * stays in the window while the story scrolls past */
.sky {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: max(100lvh, var(--seen, 0px));
  margin-bottom: -100vh;
  margin-bottom: calc(-1 * max(100lvh, var(--seen, 0px)));
  overflow: hidden;
  background: var(--wall, var(--paper-wall));
}

/* The light through the blinds and the tree outside, drawn by story.js: laid over the whole
 * page (pictures too) but under the top bar, like light through a window falling on it. It
 * stays where it is while the page scrolls, never stops moving, and goes at sunset. */
.shade,
.shade-grain {
  position: fixed;
  z-index: 5;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: max(100lvh, var(--seen, 0px));
  opacity: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* .shade-grain: the blur of the shadows is not smooth but grainy, fine specks where a
 * shadow is half there (story.js) */

.shade.live,
.shade.live + .shade-grain {
  opacity: 1;
}

/* On a narrow window the light is one still picture, its softness painted in: a phone's
 * browser can't blur the moving shadows enough, and they would cost its battery */
@media (max-width: 52rem) {
  .shade,
  .shade-grain {
    display: none;
  }

  .sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/scenes/shade-phone.webp") right top / cover no-repeat;
    mix-blend-mode: multiply;
    opacity: calc(0.7 * var(--lit, 1));
    transition: opacity 0.8s var(--ease-standard);
  }

  /* ...and on the tablet's screen while its sentence writes itself in the sunset, laid on
   * the part of it the window shows, under the words, until the screen turns amber (--lit
   * follows it, story.js) */
  .moving .held-screen::before {
    content: "";
    position: absolute;
    left: var(--lx, 0);
    top: var(--ly, 0);
    width: var(--lw, 100%);
    height: var(--lh, 100%);
    z-index: 1;
    background: url("/assets/scenes/shade-phone.webp") right top / cover no-repeat;
    mix-blend-mode: multiply;
    opacity: calc(0.7 * var(--lit, 1));
    transition: opacity 0.8s var(--ease-standard);
    pointer-events: none;
  }

  .moving .held-screen p {
    z-index: 2;
  }
}

.story > section {
  position: relative;
  z-index: 1;
}

/* The film of the day, in the page's frame. Its words stay while the film plays; the frame
 * then scrolls away with them. */
.day {
  height: 300vh;
}

.day-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: var(--inset);
}

.day-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--frame-radius);
  background: #f6efe2;
}

/* On a narrow window the picture keeps the window and cabinet in view */
.day-still,
.day-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
}

/* story.js shows the film once its first frame is there; until then the morning picture */
.day-film {
  visibility: hidden;
}

.day.live .day-film {
  visibility: visible;
}

.day.live .day-still {
  visibility: hidden;
}

/* At its end the film fades into its first frame, then starts again (story.js) */
.day.live.again .day-still {
  visibility: visible;
}

.day.again .day-film {
  opacity: 0;
  transition: opacity 1.1s var(--ease-standard);
}

/* Paper grain over the picture */
.day-card::after,
.feature::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .18 0 0 0 0 .15 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.day-text {
  position: absolute;
  z-index: 1;
  left: calc(63 * var(--u));
  top: calc(125 * var(--u));
  max-width: calc(760 * var(--u));
}

.day-text h1 {
  margin-bottom: calc(22 * var(--u));
}

.day-text h1,
.day-text .lead {
  transition: color 1400ms var(--ease-standard);
}

/* From the head's smile on the film turns to dusk, so its words fade to light */
.day[data-dusk] .day-text h1 {
  color: #f1efe9;
}

.day[data-dusk] .day-text .lead {
  color: #e2ded6;
}

.day-text .lead {
  max-width: calc(560 * var(--u));
  color: var(--w-muted);
  font-size: var(--t-lead);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.day-captions {
  position: absolute;
  z-index: 1;
  left: calc(63 * var(--u));
  bottom: calc(46 * var(--u));
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-captions li {
  position: absolute;
  bottom: 0;
  width: max-content;
  max-width: 80vw;
  padding: calc(10 * var(--u)) calc(16 * var(--u));
  border-radius: calc(10 * var(--u));
  background: var(--bar-fill);
  backdrop-filter: blur(10px);
  font-size: var(--t-small);
  opacity: 0;
  filter: blur(6px);
  /* one goes quietly, then the next comes into focus where it was: no movement */
  transition:
    opacity 600ms var(--ease-standard),
    filter 600ms var(--ease-standard);
}

.day[data-phase="morning"] li[data-phase="morning"],
.day[data-phase="day"] li[data-phase="day"],
.day[data-phase="evening"] li[data-phase="evening"],
.day[data-phase="night"] li[data-phase="night"] {
  opacity: 1;
  filter: none;
  transition:
    opacity 1100ms var(--ease-standard) 450ms,
    filter 1100ms var(--ease-standard) 450ms;
}

.day-hint {
  position: absolute;
  z-index: 1;
  bottom: calc(24 * var(--u));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--w-muted);
  font-size: 0.8125rem;
  opacity: calc(1 - var(--p, 0) * 12);
}

/* Big sentences in the middle of the wall; with motion they write themselves letter by
 * letter as the page scrolls, and the coloured word takes its colour only at the end */
.say {
  padding: 22vh var(--gutter);
}

.say p,
.held-screen p {
  max-width: 22ch;
  margin: 0 auto;
  line-height: 1.04;
  text-align: center;
  text-wrap: balance;
}

.say em {
  font-style: normal;
  color: #b0623e;
  transition: color 500ms var(--ease-standard);
}

.moving .say em {
  color: inherit;
}

.moving .say [data-done] em {
  color: #b0623e;
}

.moving .say {
  height: 170vh;
  padding: 0;
}

.moving .say-stage {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100svh;
  padding: 0 var(--gutter);
}

/* A word stays whole on its line; its letters come one by one */
.wd {
  display: inline-block;
  white-space: nowrap;
}

/* Each letter comes down a few pixels into its place as it appears */
.moving .ch {
  display: inline-block;
  opacity: var(--in, 1);
  transform: translateY(calc((1 - var(--in, 1)) * -0.15em)) rotateX(calc((1 - var(--in, 1)) * 10deg));
  transform-origin: 50% 100%;
}

.moving .ch[data-in] {
  transform: none;
}

/* What is in SOMA: on a wide window a row of full-window panels the page's scroll moves
 * sideways, ending on the sunset wall where the evening's sentence writes itself */
.track {
  padding: 6vh 0;
}

.track-row {
  display: grid;
  gap: 12vh;
}

.sliding .track {
  padding: 0;
  /* it starts under the last saying, which stays while the first panel comes in over it */
  margin-top: -100vh;
  margin-top: -100svh;
}

.sliding .track-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.sliding .track-row {
  display: flex;
  gap: 0;
  width: max-content;
  height: 100%;
  padding-left: 100vw;
  transform: translate3d(var(--tx, 0), 0, 0);
  will-change: transform;
}

.sliding .panel {
  flex: none;
  width: 100vw;
  height: 100%;
}

.panel h2 {
  margin: 0;
}

/* Three short points: a small icon, a name, a line */
.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(36 * var(--u));
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--w-muted);
  font-size: var(--t-small);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.three b {
  display: block;
  margin-bottom: calc(6 * var(--u));
  color: var(--w-text);
  font-size: var(--t-head);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.three svg {
  display: block;
  width: max(1.5rem, calc(34 * var(--u)));
  height: max(1.5rem, calc(34 * var(--u)));
  margin-bottom: calc(12 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--w-text);
}

/* The first panel: a picture in the page's frame, its title at the top, three lines at
 * its foot */
.feature {
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  border-radius: var(--frame-radius);
  background: #f6efe2;
}

.sliding .feature {
  width: calc(100vw - 2 * var(--inset));
  height: calc(100% - 2 * var(--inset));
  margin: var(--inset);
  min-height: 0;
}

/* The picture and its title share a frame of their own only on a narrow window */
.feature-frame {
  display: contents;
}

.feature-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.feature-head {
  position: absolute;
  z-index: 1;
  left: calc(63 * var(--u));
  top: calc(125 * var(--u));
}

.feature h2 {
  max-width: 11ch;
}

/* a soft patch of the wall behind the words, so they read over the picture */
.feature-head::before {
  inset: calc(-60 * var(--u)) calc(-90 * var(--u)) calc(-50 * var(--u)) calc(-140 * var(--u));
  background: radial-gradient(closest-side, rgba(246, 239, 226, 0.92) 55%, rgba(246, 239, 226, 0));
}

.feature-head p {
  max-width: 30ch;
  margin: calc(22 * var(--u)) 0 0;
  color: var(--w-muted);
  font-size: var(--t-lead);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.feature .three {
  position: absolute;
  z-index: 1;
  left: calc(63 * var(--u));
  bottom: calc(46 * var(--u));
  width: min(calc(860 * var(--u)), 60%);
}

.feature-head::before,
.feature .three::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.feature .three::before {
  inset: calc(-60 * var(--u)) calc(-110 * var(--u)) calc(-46 * var(--u)) calc(-63 * var(--u));
  background: radial-gradient(farthest-side at 45% 65%, rgba(246, 239, 226, 0.88) 62%, rgba(246, 239, 226, 0));
}

/* The second: three of the app's screens at the top, the title and a line at the foot */
.screens {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6vh;
  padding: 0 var(--gutter);
}

.sliding .screens {
  padding: calc(137 * var(--u)) calc(72 * var(--u)) calc(64 * var(--u));
}

.screen-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(15 * var(--u));
}

.screen {
  margin: 0;
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: max(6px, calc(8 * var(--u)));
}

/* Side by side the pictures lose less height than width as the window narrows, so they
 * turn from 16:9 towards square, until 5:4; from there they only grow smaller. (--col is
 * one column's width.) */
.sliding .screen img {
  --col: calc((100vw - 174 * var(--u)) / 3);
  aspect-ratio: auto;
  height: clamp(calc(var(--col) * 9 / 16), calc(6.87vw + 189px), calc(var(--col) * 4 / 5));
}

/* Its name, and its line under it */
.screen figcaption {
  display: grid;
  gap: calc(6 * var(--u));
  max-width: 34ch;
  margin-top: calc(16 * var(--u));
  color: var(--ink-muted);
  font-size: var(--t-small);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.screen figcaption b {
  color: var(--ink);
  font-size: var(--t-head);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.screens-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: end;
  gap: calc(40 * var(--u));
}

.screens-foot h2 {
  max-width: 13ch;
}

.screens-foot p {
  max-width: 24ch;
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--t-small);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.screens-foot p b {
  display: block;
  margin-bottom: calc(8 * var(--u));
  color: var(--ink);
  font-size: var(--t-head);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* The third: what it works with, its picture filling the other half */
.works {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}

.works-words {
  padding: 0 var(--gutter);
}

.sliding .works-words {
  padding: 0 calc(60 * var(--u)) 0 calc(154 * var(--u));
}

.works h2 {
  max-width: 11ch;
}

.works p {
  max-width: 26ch;
  margin: calc(28 * var(--u)) 0 0;
  color: var(--ink-muted);
  font-size: var(--t-text);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.works-picture {
  display: block;
  width: 100%;
  height: auto;
}

.sliding .works-picture {
  height: 100vh;
  height: 100svh;
  object-fit: cover;
}

/* Nine tiles, three by three, in an even grid; their names are for screen readers only */
.apps {
  display: grid;
  grid-template-columns: repeat(3, max(4.95rem, calc(123 * var(--u))));
  gap: calc(28 * var(--u));
  margin: calc(56 * var(--u)) 0 0;
  padding: 0;
  list-style: none;
}

.apps li {
  position: relative;
  display: block;
}

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

.apps svg {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 27%;
  border-radius: max(12px, calc(18 * var(--u)));
  background: #e9e5de;
  fill: #4a4744;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 8px rgba(40, 32, 20, 0.1);
}

/* The last: an empty panel; as it comes, the wall behind turns to sunset (story.js sets
 * --wall), and the evening's sentence writes itself there */
.sunset-light {
  background: var(--sunset);
}

.panel.sunset {
  display: none;
}

.sliding .panel.sunset {
  display: block;
}

/* Night: the evening's sentence writes itself in white on the sunset wall, the wall turns
 * amber and the words black: it is a tablet's screen, held in two hands, which draws back
 * into the dark and moves aside for the night's words. story.js sets the tablet's
 * transform and --sun (the sunset's share), --ink-night, --lift (the dark around it) and
 * --words. */
.glow {
  color: #ececeb;
  background: #191919;
}

.glow-stage {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--space-6);
  min-height: 100vh;
  padding: 14vh var(--gutter);
  overflow: hidden;
}

.held {
  position: relative;
  justify-self: center;
  width: min(100%, 72rem);
  transform-origin: 0 0;
}

.held-picture {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

.held-picture.tall,
.portrait .held-picture.wide {
  display: none;
}

.portrait .held-picture.tall {
  display: block;
}

/* The screen lies over the painted one; story.js places it from the picture's data-screen
 * (left, top, width, height as shares of the picture) */
.held-screen {
  position: absolute;
  left: calc(var(--sx, 0.2) * 100%);
  top: calc(var(--sy, 0.2) * 100%);
  width: calc(var(--sw, 0.6) * 100%);
  height: calc(var(--sh, 0.6) * 100%);
  display: grid;
  place-items: center;
  padding: 6%;
  border-radius: calc(var(--sr, 0.02) * 100vw);
  background:
    radial-gradient(rgba(70, 30, 0, 0.12) 0.5px, transparent 0.9px) 0 0 / 3px 3px,
    var(--bronze);
  color: var(--ink-night, #18190f);
  overflow: visible;
}

.held-screen p {
  position: relative;
  font-size: var(--screen-font, clamp(1rem, 2.6vw, 2rem));
}

.sunset-light {
  position: absolute;
  left: var(--lx, 0);
  top: var(--ly, 0);
  width: var(--lw, 100%);
  height: var(--lh, 100%);
  opacity: var(--sun, 0);
  pointer-events: none;
}

.glow-words {
  max-width: 34rem;
  justify-self: center;
}

.glow-words p {
  margin: calc(24 * var(--u)) 0 0;
  color: #b9b8b3;
  font-size: var(--t-text);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.glow .three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(24 * var(--u));
  margin-top: calc(40 * var(--u));
  color: #a5a5a2;
}

.stacked .glow .three {
  grid-template-columns: 1fr;
}

.glow .three b,
.glow .three svg {
  color: #ececeb;
}

/* With motion the night is one window-high stage. On a wide window it comes right after
 * the sunset wall slid in, at the same place, so the wall seems to stay. */
.moving .glow {
  height: 420vh;
  background: transparent;
}

.sliding .glow {
  margin-top: -100vh;
  margin-top: -100svh;
}

/* On a narrow window the night's own dark lies under its stage too, for the same strip
 * below a phone browser's bar; while the stage comes up (--veil, story.js) it is clear,
 * so the wall and its light show through it as one, with no edge to lag behind a scroll */
.moving:not(.sliding) .glow,
.moving:not(.sliding) .glow-stage {
  background: rgb(25 25 25 / calc(1 - var(--veil, 0)));
}

.moving:not(.sliding) .held,
.moving:not(.sliding) .glow-words {
  visibility: hidden;
}

.moving:not(.sliding) .glow-stage[data-up] .held,
.moving:not(.sliding) .glow-stage[data-up] .glow-words {
  visibility: visible;
}

.moving .glow-stage {
  position: sticky;
  top: 0;
  display: block;
  height: 100vh;
  /* as high as the window really is (story.js measures it, the tablet is placed by it too),
   * so no strip of the wall shows under it when a phone's browser hides its bars */
  height: var(--seen, 100svh);
  min-height: 0;
  padding: 0;
  /* the dark theme's page, as on Download; the held pictures' dark is painted to match */
  background: #191919;
}

.sliding .glow-stage {
  visibility: hidden;
}

.sliding .glow[data-on] .glow-stage {
  visibility: visible;
}

.moving .held {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--hw, 100vw);
  will-change: transform;
}

.moving .held-screen p {
  /* never wider than the part of the screen the window shows while it covers the window */
  max-width: min(24ch, calc(var(--lw, 100%) * 0.84));
}

.moving .glow-words {
  position: absolute;
  left: 57.5vw;
  top: 50%;
  width: min(36rem, 34vw);
  opacity: var(--words, 0);
  transform: translateY(calc(-50% + (1 - var(--words, 0)) * 1.5rem));
}

.moving.stacked .glow-words {
  left: max(var(--gutter), calc(50vw - 20rem));
  right: max(var(--gutter), calc(50vw - 20rem));
  top: auto;
  bottom: 9vh;
  width: auto;
  transform: translateY(calc((1 - var(--words, 0)) * 1.5rem));
}

.moving.portrait .glow-words {
  bottom: 4vh;
}

.moving.portrait .glow-words h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.moving.portrait .glow .three {
  gap: 0.5rem;
}
/* The foot of every page, in one piece: night falls from the top into the blue, the
 * sleeping head's picture lies across it with the name and the way in over its dark side,
 * and the links sit lower down with room around them. On the home page it starts from
 * the night's black. When it comes into view the picture lights up like a screen and
 * settles (foot.js). */
:root {
  --night-deep: #171b26;
  --foot-edge: max(var(--gutter), calc(120 * var(--u)));
}

.foot {
  /* it grows out of the page: a long, fine fall from the page's own colour into the
   * night's blue, eased so no edge shows */
  margin-top: 0;
  padding-top: calc(320 * var(--u));
  background: linear-gradient(
    to bottom,
    var(--w-page) 0,
    color-mix(in oklab, var(--w-page) 96%, var(--night-bg)) calc(50 * var(--u)),
    color-mix(in oklab, var(--w-page) 86%, var(--night-bg)) calc(100 * var(--u)),
    color-mix(in oklab, var(--w-page) 68%, var(--night-bg)) calc(160 * var(--u)),
    color-mix(in oklab, var(--w-page) 44%, var(--night-bg)) calc(220 * var(--u)),
    color-mix(in oklab, var(--w-page) 20%, var(--night-bg)) calc(280 * var(--u)),
    color-mix(in oklab, var(--w-page) 6%, var(--night-bg)) calc(330 * var(--u)),
    var(--night-bg) calc(380 * var(--u)),
    var(--night-deep) 100%
  );
  color: #a5a5a2;
  font-size: max(0.875rem, calc(15 * var(--u)));
}

main:has(.story) + .foot {
  margin-top: 0;
  padding-top: 0;
  background: linear-gradient(to bottom, #191919 0, #1a2030 22%, var(--night-bg) 50%, var(--night-deep) 100%);
}

.foot-stage {
  position: relative;
  min-height: min(calc(100vw * 9 / 21), 92vh);
  overflow: hidden;
}

.foot-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 50%;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0, #000 22%, #000 72%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 42%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0, #000 22%, #000 72%, transparent 100%),
    linear-gradient(to right, transparent 0, #000 42%);
  mask-composite: intersect;
}

/* The light-up: a warm glow over the picture, gone in a breath */
.foot-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse at 72% 55%, rgba(240, 160, 80, 0.4), rgba(240, 160, 80, 0) 70%);
}

@media (prefers-reduced-motion: no-preference) {
  .foot-stage.waiting .foot-picture {
    filter: brightness(1.35) blur(2px);
  }

  .foot-stage.waiting .foot-glow {
    opacity: 1;
  }

  .foot-stage.lit .foot-picture {
    transition: filter 2.2s cubic-bezier(0.2, 0.6, 0.2, 1);
  }

  .foot-stage.lit .foot-glow {
    transition: opacity 2.6s cubic-bezier(0.2, 0.6, 0.2, 1);
  }
}

.foot-cta {
  position: relative;
  z-index: 1;
  box-sizing: content-box;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  padding: calc(150 * var(--u)) var(--gutter) calc(60 * var(--u)) calc(var(--foot-edge) + 90 * var(--u));
}

.foot-cta .foot-mark {
  margin: 0 0 calc(28 * var(--u)) -0.02em;
  color: #d0b992;
  font-size: max(2.5rem, min(13vw, calc(88 * var(--u))));
  line-height: 0.9;
}

.foot-cta .button.big {
  width: calc(320 * var(--u));
  min-width: 12rem;
  max-width: 100%;
}

.foot-cta p {
  margin-top: calc(14 * var(--u));
  color: #c4c6cc;
  font-size: var(--t-small);
}

.foot-cta a:not(.button) {
  color: #ececeb;
}

.button.big {
  justify-content: center;
  height: max(2.75rem, calc(50 * var(--u)));
  border-radius: max(8px, calc(10 * var(--u)));
  font-size: max(0.9375rem, calc(16 * var(--u)));
}

.foot .button.primary {
  --w-accent: #d0b992;
  --w-accent-hover: #ddcaa8;
  --w-on-accent: #1b1916;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.6fr;
  gap: calc(48 * var(--u));
  padding: calc(110 * var(--u)) var(--foot-edge) calc(64 * var(--u));
}

.foot-cols h2 {
  margin-bottom: calc(12 * var(--u));
  color: #7d8290;
  font-size: max(0.75rem, calc(12 * var(--u)));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.foot-cols nav,
.foot-cols div {
  display: grid;
  align-content: start;
  gap: calc(6 * var(--u));
}

.foot-cols a {
  color: #dcdcda;
  text-decoration: none;
}

.foot-cols a:hover {
  color: #ffffff;
}

.foot-cols .foot-name {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: #ececeb;
}

.foot-name p {
  display: grid;
  margin: 0;
}

.foot-name span {
  color: #a5a5a2;
}

/* The brand's icon beside its name, as in the top bar: no eyes, the brand is not the
 * assistant */
.foot-icon {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
}

.foot-cols span {
  color: #7d8290;
}

.note label {
  color: #a5a5a2;
  line-height: 1.5;
}

.note label a {
  color: #ececeb;
}

.foot-cols .note-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.note input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: calc(10 * var(--u));
  background: rgba(255, 255, 255, 0.05);
  color: #ececeb;
  font: inherit;
}

.note input::placeholder {
  color: #7d8290;
}

.note input:focus {
  outline: 2px solid #d0b992;
  outline-offset: 1px;
}

.note .button {
  height: 2.75rem;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: calc(10 * var(--u));
  background: rgba(255, 255, 255, 0.07);
  color: #ececeb;
}

.note .button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.foot-small {
  margin: 0;
  padding: 0 var(--foot-edge) calc(40 * var(--u));
  color: #7d8290;
  font-size: max(0.75rem, calc(13 * var(--u)));
}

/* A page's first screen in two parts: a picture on the left (Download's window sketch, the
 * demo's open door, the questions' table) and the panel of words on the right, everything in
 * one screen. Download, Demo and Questions share it */
.split {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(22rem, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 1360px;
  min-height: calc(100svh - 6rem);
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
}

.split-picture {
  display: grid;
  place-items: center;
  margin: 0;
}

/* Every page picture is one painting at 2:3 in the same arch, drawn here so its edge is
   clean on any ground: a half circle across the top, small corners below */
.split-picture img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(46rem, calc(100svh - 10rem));
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 50% 50% 0.75rem 0.75rem / 33.333% 33.333% 0.5rem 0.5rem;
}

/* The panel's words: the same eyebrow, title, lead and quiet small headings on every page */
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--w-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.page-words h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 500;
}

.page-words .lead {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

.page-words .button.big {
  margin: 0;
}

.get-meta {
  margin: 0.625rem 0 0;
  color: var(--w-faint);
  font-size: 0.8125rem;
}

.page-words .steps-head {
  margin: 2rem 0 0.75rem;
  color: var(--w-faint);
  font-size: 0.8125rem;
  font-weight: 500;
}

.steps {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  column-gap: 0.75rem;
  color: var(--w-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--w-accent-soft);
  color: var(--w-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.steps b {
  color: var(--w-text);
  font-weight: 500;
}

.ways {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.way {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--w-line);
  border-radius: 12px;
}

.way h2 {
  margin: 0;
  font-size: 0.9375rem;
}

.way p {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.way a {
  margin-top: 0.25rem;
  color: var(--w-accent);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.get-more {
  margin: 1.25rem 0 0;
  color: var(--w-muted);
  font-size: 0.875rem;
}

/* Questions: Download's two parts on the first screen (the table by the window on the left;
 * the title, the most asked questions and the way down on the right), then one band per
 * topic: its painted thing, name and a line on the left, its answers on the right. Each
 * topic is named once */
.answers-hero {
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 1fr);
}

.answers-hero .page-words {
  max-width: 34rem;
}

.asked {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--w-line);
  list-style: none;
}

.asked a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid var(--w-line);
  color: var(--w-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-quick) var(--ease-standard);
}

.asked a::after {
  content: "→";
  margin-left: auto;
  color: var(--w-faint);
  transition: transform 300ms var(--ease-standard), color var(--dur-quick) var(--ease-standard);
}

.asked a:hover {
  color: var(--w-accent);
}

.asked a:hover::after {
  color: var(--w-accent);
  transform: translateX(0.25rem);
}

.answers-all {
  display: inline-flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  color: var(--w-accent);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.answers-all span {
  transition: transform 300ms var(--ease-standard);
}

.answers-all:hover span {
  transform: translateY(0.1875rem);
}

.answers {
  box-sizing: border-box;
  max-width: calc(68rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2rem var(--gutter) 6rem;
}

.topic {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid var(--w-line);
  scroll-margin-top: 5rem;
}

.topic-head img {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: -0.5rem 0 0.75rem -0.5rem;
}

.topic-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.625rem;
  font-weight: 500;
}

.topic-head p {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.answers .faq {
  align-self: start;
  margin: 0;
  border: 1px solid var(--w-line);
  border-radius: 12px;
}

.answers .faq details {
  padding: 1.125rem 1.5rem;
  scroll-margin-top: 7rem;
}

.answers .faq details:last-child {
  border-bottom: 0;
}

.answers .faq summary {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.answers .faq details p {
  max-width: 42rem;
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.answers-foot {
  margin: 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--w-line);
  color: var(--w-muted);
  font-size: 0.875rem;
}

@media (max-width: 56rem) {
  .topic {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2.25rem 0;
  }

  .topic-head {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-items: center;
  }

  .topic-head img {
    grid-row: span 2;
    width: 4rem;
    height: 4rem;
    margin: 0;
  }

  .topic-head h2 {
    margin: 0;
    font-size: 1.375rem;
  }
}

@media (max-width: 40rem) {
  .answers .faq details {
    padding: 1rem 1.125rem;
  }
}

/* The sketch of SOMA's window: its places, the day's one thing, tasks, times and the
 * levels of Balance, drawn as shapes in the page's own colours */
.sketch {
  --shape: color-mix(in srgb, var(--w-text) 9%, transparent);
  --shape-strong: color-mix(in srgb, var(--w-text) 14%, transparent);
  display: grid;
  grid-template-rows: 2.25rem 1fr;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  border: 1px solid var(--w-line-strong);
  border-radius: 12px;
  background: var(--w-page);
  box-shadow: 0 30px 60px -20px rgba(42, 41, 39, 0.28), 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sketch i {
  display: block;
  height: 0.5rem;
  border-radius: 4px;
  background: var(--shape);
}

.sketch .w40 { width: 40%; }
.sketch .w50 { width: 50%; }
.sketch .w60 { width: 60%; }
.sketch .w70 { width: 70%; }
.sketch .w80 { width: 80%; }

.sketch-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.75rem;
  border-bottom: 1px solid var(--w-line);
  background: var(--w-chrome);
}

.sketch-bar svg {
  width: 16px;
  height: 16px;
}

.sketch-bar .tab {
  width: 5.5rem;
  height: 0.5rem;
  border-radius: 4px;
  background: var(--shape-strong);
}

.sketch-bar .tab.short {
  width: 4rem;
  opacity: 0.6;
}

.sketch-bar .controls {
  display: flex;
  align-self: stretch;
  margin-left: auto;
}

.sketch-bar .controls i {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: auto;
  background: none;
}

.sketch-bar .controls i::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border: 1.5px solid var(--w-faint);
  border-radius: 1px;
}

.sketch-bar .controls i:first-child::before {
  height: 0;
  border-width: 1.5px 0 0;
}

.sketch-body {
  display: grid;
  grid-template-columns: 22% 1fr 30%;
  min-height: 0;
}

.sketch-side {
  display: grid;
  align-content: start;
  gap: 0.625rem;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--w-line);
  background: var(--w-chrome);
}

.sketch-side s {
  height: 0.5rem;
}

.sketch-side .on {
  background: var(--w-accent);
  opacity: 0.55;
}

.sketch-main {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.25rem;
}

.sketch-main .hello {
  width: 55%;
  height: 0.875rem;
  background: var(--shape-strong);
}

.sketch .one {
  display: grid;
  grid-template-columns: 0.875rem 1fr;
  gap: 0.5rem 0.625rem;
  align-items: center;
  margin: 0.25rem 0 0.5rem;
  padding: 0.875rem;
  border-radius: 10px;
  background: var(--w-accent-soft);
}

.sketch .one b {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--w-accent);
}

.sketch .one i {
  background: color-mix(in srgb, var(--w-accent) 30%, transparent);
}

.sketch .row {
  display: grid;
  grid-template-columns: 0.75rem 1fr;
  gap: 0.625rem;
  align-items: center;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--w-line);
}

.sketch .row b {
  width: 0.75rem;
  height: 0.75rem;
  box-sizing: border-box;
  border: 1.5px solid var(--w-line-strong);
  border-radius: 50%;
}

.sketch .row.done b {
  border-color: var(--w-accent);
  background: var(--w-accent);
  opacity: 0.6;
}

.sketch-zone {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  border-left: 1px solid var(--w-line);
}

.sketch-zone > b {
  height: 2rem;
  border-left: 3px solid var(--w-line-strong);
  border-radius: 6px;
  background: var(--shape);
}

.sketch-zone > b.now {
  height: 3rem;
  border-left-color: var(--w-accent);
  background: color-mix(in srgb, var(--w-accent) 14%, transparent);
}

.sketch .levels {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.sketch .levels u {
  position: relative;
  flex: 1;
  height: 2.5rem;
  overflow: hidden;
  border-radius: 6px;
  background: var(--shape);
}

.sketch .levels u::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  background: var(--w-accent);
  opacity: 0.45;
}

.sketch .levels u:nth-child(2)::after { height: 40%; }
.sketch .levels u:nth-child(3)::after { height: 85%; }
.sketch .levels u:nth-child(4)::after { height: 25%; }
.sketch .levels u:nth-child(5)::after { height: 55%; }

/* With reduced motion the film shows one quiet moment per part of the day, the light on
 * the wall stays put, nothing slides and the night shows the tablet with its words. */
@media (prefers-reduced-motion: reduce) {
  .day-captions li,
  .day[data-phase] .day-captions li {
    filter: none;
    transition: opacity 400ms var(--ease-standard);
  }
}

/* Narrow windows: the film is the first screen and plays by itself, the panels stack and
 * the tablet stands upright */
@media (max-width: 52rem) {
  .links a:not(.get) {
    display: none;
  }

  /* Sign in alone in its pill: the same paper all round */
  .links a.get {
    margin-left: 0;
  }

  .day {
    height: auto;
  }

  /* The film in the page's frame, as every big picture on a narrow window */
  .day-stage {
    position: relative;
    height: 100svh;
  }

  .day-text {
    left: var(--gutter);
    right: var(--gutter);
    top: 13vh;
  }

  .day-hint {
    display: none;
  }

  .day-captions {
    left: var(--gutter);
    bottom: 6vh;
  }

  .track-row {
    gap: 10vh;
  }

  /* Your day: the picture fills the window in its frame with the title on it; the three
   * points follow below on the page */
  .feature {
    min-height: 0;
    margin: 0;
    overflow: visible;
    border-radius: 0;
    background: none;
  }

  .feature::after,
  .feature-head::before,
  .feature .three::before {
    display: none;
  }

  .feature-frame {
    position: relative;
    display: block;
    height: calc(100svh - 2 * var(--inset));
    margin: 0 var(--inset);
    overflow: hidden;
    border-radius: var(--frame-radius);
    background: #f6efe2;
  }

  .feature-picture {
    object-position: 82% 50%;
  }

  .feature-head {
    left: 0;
    right: 0;
    top: 0;
    padding: 5.75rem calc(var(--gutter) - var(--inset) + 6px) var(--space-6);
    background: linear-gradient(to bottom, rgba(246, 239, 226, 0.96) 78%, rgba(246, 239, 226, 0));
  }

  .feature h2 {
    max-width: 14ch;
  }

  .feature .three {
    position: static;
    width: auto;
    padding: var(--space-6) var(--gutter) 0;
  }

  /* The points as rows: the icon on the left, its name and line beside it */
  .three {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .three li {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    column-gap: 1rem;
  }

  .three svg {
    grid-row: span 2;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0.1rem 0 0;
  }

  .three b {
    margin-bottom: 0.25rem;
  }

  .screen-row,
  .screens-foot,
  .works,
  .split,
  .foot-cols {
    grid-template-columns: 1fr;
  }

  .screen-row {
    gap: var(--space-6);
  }

  /* The app's words under its screens and what it works with: centred, well apart from
   * what is above them; the tiles three by three in the middle */
  .screens {
    gap: 15vh;
  }

  .screens-foot,
  .works-words {
    text-align: center;
  }

  .screens-foot h2,
  .screens-foot p,
  .works h2,
  .works p {
    margin-inline: auto;
  }

  .works {
    gap: var(--space-6);
  }

  .apps {
    grid-template-columns: repeat(3, 4.95rem);
    justify-content: center;
    gap: 1.5rem;
    margin-top: calc(3 * var(--space-5));
  }

  .works-picture {
    width: calc(100% - 2 * var(--inset));
    margin: 0 var(--inset);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 62%;
    border-radius: var(--frame-radius);
  }

  /* The night's words under the tablet: the title in the middle, the points as rows */
  .glow-words h2,
  .glow-words > p {
    text-align: center;
  }

  .foot-stage {
    min-height: 0;
  }

  .foot-picture {
    position: relative;
    height: 60vw;
    margin-top: 8vh;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 25%, #000 70%, transparent 100%);
  }

  .foot-cta {
    padding: 0 var(--gutter) var(--space-6);
  }

  .foot-cols {
    padding: var(--space-6) var(--gutter);
  }

  .foot-small {
    padding: 0 var(--gutter) var(--space-5);
  }

  /* A phone cannot install the Windows app: the words alone, the sketch left out */
  .get-sketch {
    display: none;
  }

  .split {
    min-height: 0;
  }

  .split.demo,
  .split.answers-hero {
    grid-template-columns: 1fr;
  }

  .split-picture img {
    max-height: 20rem;
  }

  .ways {
    grid-template-columns: 1fr;
  }
}


/* Demo: Download's two parts, the open door on the left and the way in on the right; a phone
 * is told the demo is for a computer and is asked nothing */
.demo {
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 1fr);
}

.demo-panel {
  max-width: 34rem;
}

/* Short facts with a line icon each, as Download's steps but without numbers */
.facts {
  display: grid;
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  column-gap: 0.875rem;
  align-items: start;
  color: var(--w-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.facts svg {
  box-sizing: border-box;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.3125rem;
  border-radius: 50%;
  background: var(--w-accent-soft);
  fill: none;
  stroke: var(--w-accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.facts b {
  color: var(--w-text);
  font-weight: 500;
}

.demo-check:empty {
  display: none;
}

.demo-check {
  margin-bottom: 1rem;
}

.demo-computer [data-state] p:not(.get-meta) {
  margin: 0;
  color: var(--w-muted);
}

.demo-computer [data-state] b {
  color: var(--w-text);
  font-weight: 500;
}

.demo-computer .link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--w-text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* The painted head wakes from under its blanket while the copy starts: 39 frames at 12 a
 * second in one strip, held on the last; with reduced motion only the last */
.demo-waking:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.waking {
  flex: none;
  width: 96px;
  height: 96px;
  background: url("/assets/mascot/waking.webp") -3648px 0 / 3744px 96px no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  .waking {
    animation: waking 3.25s steps(38) both;
  }
}

@keyframes waking {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -3648px 0;
  }
}

.demo-phone {
  display: none;
  margin: 0;
  color: var(--w-muted);
}

.demo-phone b {
  color: var(--w-text);
  font-weight: 500;
}

@media (hover: none) and (pointer: coarse) and (max-width: 52rem) {
  .demo-computer {
    display: none;
  }

  .demo-phone {
    display: block;
  }
}
