/* Keeptime — night recital.
   The page is the app's stage: the near-black of its control panel, walnut, lamplit brass.
   Young Serif for display (the Ruby Cat logotype); EB Garamond, the face printed on the app's
   scale, for tempo terms and numerals. Ruby is a spark, used only for focus, selection and hover. */

@font-face {
  font-family: "Young Serif";
  src: url("/fonts/young-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* stage = the app's control panel (#1a140f), so screenshots sit in the page, not on it */
  --stage: oklch(19.7% 0.014 62);
  --stage-deep: oklch(15.5% 0.013 58);
  --lift: oklch(100% 0 0 / 0.035);
  --ink: oklch(91% 0.022 82);
  --soft: oklch(74% 0.026 76);
  --faint: oklch(60% 0.024 70);
  --rule: oklch(91% 0.022 82 / 0.11);
  --brass: oklch(73% 0.085 80);
  --brass-hi: oklch(84% 0.075 86);
  --brass-lo: oklch(58% 0.085 70);
  --walnut: oklch(45% 0.08 55);
  --ruby: oklch(66% 0.18 18);
  --lamp: oklch(62% 0.11 62 / 0.2);
  --serif: "Young Serif", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --garamond: "EB Garamond", "Songti SC", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --grain: 0.07;
}

* { box-sizing: border-box; }
html { background: var(--stage); scroll-padding-top: 24px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--stage);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  overflow-x: hidden;
}
/* the homepage's paper grain, reversed for the night */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: screen;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--ruby); color: var(--stage); }
a { color: inherit; text-underline-offset: 5px; text-decoration-thickness: 1px; text-decoration-color: var(--rule); }
a, button, input { transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease); }
@media (hover: hover) {
  a:hover { color: var(--ruby); text-decoration-color: currentColor; }
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ruby);
  outline-offset: 5px;
  border-radius: 3px;
}
main { overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
figure, p, h1, h2, h3, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(64px, 10.5vw, 150px); line-height: 0.92; letter-spacing: -0.028em; margin-left: -0.04em; }
h2 { font-size: clamp(32px, 3.8vw, 50px); line-height: 1.12; letter-spacing: -0.022em; }
h3 { font-size: 21px; line-height: 1.35; letter-spacing: -0.012em; }
p { text-wrap: pretty; }
:lang(zh-Hans) h2, :lang(zh-Hans) h3 { letter-spacing: 0; line-height: 1.4; }
.shell { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute;
  left: 24px;
  top: -100px;
  z-index: 20;
  background: var(--ink);
  color: var(--stage);
  padding: 12px 20px;
  border-radius: 3px;
}
.skip:focus { top: 12px; }

/* header: the homepage's quiet meta line, with the wordmark set as the logotype */
.site-header {
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: env(safe-area-inset-top);
}
.wordmark { font-family: "Young Serif", Georgia, serif; font-size: 24px; letter-spacing: -0.028em; text-decoration: none; white-space: nowrap; }
.wordmark span, .wm span { color: var(--ruby); }
.wm { font-family: "Young Serif", Georgia, serif; letter-spacing: -0.012em; color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--soft); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-nav .language { text-transform: none; letter-spacing: 0; color: var(--ink); }

.eyebrow {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--soft);
}

/* hero: the title sits on the baseline, the screen stands under a lamp */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: end;
  gap: 64px;
  padding-block: 56px 96px;
}
.hero-copy { padding-bottom: 72px; }
.hero-copy h1 { margin-top: 28px; }
.lead { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.35; letter-spacing: -0.012em; max-width: 19em; margin-top: 36px; }
:lang(zh-Hans) .lead { letter-spacing: 0; line-height: 1.6; }
.description { color: var(--soft); max-width: 30em; margin-top: 16px; }
.availability { display: flex; align-items: center; gap: 10px; margin-top: 36px; font-size: 13px; color: var(--soft); }
.availability::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 12px var(--brass); flex: none; }

.screen { position: relative; isolation: isolate; }
.screen::before {
  content: "";
  position: absolute;
  inset: -30% -60% 10%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--lamp), transparent);
}
.screen img {
  border-radius: 13% / 6%;
  outline: 1px solid oklch(100% 0 0 / 0.1);
  outline-offset: -1px;
  box-shadow: 0 50px 100px -30px oklch(8% 0.02 50 / 0.9);
}
.hero-screen { width: min(100%, 330px); justify-self: center; }
figcaption {
  font-family: var(--garamond);
  font-style: italic;
  color: var(--faint);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 16px;
  text-align: center;
}
:lang(zh-Hans) figcaption { font-style: normal; font-size: 13px; }

