/* Structure of every page. style.css sets the tokens below, for light and dark, and the look on top;
   nothing here picks colours or typefaces of its own. */

:root {
  --bg: #fff;
  --fg: #111;
  --muted: #555;
  --line: rgba(0, 0, 0, 0.12);
  --surface: #f4f4f4;
  --accent: #ff9f0a;
  --accent-ink: #111;
  --accent-text: #b36b00;
  --pad-light: #eee;
  --pad-dark: #3a3a3a;
  --font-display: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --radius: 16px;
  --width: 1080px;
  --gutter: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.wrap {
  width: min(var(--width), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* Clipped rather than moved off-screen, which in right-to-left pages would widen the page sideways. */
.skip {
  position: absolute;
  inset-inline-start: var(--gutter);
  top: var(--gutter);
  z-index: 10;
  background: var(--bg);
  padding: 8px 12px;
}

.skip:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.top nav {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.95rem;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
}

.top nav a:hover,
.top nav a[aria-current] {
  color: var(--fg);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  padding-block: 56px 88px;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.75em;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 34em;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}

.store svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.store small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.cta .req {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Watch: a playable model of the app's main screen. */

.watch {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: calc(min(270px, 72vw) * 0.24 + 20px);
  padding-top: calc(min(270px, 72vw) * 0.24);
}

.watch-body {
  position: relative;
  width: min(270px, 72vw);
  aspect-ratio: 0.84;
  /* Everything on the screen is sized in em, so the watch scales as a whole. */
  font-size: calc(min(270px, 72vw) * 0.052);
}

/* The band, behind the case. */
.watch-body::before {
  content: "";
  position: absolute;
  inset: -20% 18%;
  border-radius: 24px;
  background: var(--band, #2a2a2a);
  z-index: -1;
}

.watch-case {
  position: absolute;
  inset: 0;
  border-radius: 26%/22%;
  padding: 7%;
  background: var(--case, linear-gradient(145deg, #3b3b3d, #151516));
  box-shadow: var(--case-shadow, 0 30px 60px rgba(0, 0, 0, 0.35));
}

/* The crown sets the volume, or the tuning while that's open: wheel, drag or arrow keys. Its ridges move as it turns. */
.watch-crown {
  position: absolute;
  right: -3.5%;
  top: 24%;
  width: 5%;
  height: 16%;
  border-radius: 4px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 4px),
    var(--crown, linear-gradient(90deg, #444, #222));
  cursor: ns-resize;
  touch-action: none;
}

/* A larger target than the crown itself, for fingers. */
.watch-crown::before {
  content: "";
  position: absolute;
  inset: -14px -16px -14px -6px;
}

.watch-crown:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.watch-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20%/17%;
  background: #000;
  padding: 9% 3% 4%;
  display: flex;
  flex-direction: column;
  gap: 4%;
  overflow: hidden;
  color: #fff;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.watch-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4em;
  padding-inline: 4% 6%;
  font-weight: 600;
  font-size: 0.82em;
  line-height: 1;
}

.watch-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* The instrument next to the clock, as in the app's toolbar; tuned off 440 Hz, the pitch in its place. */
.watch-instrument {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-width: 0;
  max-width: 70%;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.watch-instrument span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-instrument .tuned {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.watch-screen button:focus-visible,
.watch-screen [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Six octaves of pads side by side, three columns of four in view. */
.pads {
  position: relative;
  flex: 1;
  overflow: hidden;
  /* Sideways is the pads'; up and down still scroll the page on touch. */
  touch-action: pan-y;
}

.pads-pull {
  position: absolute;
  inset: 0;
}

.pads-strip {
  position: absolute;
  inset: 0 auto 0 0;
  width: 600%;
  display: flex;
  will-change: transform;
}

.pad-column {
  flex: 1 1 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  padding-inline: 2px;
}

/* A wider gap where one octave ends and the next begins. */
.pad-column.octave-start {
  padding-left: 5px;
}

.pad-column.octave-end {
  padding-right: 5px;
}

.pad {
  all: unset;
  position: relative;
  z-index: 0;
  cursor: pointer;
  border-radius: 22%/30%;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 1em;
  line-height: 1;
  background: var(--pad-dark);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.pad.light {
  background: var(--pad-light);
  color: #000;
}

/* c, with its octave and in bold, as in the app. */
.pad.home {
  font-weight: 700;
}

/* Above its neighbours, so its glow spills over them. */
.pad.sounding {
  z-index: 1;
}

/* The accent over the pad being heard, as bright as the note is loud; set from watch.js as it sounds. */
.pad-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent);
  opacity: 0;
  transition: opacity 0.35s ease-out;
  pointer-events: none;
}

.pad-glow.live {
  transition: none;
}

/* The last note played or held. */
.pad.marked::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--accent);
  pointer-events: none;
}

/* Held "na ucho": flashes in the rhythm of a double tap until it's played or let go. */
.pad.armed::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0.15;
  animation: armed 1.51s infinite;
  pointer-events: none;
}

@keyframes armed {
  0% { opacity: 0.15; animation-timing-function: ease-in-out; }
  9.3% { opacity: 0.75; animation-timing-function: ease-in-out; }
  21.2% { opacity: 0.25; animation-timing-function: ease-in-out; }
  30.5% { opacity: 0.75; animation-timing-function: ease-in-out; }
  53.6% { opacity: 0.15; }
  100% { opacity: 0.15; }
}

.pad-pinch {
  position: absolute;
  top: 0.3em;
  right: 0.3em;
  z-index: 4;
  width: 0.75em;
  height: 0.75em;
  display: none;
}

.pad.armed .pad-pinch {
  display: block;
}

/* Pulled up past the bottom: where letting go jumps to. */
.pull-hint {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  height: 0;
  overflow: hidden;
  font-size: 0.72em;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  pointer-events: none;
}

.watch-badge {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 5;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  background: rgba(58, 58, 60, 0.92);
  font-weight: 700;
  font-size: 1.15em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.3s ease-out, transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
  pointer-events: none;
}

.watch-badge.shown {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* The crown's level beside it while it turns: filled for the volume, a dot for the tuning. */
.watch-level {
  position: absolute;
  top: 24%;
  right: 3px;
  z-index: 30;
  padding: 3px;
  border-radius: 999px;
  background: rgba(30, 30, 31, 0.92);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
}

.watch-level.shown {
  opacity: 1;
  transition-duration: 0.15s;
}

.watch-level-track {
  position: relative;
  width: 5px;
  height: 3.6em;
  border-radius: 999px;
  background: #404040;
  overflow: hidden;
}

.watch-level-fill {
  position: absolute;
  inset: auto 0 0;
  border-radius: 999px;
  background: var(--accent);
  transition: height 0.15s, bottom 0.15s;
}

.watch-level.dot .watch-level-fill {
  height: 5px;
}

/* The instrument list and the tuning, as a sheet over the pads. */
.watch-sheet {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #000;
  overflow: hidden;
  transform: translateY(102%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
}

.watch-sheet.open {
  transform: none;
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.sheet-page {
  position: absolute;
  inset: 0;
  padding: 9% 7% 6%;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, visibility 0s;
}

.sheet-list {
  overflow-y: auto;
  scrollbar-width: none;
}

.sheet-dial {
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s;
}

.watch-sheet.dial-open .sheet-dial {
  transform: none;
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.watch-sheet.dial-open .sheet-list {
  transform: translateX(-30%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, visibility 0s 0.3s;
}

.sheet-bar {
  display: flex;
  align-items: center;
  gap: 0.45em;
  min-height: 1.9em;
  flex: none;
}

.sheet-bar h2 {
  flex: 1;
  margin: 0;
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-bar .time {
  font-size: 0.82em;
  font-weight: 600;
}

.round {
  all: unset;
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
}

.round .watch-icon {
  width: 0.95em;
  height: 0.95em;
}

.round[hidden] {
  display: grid;
  visibility: hidden;
}

.sheet-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25em;
}

.sheet-rows + .sheet-rows {
  margin-top: 0.4em;
}

.sheet-row {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.65em 0.7em;
  border-radius: 0.8em;
  background: #222;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
}

.sheet-row .watch-icon {
  width: 1.3em;
}

.sheet-row .end {
  margin-left: auto;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}

.sheet-row .end.tuned,
.sheet-row .check {
  color: var(--accent);
}

.sheet-row .check {
  margin-left: auto;
}

.dial-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.dial-value {
  display: grid;
  justify-items: center;
  gap: 0.15em;
  border-radius: 0.6em;
  padding: 0 0.3em;
  font-variant-numeric: tabular-nums;
}

.dial-value .hz {
  font-size: 3em;
  font-weight: 700;
  line-height: 1;
}

.dial-value .hz small {
  font-size: 0.38em;
  color: #8e8e93;
  margin-left: 0.1em;
}

.dial-value .caption {
  font-size: 0.68em;
  color: #8e8e93;
}

.fork {
  all: unset;
  display: grid;
  place-items: center;
  padding: 0.45em 1.6em;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  cursor: pointer;
}

/* Beside the watch while a note is held "na ucho": the ear, then the hand, which double taps; then the note flows
   to the ear. watch.js sizes them to the room beside the watch (--hand-gap, --hand-size, --ear-gap, --ear-size). */
.watch-hand,
.watch-ear {
  position: absolute;
  top: 46%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) scale(0.6);
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1), visibility 0s 0.4s;
  pointer-events: none;
}

.watch-hand {
  right: calc(100% + var(--hand-gap));
  width: var(--hand-size);
  color: var(--fg);
}

.watch-ear {
  left: calc(103.5% + var(--ear-gap));
  width: var(--ear-size);
  color: var(--muted);
}

.watch-hand svg,
.watch-ear svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.watch.ear-shown .watch-ear,
.watch.hand-shown .watch-hand {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
  transition-delay: 0s;
}

/* Two pinches, in the rhythm of the pad's flashes: the index finger meets the thumb, and where they meet, it sparks. */
.hand-index {
  transform-box: view-box;
  transform-origin: 21px 9px;
}

.watch.tapping .hand-index {
  animation: pinch 0.7s ease-in-out;
}

@keyframes pinch {
  0%, 36%, 72%, 100% { transform: none; }
  18%, 54% { transform: rotate(12deg); }
}

.hand-spark {
  fill: var(--accent);
  opacity: 0;
}

.watch.tapping .hand-spark {
  animation: spark 0.7s ease-out;
}

@keyframes spark {
  0%, 12%, 32%, 48%, 68%, 100% { opacity: 0; }
  18%, 54% { opacity: 1; }
}

/* Waves from the crown's side of the watch to the ear's middle. */
.sound-flow {
  position: absolute;
  top: 46%;
  left: 103.5%;
  width: calc(var(--ear-gap) + var(--ear-size) / 2);
  height: 13%;
  transform: translateY(-50%);
  pointer-events: none;
}

.sound-flow svg {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0;
}

.watch.flowing .sound-flow svg {
  animation: flow 0.8s ease-in;
}

.watch.flowing .sound-flow svg:nth-child(2) {
  animation-delay: 0.15s;
}

.watch.flowing .sound-flow svg:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes flow {
  0% { left: -10%; opacity: 0; }
  25% { opacity: 1; }
  100% { left: 85%; opacity: 0; }
}

.watch.hearing .watch-ear {
  color: var(--accent);
  animation: hear 0.6s ease-out;
}

@keyframes hear {
  0% { transform: translateY(-50%); }
  35% { transform: translateY(-50%) scale(1.15); }
  100% { transform: translateY(-50%); }
}

/* The first hold: how a note held "na ucho" gets played. */
.ear-hint {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #000;
  padding: 12% 9% 8%;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  text-align: center;
  font-size: 0.8em;
  line-height: 1.3;
}

.ear-hint[hidden] {
  display: none;
}

.ear-hint .watch-icon {
  width: 1.8em;
  height: 1.8em;
  color: var(--accent);
}

.ear-hint p {
  margin: 0;
}

.ear-hint p + p {
  color: #8e8e93;
}

.ear-hint button {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  margin-top: 0.3em;
  padding: 0.55em;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

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

.watch figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* Sections */

.section {
  padding-block: 72px;
}

.section-head {
  max-width: 40em;
  margin-bottom: 40px;
}

.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.015em;
}

.section-head p {
  color: var(--muted);
  font-size: 1.15rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
}

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

.card p {
  color: var(--muted);
  margin: 0;
}

.card .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  color: var(--accent-text);
}

/* "Na ucho": three steps. */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.steps li {
  counter-increment: step;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 1.1rem/1 var(--font-display);
}

.steps h3 {
  font-size: 1.2rem;
}

.steps p {
  color: var(--muted);
  margin: 0;
}

.aside {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 44em;
}

/* Features: a dense list. */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.features li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.features strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.features span {
  color: var(--muted);
}

/* Privacy callout */

.promise {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 40px;
  border-radius: calc(var(--radius) * 1.5);
  background: var(--surface);
}

.promise svg {
  width: 64px;
  height: 64px;
  color: var(--accent-text);
}

.promise h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

.promise p {
  color: var(--muted);
  margin: 0;
}

/* Text pages: privacy and support. */

.doc {
  max-width: 44em;
  padding-block: 40px 88px;
}

.doc h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
}

.doc h2 {
  font-size: 1.4rem;
  margin-top: 2em;
}

.doc .meta {
  color: var(--muted);
}

.doc ul {
  padding-inline-start: 1.2em;
}

.doc li {
  margin-bottom: 0.4em;
}

.doc details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.doc details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.doc summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.doc details p {
  margin: 12px 0 0;
  color: var(--muted);
}

.contact {
  margin-top: 40px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--surface);
}

.contact p:last-child {
  margin: 0;
}

.contact a {
  color: var(--accent-text);
  font-weight: 600;
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 32px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--fg);
}

/* Narrow screens */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 72px;
    padding-block: 24px 64px;
  }

  .cards,
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .features {
    grid-template-columns: 1fr;
  }

  .promise {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .section {
    padding-block: 48px;
  }

  .top nav a.hide-narrow {
    display: none;
  }
}

/* Light/dark toggle in the header: one icon for the current choice (see theme.js). */

.theme-toggle {
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-inline-start: 4px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
}

.theme-toggle:hover {
  color: var(--fg);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: none;
}

:root:not([data-theme-choice]) .theme-toggle .system,
:root[data-theme-choice="system"] .theme-toggle .system,
:root[data-theme-choice="light"] .theme-toggle .light,
:root[data-theme-choice="dark"] .theme-toggle .dark {
  display: block;
}

.top nav {
  align-items: center;
}

/* Language menu in the header. */

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

.lang-menu {
  position: relative;
}

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

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

.lang-menu summary:hover,
.lang-menu[open] summary {
  color: var(--fg);
}

.lang-menu summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-menu svg {
  width: 18px;
  height: 18px;
}

.lang-menu ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 6px;
  width: max-content;
  min-width: 200px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.top nav .lang-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--fg);
}

.top nav .lang-menu a:hover {
  background: var(--line);
}

.top nav .lang-menu a[aria-current] {
  color: var(--accent-text);
  font-weight: 600;
}

@media (max-width: 600px) {
  .lang-name {
    display: none;
  }
}

/* Scripts without capitals or italics: no letter spacing (it breaks Arabic's joined letters) and no
   slanted emphasis, which these scripts don't use; the accent colour carries it. */

:lang(ar) .eyebrow,
:lang(he) .eyebrow,
:lang(ja) .eyebrow,
:lang(ko) .eyebrow,
:lang(zh) .eyebrow {
  letter-spacing: 0;
}

:lang(ar) em,
:lang(he) em,
:lang(ja) em,
:lang(ko) em,
:lang(zh) em {
  font-style: normal;
}

:lang(ja) h1,
:lang(ja) h2,
:lang(ko) h1,
:lang(ko) h2,
:lang(zh) h1,
:lang(zh) h2 {
  letter-spacing: 0;
  line-height: 1.25;
  word-break: keep-all;
}

:lang(ar) h1,
:lang(ar) h2,
:lang(he) h1,
:lang(he) h2 {
  letter-spacing: 0;
  line-height: 1.3;
}

/* Accessibility, as in the app: increased contrast, reduced motion, and the system's forced colours. */

@media (prefers-contrast: more) {
  .pad {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  }

  /* Not by colour alone: the sounding pad also gets a ring. */
  .pad.sounding {
    outline: 3px solid #fff;
    outline-offset: -3px;
  }

  .lang-menu summary,
  .theme-toggle {
    border-color: var(--fg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  /* A held note's pad lit steadily rather than flashing. */
  .pad.armed::before {
    animation: none;
    opacity: 0.45;
  }

  /* The hand only sparks, and the ear lights up without the waves moving. */
  .watch.tapping .hand-index,
  .watch.flowing .sound-flow svg,
  .watch.hearing .watch-ear {
    animation: none;
  }
}

@media (forced-colors: active) {
  .pad {
    border: 1px solid CanvasText;
  }

  .pad-glow {
    background: Highlight;
    color: HighlightText;
  }

  .pad.marked::after {
    box-shadow: inset 0 0 0 3px Highlight;
  }

  .steps li::before {
    border: 1px solid CanvasText;
  }
}
