@font-face {
  font-family: "Literata";
  src: url("fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Still Point, from ui/theme/Theme.kt: Day by default, Night in the dark and on the landing page. */
:root {
  --ground: #f7f8fa;
  --card: #ffffff;
  --ink: #171b23;
  --muted: #5f6776;
  --line: #e1e4ea;
  --focal: #2450e0;
  --pool: #e9eefd;
  --on-focal: #ffffff;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cjk: "Noto Serif JP", "Noto Serif SC", "Yu Mincho", "Hiragino Mincho ProN", "SimSun", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1116; --card: #161b23; --ink: #e7eaf0; --muted: #8c95a5;
    --line: #262c36; --focal: #7fa4ff; --pool: #1a2232; --on-focal: #0e1116;
  }
}
:root.night {
  --ground: #0e1116; --card: #161b23; --ink: #e7eaf0; --muted: #8c95a5;
  --line: #262c36; --focal: #7fa4ff; --pool: #1a2232; --on-focal: #0e1116;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
a { color: var(--focal); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focal); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: min(70rem, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(40rem, 100% - 2rem); margin-inline: auto; }

header.top { padding: 1.25rem 0; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; font: 600 1.35rem/1 var(--serif); letter-spacing: -0.01em; }
.brand img { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; }
header.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
header.top nav a:hover { color: var(--ink); text-decoration: underline; }

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 1.1rem; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.75rem); line-height: 1.04; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; }
p { text-wrap: pretty; }