/* tempo: the drawn pendulum and the brass ruler */
.tempo {
  background: var(--stage-deep);
  box-shadow: inset 0 1px var(--rule), inset 0 -1px var(--rule);
  padding-block: 96px 64px;
}
.tempo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
  align-items: center;
}
.pendulum { position: relative; isolation: isolate; max-width: 440px; width: 100%; justify-self: center; }
.pendulum::before {
  content: "";
  position: absolute;
  inset: -10% -30% 0;
  z-index: -1;
  background: radial-gradient(closest-side at 50% 45%, var(--lamp), transparent);
}
.pd-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pd-drawing { display: block; width: 100%; height: auto; overflow: visible; }
.pd-plinth { fill: oklch(33% 0.06 52); }
.pd-body { fill: oklch(29% 0.055 52); }
.pd-cap { fill: oklch(35% 0.062 52); }
.pd-plinth, .pd-body, .pd-cap { stroke: oklch(73% 0.085 80 / 0.35); stroke-width: 0.4; }
.pd-recess { fill: oklch(13% 0.012 55); }
.pd-plate { fill: oklch(86% 0.03 85); }
.pd-ticks line { stroke: oklch(32% 0.03 60); stroke-width: 0.35; }
.pd-rod { fill: oklch(82% 0.018 85); }
.pd-weight { fill: var(--brass); stroke: var(--brass-lo); stroke-width: 0.5; transition: transform 320ms var(--ease); }
.pd-boss { fill: var(--brass-lo); stroke: var(--brass); stroke-width: 0.6; }
.pd-swing { transform-box: view-box; transform-origin: 120px 222px; }
/* before the script runs (or without it), the pendulum swings at 76 BPM: one beat per side */
.tempo:not([data-live]) .pd-swing { animation: pd-swing 789ms ease-in-out infinite alternate; }
@keyframes pd-swing {
  from { transform: rotate(-30deg); }
  to { transform: rotate(30deg); }
}
.tempo:not([data-live]) .ruler,
.tempo:not([data-live]) .note { display: none; }

.tempo-copy h2 { margin-top: 20px; }
.tempo-text { color: var(--soft); max-width: 30em; margin-top: 20px; }
.readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 40px;
  min-height: 92px;
}
.lamp {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--brass-hi);
  box-shadow: 0 0 14px var(--brass);
  opacity: 0.22;
  align-self: center;
}
.bpm {
  font-family: var(--garamond);
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 88px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.unit { font-size: 12px; letter-spacing: 0.04em; color: var(--soft); }
.term { font-family: var(--garamond); font-style: italic; font-size: 34px; line-height: 1; color: var(--brass); margin-left: 8px; }

/* the ruler at the app's base: brass bar, ticks every 4 BPM, Garamond figures */
.ruler { position: relative; height: 56px; margin-top: 20px; --thumb: 16px; border-radius: 3px; }
.ruler::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, oklch(30% 0.04 60 / 0.75) 0 1px, transparent 1px calc((100% - 1px) / 42))
      calc(var(--thumb) / 2) 0 / calc(100% - var(--thumb) + 1px) 9px no-repeat,
    linear-gradient(180deg, var(--brass-hi), var(--brass) 45%, var(--brass-lo));
  box-shadow: inset 0 1px oklch(100% 0 0 / 0.35), 0 8px 20px -8px oklch(5% 0.02 50 / 0.9);
}
.ruler-scale { position: absolute; inset: 8px 0; pointer-events: none; }
.ruler-scale span {
  position: absolute;
  bottom: 4px;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at));
  transform: translateX(-50%);
  font-family: var(--garamond);
  font-variant-numeric: lining-nums;
  font-size: 17px;
  line-height: 1;
  color: oklch(27% 0.035 60);
}
.ruler-scale span:first-child { transform: translateX(-25%); }
.ruler-scale span:last-child { transform: translateX(-75%); }
.ruler input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
}
.ruler input:active { cursor: grabbing; }
.ruler input:focus { outline: none; }
.ruler:has(input:focus-visible) { outline: 2px solid var(--ruby); outline-offset: 6px; }
.ruler input::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.ruler input::-moz-range-track { height: 100%; background: transparent; border: 0; }
.ruler input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb);
  height: 56px;
  border: 0;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 7px, oklch(30% 0.04 60) 7px 9px, transparent 9px),
    linear-gradient(180deg, var(--brass-hi), var(--brass-lo));
  box-shadow: 0 0 0 1px oklch(30% 0.04 60 / 0.6), 0 6px 14px oklch(5% 0.02 50 / 0.7);
  transition: transform 160ms var(--ease);
}
.ruler input::-moz-range-thumb {
  width: var(--thumb);
  height: 56px;
  border: 0;
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 7px, oklch(30% 0.04 60) 7px 9px, transparent 9px),
    linear-gradient(180deg, var(--brass-hi), var(--brass-lo));
  box-shadow: 0 0 0 1px oklch(30% 0.04 60 / 0.6), 0 6px 14px oklch(5% 0.02 50 / 0.7);
  transition: transform 160ms var(--ease);
}
.ruler input:active::-webkit-slider-thumb { transform: scale(0.96); }
.ruler input:active::-moz-range-thumb { transform: scale(0.96); }
.note { margin-top: 18px; font-size: 13px; color: var(--faint); }

.specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 88px;
  border-top: 1px solid var(--rule);
}
.specs div { padding: 20px 24px 0 0; }
.specs div + div { padding-left: 24px; box-shadow: inset 1px 0 var(--rule); }
.specs dt { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.specs dd { font-family: var(--serif); font-size: 21px; line-height: 1.35; letter-spacing: -0.012em; }

/* how to use: a ledger, as on the homepage */
.section { padding-block: 112px; }
.practice { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr); gap: 64px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 64px minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: baseline;
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps .number { font-family: var(--garamond); font-style: italic; font-variant-numeric: lining-nums; font-size: 28px; line-height: 1; color: var(--brass); }
.steps p { color: var(--soft); font-size: 15px; }

/* tabletop: the Duo with its fold marked */
.tabletop-wrap { background: var(--stage-deep); box-shadow: inset 0 1px var(--rule), inset 0 -1px var(--rule); }
.tabletop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 96px; align-items: center; padding-block: 96px; }
.fold { width: min(100%, 400px); justify-self: center; }
.fold-frame { position: relative; isolation: isolate; }
.fold-frame::before {
  content: "";
  position: absolute;
  inset: -20% -40% 30%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--lamp), transparent);
}
.fold-frame img {
  border-radius: 4% / 2.8%;
  outline: 1px solid oklch(100% 0 0 / 0.1);
  outline-offset: -1px;
  box-shadow: 0 50px 100px -30px oklch(6% 0.02 50 / 0.9);
}
/* the screenshot's fold sits at 683 of 1422 px */
.fold-line {
  position: absolute;
  top: 48.03%;
  left: -20px;
  right: -20px;
  border-top: 1px dashed oklch(73% 0.085 80 / 0.55);
}
.fold-line em {
  position: absolute;
  right: 0;
  top: -1.55em;
  font-family: var(--garamond);
  font-size: 15px;
  color: var(--brass);
}
:lang(zh-Hans) .fold-line em { font-style: normal; font-size: 12px; top: -2em; }
.tabletop-copy p { color: var(--soft); margin-top: 20px; max-width: 30em; }

/* support: the address is the anchor */
.support { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 96px; align-items: start; }
.support-intro p { margin-top: 20px; color: var(--soft); font-size: 15px; max-width: 28em; }
.support-intro .mail + p { margin-top: 20px; }
.mail {
  display: inline-block;
  margin-top: 6px;
  font-family: "Young Serif", Georgia, serif;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.012em;
  line-height: 1.3;
  text-decoration-color: var(--brass-lo);
  text-underline-offset: 7px;
  overflow-wrap: anywhere;
}
.text-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font-size: 14px; }
.questions div { padding-block: 28px; border-top: 1px solid var(--rule); }
.questions div:first-child { border-top: 0; padding-top: 6px; }
.questions dt { font-family: var(--serif); font-size: 21px; line-height: 1.4; letter-spacing: -0.012em; }
:lang(zh-Hans) .questions dt { letter-spacing: 0; font-size: 19px; }
.questions dd { margin-top: 10px; color: var(--soft); font-size: 15px; max-width: 36em; }