.btn { display: inline-flex; flex-direction: column; justify-content: center; min-height: 3.5rem; padding: 0.6rem 1.3rem; border-radius: 0.85rem;
  text-decoration: none; font-weight: 700; line-height: 1.2; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.btn small { font-weight: 500; font-size: 0.78rem; color: var(--muted); }
.btn.primary { background: var(--focal); border-color: var(--focal); color: var(--on-focal); }
.btn.primary small { color: inherit; opacity: 0.8; }
.btn.soon { border-style: dashed; background: transparent; }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.stores.center { justify-content: center; }

/* ---- Scenes: everything sits on one centre line, as the word does in the app ----------------- */

.scene { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.center-head { text-align: center; }
.center-head p { color: var(--muted); font-size: 1.12rem; margin: 0; }

/* The hero: words, then the reader, then its controls, one under the other. On a wide screen the
   reader stays in the middle, with the words to its left and the controls to its right. */
.hero { padding-top: clamp(1.5rem, 4vw, 3.5rem); }
.hero-grid { width: min(36rem, 100% - 2rem); margin-inline: auto; display: grid; justify-items: center; }
.hero-grid > .intro, .hero-grid > .try { width: 100%; }
.hero .phone { width: 21rem; margin: 0.5rem 0; }
.hero .lede { color: var(--muted); font-size: 1.2rem; margin: 0 0 1.5rem; }
@media (min-width: 75rem) {
  /* The phone is sized to fit the window's height, so the whole of it shows on a laptop. */
  .hero { --phone-w: clamp(17rem, calc((100svh - 8.5rem) * 0.45), 24rem); padding: clamp(1.5rem, 4vh, 4rem) 0; }
  header.top .wrap { width: min(92rem, 100% - 4rem); }
  .hero-grid { min-height: calc(100svh - 6.5rem - clamp(3rem, 8vh, 8rem)); width: min(92rem, 100% - 4rem); grid-template-columns: minmax(0, 1fr) var(--phone-w) minmax(0, 1fr); align-items: center; column-gap: clamp(3rem, 5vw, 5.5rem); }
  .hero .phone { width: var(--phone-w); margin: 0; }
  .hero .intro { justify-self: end; max-width: 30rem; text-align: right; }
  .hero h1 { font-size: clamp(3.4rem, 4vw, 4.25rem); }
  .hero .lede { margin: 0; }
  .hero .try { justify-self: start; max-width: 25rem; }
  .hero .controls { margin-top: 0; }
}

/* Pace and words at a time */
.controls { margin: 2rem 0 2.25rem; display: grid; gap: 1.5rem; max-width: 27rem; }
.pace { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0.6rem 1rem; }
.pace label, .group > span { font-weight: 700; font-size: 0.95rem; }
.pace-out { justify-self: end; color: var(--muted); font-size: 0.95rem; }
.pace-out span { color: var(--ink); font: 600 1.35rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.pace input { grid-column: 1 / -1; }
.pace-scale { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; margin-top: -0.2rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 2rem; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--focal) var(--fill, 22%), var(--line) var(--fill, 22%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--focal); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.4rem; height: 1.4rem; margin-top: calc(2px - 0.7rem); border-radius: 50%;
  background: var(--ink); border: 4px solid var(--ground); box-shadow: 0 0 0 1.5px var(--focal); }
input[type="range"]::-moz-range-thumb { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--ink); border: 4px solid var(--ground); box-shadow: 0 0 0 1.5px var(--focal); }
.group { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.seg { display: inline-flex; padding: 0.25rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.seg button { min-width: 2.75rem; min-height: 2.25rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 0.95rem/1 var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

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

.phone { width: 18.5rem; max-width: 100%; padding: 0.55rem; border-radius: 2.5rem; background: #05070a;
  box-shadow: 0 0 0 1px #262c36, 0 2.5rem 5rem -2rem rgb(0 0 0 / 0.7); }
.phone .screen { position: relative; aspect-ratio: 9 / 19.5; border-radius: 1.95rem; overflow: hidden; }
.phone noscript img { display: block; width: 100%; height: auto; border-radius: 1.95rem; }
.phone.shot .screen, .phone.shot { aspect-ratio: auto; }
.phone.shot img { display: block; width: 100%; height: auto; border-radius: 1.95rem; }

/* The reader screen, in any theme: --p-* are the theme's colours, Dark unless set. */
.reader {
  --p-ground: #0e1116; --p-card: #161b23; --p-ink: #e7eaf0; --p-muted: #8c95a5; --p-line: #262c36;
  --p-focal: #7fa4ff; --p-pool: #1a2232; --p-action: #e7eaf0; --p-on-action: #0e1116;
}
.reader .screen, .tlayer { display: flex; flex-direction: column; background: var(--p-ground); color: var(--p-ink); font-family: var(--sans); }
.sys { flex: none; height: 1.7rem; padding: 0.35rem 1.4rem 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.62rem; font-weight: 700; color: var(--p-ink); }
.sys-icons { display: flex; gap: 0.25rem; }
.sys-icons i { display: block; width: 0.75rem; height: 0.42rem; border-radius: 0.1rem; background: var(--p-ink); opacity: 0.85; }
.sys-icons i:first-child { width: 0.5rem; clip-path: polygon(0 100%, 100% 0, 100% 100%); border-radius: 0; }
.bar { flex: none; height: 2.6rem; display: grid; grid-template-columns: 2.4rem 1fr 2.4rem; align-items: center; text-align: center; transition: opacity 300ms; }
.bar .ico { color: var(--p-muted); font-size: 1.1rem; line-height: 1; }
.bar .aa { font: 600 0.72rem/1 var(--serif); }
.bar .title { display: grid; line-height: 1.25; }
.bar .title b { font-size: 0.7rem; }
.bar .title small { font-size: 0.58rem; color: var(--p-muted); }

.stage { position: relative; flex: 1; min-height: 0; outline: none; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.stage:focus-visible { box-shadow: inset 0 0 0 2px var(--p-focal); }
.page { position: absolute; left: 0; right: 0; padding: 0 1.1rem; overflow: hidden; transition: opacity 300ms; }
.page p { margin: 0; font: 400 0.74rem/1.75 var(--serif); color: var(--p-muted); }
.page .here { color: var(--p-ink); background: var(--p-pool); border-radius: 0.15rem; box-decoration-break: clone; -webkit-box-decoration-break: clone; box-shadow: 0 0 0 0.1rem var(--p-pool); }
.before { top: 0; bottom: calc(58% + 0.4rem); display: flex; align-items: flex-end; -webkit-mask-image: linear-gradient(transparent, #000 45%); mask-image: linear-gradient(transparent, #000 45%); }
.after { top: calc(58% + 3.3rem); bottom: 0; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.word { position: absolute; left: 0; right: 0; top: 42%; height: 3.6rem; }
.word::before, .word::after { content: ""; position: absolute; left: 50%; width: 2px; height: 0.65rem; margin-left: -1px; border-radius: 1px; background: var(--p-line); }
.word::before { top: 0; }
.word::after { bottom: 0; }
.text { position: absolute; left: 0; right: 0; top: 50%; height: 2.2rem; transform: translateY(-50%); }
.text .w { position: absolute; left: 0; top: 50%; translate: 0 -50%; white-space: nowrap; font-family: var(--serif); line-height: 1; color: var(--p-ink); }
.text .w b { color: var(--p-focal); font-weight: 700; }
.flash { position: absolute; left: 0; right: 0; top: calc(42% + 3.9rem); text-align: center; font: 600 0.62rem/1 var(--sans); color: var(--p-muted); opacity: 0; transition: opacity 150ms; pointer-events: none; }
.flash.on { opacity: 1; }
.foot { flex: none; padding: 0 1.1rem 1rem; }
.progress { height: 2px; border-radius: 1px; background: var(--p-line); }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--p-focal); }
.meta { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--p-muted); margin: 0.4rem 0 0.75rem; transition: opacity 300ms; }
.dock { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; transition: opacity 300ms; }
.dock .chip { justify-self: start; padding: 0.35rem 0.65rem; border-radius: 999px; border: 1px solid var(--p-line); font-size: 0.6rem; font-weight: 700; color: var(--p-ink); }
.dock .chip:last-child { justify-self: end; }
.play { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--p-action); display: grid; place-items: center; }
.play i { width: 0; height: 0; margin-left: 0.15rem; border-style: solid; border-width: 0.42rem 0 0.42rem 0.68rem; border-color: transparent transparent transparent var(--p-on-action); }
.reader[data-state="playing"] .bar, .reader[data-state="playing"] .meta, .reader[data-state="playing"] .dock, .reader[data-state="playing"] .page { opacity: 0; }

/* ---- Themes: the same page in all six on one phone. One comes forward, or fills the screen, and
   the section takes its paper and ink. --t-* are the theme's colours, the page's own unless set. */

.themes { background: var(--t-ground, var(--ground)); color: var(--t-ink, var(--ink)); transition: background-color 700ms, color 700ms; }
.themes .center-head p, .themes .hint { color: var(--t-muted, var(--muted)); transition: color 700ms; }
.theme-stage { display: grid; justify-items: center; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.split { width: 21rem; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.split:focus-visible { outline-offset: 6px; border-radius: 2.5rem; }
.split .screen { background: #000; }
.tlayer { position: absolute; inset: 0; transition: clip-path 650ms cubic-bezier(0.65, 0, 0.35, 1); }
.theme-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 0.3rem; margin-top: 1.5rem; }
.theme-names button { position: relative; padding: 0.6rem 0.7rem 0.75rem; border: 0; background: none; cursor: pointer;
  font: 600 0.95rem/1 var(--sans); color: var(--t-muted, var(--muted)); transition: color 400ms; }
.theme-names button:hover { color: var(--t-ink, var(--ink)); }
.theme-names button[aria-pressed="true"] { color: var(--t-ink, var(--ink)); }
.theme-names button[aria-pressed="true"]::after { content: ""; position: absolute; left: 50%; bottom: 0.15rem; width: 0.3rem; height: 0.3rem; margin-left: -0.15rem;
  border-radius: 50%; background: var(--t-focal, var(--focal)); }
.hint { max-width: 24rem; margin: 0.6rem 0 0; text-align: center; font-size: 0.9rem; }
.hint .for-touch { display: none; }
@media (hover: none) { .hint .for-pointer { display: none; } .hint .for-touch { display: inline; } }

/* ---- The tour: the rest of the app on a turning carousel ------------------------------------ */

/* --d is a phone's place from the front (negative to the left), --a the same without its sign. */
.tour { overflow-x: clip; }
.tour-head { text-align: center; }
.tour-head p { color: var(--muted); font-size: 1.12rem; margin: 0; }
.carousel { --w: 16.5rem; --step: 12.75rem; --turn: 900ms; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (max-width: 40rem) { .carousel { --w: 13rem; --step: 7.5rem; } }
.ring { position: relative; display: grid; justify-items: center; perspective: 1600px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
/* A pool of the focal blue under the phone at the front. */
.ring::before { content: ""; grid-area: 1 / 1; align-self: end; width: calc(var(--w) * 2.2); height: 6rem; margin-bottom: -3rem;
  background: radial-gradient(closest-side, rgb(127 164 255 / 0.22), transparent); pointer-events: none; }
.slide { grid-area: 1 / 1; width: var(--w); margin: 0; --d: 0; --a: 0;
  transform: translateX(calc(var(--d) * var(--step))) translateZ(calc(var(--a) * -6rem)) rotateY(calc(var(--d) * -24deg));
  filter: brightness(calc(1 - var(--a) * 0.24)); opacity: calc(1 - var(--a) * 0.12);
  transition: transform var(--turn) cubic-bezier(0.22, 0.75, 0.2, 1), filter var(--turn), opacity var(--turn); }
.slide:not(.is-front) { cursor: pointer; }
.slide.is-far { opacity: 0; pointer-events: none; }
.slide .phone { width: 100%; }
.slide img { -webkit-user-drag: none; }
.slide figcaption { display: none; }
.tour-caption { text-align: center; width: min(28rem, 100% - 2rem); min-height: 6.5rem; margin: clamp(2rem, 4vw, 2.75rem) auto 0; }
.tour-caption h3 { font: 600 clamp(1.5rem, 2.6vw, 1.9rem)/1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 0.45rem; }
.tour-caption p { margin: 0; color: var(--muted); }
/* The one control: stop or start the turning. A ring round it fills while a phone is at the front. */
.carousel .turn { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin: 1rem auto 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.carousel .turn:hover { color: var(--ink); }
.carousel .turn::before { content: ""; position: absolute; inset: 0.3rem; border-radius: 50%;
  background: conic-gradient(var(--focal) calc(var(--p, 0) * 1turn), var(--line) 0); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 0); mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 0); }
.carousel.is-turning .turn::before { animation: hold-fill var(--hold) linear both; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes hold-fill { to { --p: 1; } }
.carousel .turn svg { position: relative; width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.carousel .turn .i-play { display: none; fill: currentColor; stroke: none; }
.carousel.is-stopped .turn .i-pause { display: none; }
.carousel.is-stopped .turn .i-play { display: block; }
.ring:focus-visible { outline: none; }
.ring:focus-visible .is-front .phone { outline: 3px solid var(--focal); outline-offset: 4px; }
.slide:not(.is-front):hover { filter: brightness(calc(1.12 - var(--a) * 0.24)); }
@media (prefers-reduced-motion: no-preference) {
  .tour-caption.is-new { animation: caption-in 600ms ease-out both; }
}
@keyframes caption-in { from { opacity: 0; transform: translateY(0.4rem); } }
@media (prefers-reduced-motion: reduce) { .carousel { --turn: 1ms; } }

/* ---- Languages ---------------------------------------------------------------------------------- */

.langs { text-align: center; }
.langs-sub { color: var(--muted); max-width: 34rem; margin: 0 auto 3.5rem; font-size: 1.12rem; }
.words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem 3rem; }
.words li { display: grid; justify-items: center; gap: 0.35rem; }
.words .w { font: 400 clamp(2rem, 4.4vw, 3.2rem)/1.15 var(--serif); }
.words .w b { color: var(--focal); font-weight: 700; }
.words .cjk { font-family: var(--cjk); }
.words rt { font: 600 0.32em/1 var(--sans); color: var(--muted); }
.words small { color: var(--muted); font-size: 0.8rem; font-weight: 600; }

/* ---- End card ----------------------------------------------------------------------------------- */

.end { text-align: center; background: radial-gradient(ellipse at 50% 30%, rgb(127 164 255 / 0.08), transparent 60%); }
.wordmark { margin: 0 0 0.5rem; }
.wordmark img { width: min(100%, 22rem); height: auto; }
.end-line { font: 400 clamp(1.3rem, 2.6vw, 1.7rem)/1.3 var(--serif); margin: 0 0 2.25rem; }
.name { color: var(--muted); margin: 3.5rem auto 1rem; max-width: 34rem; }
.promise { color: var(--muted); font-size: 0.95rem; margin: 0; }

footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

/* ---- Policy and other long-form pages ----------------------------------------------------------- */

.doc { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 0.5rem; }
.doc .updated { color: var(--muted); margin: 0 0 2.5rem; }
.doc h2 { font-size: 1.4rem; margin: 2.5rem 0 0.6rem; letter-spacing: -0.01em; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.35rem 0; }
.callout { background: var(--pool); border-radius: 1rem; padding: 1.25rem 1.4rem; margin: 0 0 2rem; font-weight: 600; }