.site-footer {
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-block: 16px calc(32px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--soft);
}
.site-footer .wm { font-size: 15px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* privacy pages */
.legal-header { padding-block: 64px 48px; max-width: 800px; }
.legal-header h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.05; }
:lang(zh-Hans) .legal-header h1 { line-height: 1.3; letter-spacing: 0; }
.legal-header .lead { font-family: var(--sans); font-size: 18px; line-height: 1.7; letter-spacing: 0; max-width: 34em; margin-top: 28px; color: var(--soft); }
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 72px; padding-bottom: 96px; align-items: start; }
.legal-index { position: sticky; top: 24px; font-size: 14px; }
.legal-index ol { margin: 0; padding: 0; list-style: none; }
.legal-index a { display: inline-flex; align-items: center; min-height: 40px; color: var(--soft); text-decoration: none; font-variant-numeric: tabular-nums; }
.legal-body section { border-top: 1px solid var(--rule); padding-top: 32px; margin-top: 40px; }
.legal-body section:first-child { margin-top: 0; }
.legal-body h2 { font-size: 26px; line-height: 1.3; letter-spacing: -0.012em; }
.legal-body p, .legal-body ul { margin-top: 16px; }
.legal-body p, .legal-body li { color: var(--soft); }
.legal-body ul { padding-left: 22px; }
.legal-body li + li { margin-top: 8px; }
.legal-body li::marker { color: var(--brass); }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body a { text-decoration-color: var(--brass-lo); }

/* entrance, as on the homepage */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.rise { animation: rise 700ms var(--ease) both; }
.hero-copy .rise:nth-child(2) { animation-delay: 90ms; }
.hero-copy .rise:nth-child(3) { animation-delay: 180ms; }
.hero-copy .rise:nth-child(4) { animation-delay: 240ms; }
.hero-copy .rise:nth-child(5) { animation-delay: 300ms; }
.hero-screen { animation: rise 900ms 160ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .rise, .hero-screen, .tempo:not([data-live]) .pd-swing { animation: none; }
  .pd-weight, .ruler input::-webkit-slider-thumb { transition: none; }
}

@media (max-width: 900px) {
  .hero { gap: 40px; }
  .hero-copy { padding-bottom: 32px; }
  .tempo-grid, .tabletop, .support { gap: 48px; }
  .practice { grid-template-columns: 1fr; gap: 32px; }
  .legal-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 40px); }
  .site-header { min-height: 72px; gap: 12px; }
  .wordmark { font-size: 22px; }
  .site-nav { gap: 18px; font-size: 12px; }
  .hero { grid-template-columns: 1fr; padding-block: 24px 64px; gap: 48px; }
  .hero-copy { padding-bottom: 0; }
  .hero-screen { width: min(78%, 280px); }
  .tempo { padding-block: 64px 48px; }
  /* the copy's children join the grid so the pendulum sits between the words and the ruler */
  .tempo-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .tempo-copy { display: contents; }
  .tempo-copy .eyebrow { order: 1; }
  .tempo-copy h2 { order: 2; }
  .tempo-text { order: 3; }
  .pendulum { order: 4; align-self: center; width: min(82%, 320px); margin-top: 40px; }
  .readout { order: 5; margin-top: 32px; min-height: 0; }
  .ruler { order: 6; }
  .note { order: 7; }
  .bpm { font-size: 72px; }
  .term { font-size: 28px; }
  .specs { grid-template-columns: 1fr 1fr; margin-top: 56px; }
  .specs div { padding: 18px 12px 18px 0; }
  .specs div + div { padding-left: 0; box-shadow: none; }
  .specs div:nth-child(even) { padding-left: 16px; box-shadow: inset 1px 0 var(--rule); }
  .specs div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .specs dd { font-size: 18px; }
  .section { padding-block: 72px; }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; padding-block: 22px; }
  .steps li p { grid-column: 2; }
  .steps .number { font-size: 24px; }
  .tabletop { grid-template-columns: 1fr; padding-block: 64px; gap: 40px; }
  .tabletop-copy { grid-row: 1; }
  .fold { width: min(88%, 340px); }
  .fold-line { left: -8px; right: -8px; }
  .support { grid-template-columns: 1fr; gap: 40px; }
  .legal-header { padding-top: 32px; }
  .legal-layout { grid-template-columns: 1fr; gap: 32px; }
  .legal-index { position: static; }
  .legal-index ol { display: flex; flex-wrap: wrap; column-gap: 20px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 0; }
}
