/* Atkinson Hyperlegible, Caprasimo, IBM Plex Mono — SIL Open Font License 1.1.
   See fonts/NOTICE.txt. */

@font-face {
  font-family: "Caprasimo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/caprasimo.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-bold.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/plexmono.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --wall: #d7e4ec;
  --glow: #f7fbfd;
  --ink: #172033;
  --muted: #3c4b5e;
  --teal: #0c6574;
  --cyan: #1aa3b5;
  --paper: #fbf6ee;
  --btn: #172033;
  --btn-text: #fbf6ee;
  --btn-sub: #c9d4e2;
  --line: rgba(23, 32, 51, 0.16);
  --display: "Caprasimo", "American Typewriter", "Iowan Old Style", "Songti SC", serif;
  --font: "Atkinson Hyperlegible", "PingFang SC", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --wall: #0e1419;
    --glow: #1a3340;
    --ink: #f4efe6;
    --muted: #c5d0db;
    --teal: #8fd8e2;
    --btn: #fbf6ee;
    --btn-text: #172033;
    --btn-sub: #3c4b5e;
    --line: rgba(244, 239, 230, 0.16);
  }

  body::before {
    opacity: 0.08;
    mix-blend-mode: overlay;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--wall);
  background-image: radial-gradient(ellipse 90% 55% at 100% -10%, var(--glow), transparent 58%);
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
}

::selection {
  background: #ffe56b;
  color: #172033;
}

img, svg { display: block; }

button, input { font: inherit; }

h1, h2, p { margin: 0; }

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

a { color: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 30;
  background: var(--paper);
  color: #172033;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus { top: 46px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.bar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 14px;
  background: #141c27;
  color: #f4efe6;
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
}

.brand img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock {
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.bar-status { white-space: nowrap; }

body[data-state="active"] .bar-status,
body[data-state="grace"] .bar-status { color: #ffb4aa; }

.bar-mic {
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  color: #f4efe6;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.bar-mic:hover { background: rgba(255, 255, 255, 0.08); }

.bar-mic svg { width: 22px; height: 22px; }

.slash { opacity: 0; }

body[data-state="active"] .bar-mic .slash,
body[data-state="grace"] .bar-mic .slash { opacity: 1; }

.wrap {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 38px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.9fr);
  column-gap: 48px;
  align-items: center;
  padding: 42px 0 8px;
}

.kicker { grid-column: 1 / -1; }

.hero h1 {
  grid-column: 1 / -1;
  min-width: 0;
  margin-bottom: 26px;
  font-size: clamp(52px, 6.6vw, 84px);
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(46px, 6.2vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.02em;
}

h1 .accent {
  padding-left: 0.16em;
  color: var(--teal);
}

html[lang="zh-Hans"] {
  --display: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "Songti TC", serif;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

html[lang="zh-Hans"] h1,
html[lang="zh-Hans"] .shout h2 {
  letter-spacing: 0;
}

html[lang="zh-Hans"] h1 .accent { padding-left: 0; }

html[lang="zh-Hans"] .kicker { letter-spacing: 0.06em; text-transform: none; }

.lang {
  display: flex;
  border: 1px solid rgba(244, 239, 230, 0.28);
  border-radius: 999px;
  overflow: hidden;
}

.lang button {
  border: 0;
  background: transparent;
  color: rgba(244, 239, 230, 0.72);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: #f4efe6;
  color: #141c27;
}

.lede {
  max-width: 36rem;
  font-size: 19px;
  line-height: 1.45;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
  margin-top: 26px;
}

.dl {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  background: var(--btn);
  color: var(--btn-text);
  padding: 13px 20px 14px;
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--cyan);
}

.dl strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dl small {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--btn-sub);
}

.dl:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--cyan); }
.dl:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cyan); }

.textlink {
  font-weight: 700;
  text-underline-offset: 4px;
}

.textlink:hover { color: var(--teal); }

.fine {
  margin-top: 14px;
  max-width: 34rem;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
}

.demo { min-width: 0; }

.radio {
  position: relative;
  max-width: 460px;
  margin-left: auto;
  padding: 18px 18px 16px;
  border-radius: 32px;
  color: #f4efe6;
  background: linear-gradient(180deg, #2c5086 0%, #1a3358 32%, #152a4a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 18px 40px rgba(20, 40, 70, 0.22);
}

.stage-top {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  height: 148px;
}

.grille {
  position: relative;
  border-radius: 16px;
  background-color: #0d1828;
  background-image: radial-gradient(rgba(198, 216, 230, 0.5) 1.05px, transparent 1.25px);
  background-size: 7px 7px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 22px rgba(0, 0, 0, 0.4);
}

.cone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #7fd7e2 0 4px, #16324f 5px 15px, #0c1624 16px 100%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.sky {
  position: relative;
  overflow: hidden;
}

.arcs {
  position: absolute;
  left: 0;
  top: 30px;
  width: 58px;
  height: 88px;
  transition: opacity 0.35s ease;
}

.arc {
  fill: none;
  stroke: #f6e2a8;
  stroke-width: 3;
  stroke-linecap: round;
  animation: puff 1.7s ease-in-out infinite;
}

.a2 { animation-delay: 0.18s; }
.a3 { animation-delay: 0.36s; }

@keyframes puff {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.95; }
}

body[data-mode="pause"][data-state="active"] .arcs,
body[data-mode="pause"][data-state="grace"] .arcs { opacity: 0; }

body[data-mode="mute"][data-state="active"] .arcs,
body[data-mode="mute"][data-state="grace"] .arcs { opacity: 0.22; }

.note {
  position: absolute;
  color: #f6e2a8;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

.note svg { width: 26px; height: 36px; }

.note i {
  display: block;
  font-style: normal;
  animation: bob 2.8s ease-in-out infinite;
}

.n1 { top: 18px; left: 30%; }
.n2 { top: 64px; left: 52%; }
.n2 i { animation-duration: 3.3s; animation-delay: -1.1s; }
.n3 { top: 12px; left: 73%; }
.n3 i { animation-duration: 2.4s; animation-delay: -0.5s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

body[data-mode="pause"][data-state="active"] .n1,
body[data-mode="pause"][data-state="grace"] .n1 { transform: translateY(74px); }

body[data-mode="pause"][data-state="active"] .n2,
body[data-mode="pause"][data-state="grace"] .n2 { transform: translateY(28px); }

body[data-mode="pause"][data-state="active"] .n3,
body[data-mode="pause"][data-state="grace"] .n3 { transform: translateY(80px); }

body[data-mode="pause"][data-state="active"] .note i,
body[data-mode="pause"][data-state="grace"] .note i { animation-play-state: paused; }

body[data-mode="mute"][data-state="active"] .note,
body[data-mode="mute"][data-state="grace"] .note { opacity: 0.2; }

.lcd {
  margin-top: 12px;
  padding: 11px 12px 10px;
  border-radius: 12px;
  background: #0e2038;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.lcd-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.led {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  flex: none;
  border-radius: 50%;
  background: #2f9d55;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body[data-state="active"] .led { background: #ff4b3e; }
body[data-state="grace"] .led { background: #e6b325; }

.lcd-1 {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.lcd-2 {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: #8eb4c4;
}

.grace {
  height: 3px;
  margin-top: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.grace span {
  display: block;
  height: 100%;
  width: 100%;
  background: #e6b325;
  transform-origin: left center;
  transform: scaleX(0);
}

body[data-state="active"] .grace span {
  transform: scaleX(1);
  transition: transform 0.2s linear;
}

body[data-state="grace"] .grace span {
  animation: drain 1.5s linear forwards;
}

@keyframes drain {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.switch label { position: relative; }

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch input:focus { outline: none; }

.switch span {
  display: block;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c5d4e2;
  cursor: pointer;
}

.switch input:checked + span {
  background: #f4efe6;
  color: #1a3358;
}

.switch input:focus-visible + span {
  outline: 2px solid #8fd8e2;
  outline-offset: 2px;
}

.knob {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #f4efe6;
  color: #1a3358;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 0 #0c1830, 0 8px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.knob svg { width: 40px; height: 40px; }

.knob:hover { transform: translateY(-1px); }

body[data-state="active"] .knob,
body[data-state="active"] .knob:hover {
  transform: translateY(4px);
  background: #e23b32;
  color: #fff;
  box-shadow: 0 1px 0 #0c1830;
}

body[data-state="active"] .knob .slash { opacity: 1; }

.feet {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: -7px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.feet i {
  display: block;
  width: 34px;
  height: 8px;
  border-radius: 0 0 4px 4px;
  background: #0c1830;
}

.hint {
  max-width: 460px;
  margin: 18px 0 0 auto;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.habits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.habits article { padding: 26px 28px 28px 0; }

.habits article + article {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.num {
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--teal);
}

.habits h2,
.block h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.habits p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.45;
}

.block {
  max-width: 38rem;
  margin-top: 64px;
}

.block h2 { margin-bottom: 10px; }

.block p {
  font-size: 17.5px;
  line-height: 1.5;
}

.block p + p { margin-top: 12px; }

.shout { max-width: none; }

.shout h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 5.6vw, 70px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.shout p { max-width: 38rem; }

.steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.steps li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 17px;
  line-height: 1.4;
}

.steps li:last-child { border-bottom: 1px solid var(--line); }

.steps span {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.note-after {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14.5px;
}

footer.colophon {
  margin-top: 72px;
  padding-bottom: 56px;
  display: grid;
  gap: 8px;
  max-width: 36rem;
  font-size: 14.5px;
  color: var(--muted);
}

footer.colophon em {
  color: var(--ink);
  font-style: italic;
}

footer.colophon a { color: var(--ink); text-underline-offset: 3px; }

.lost { padding-top: 28px; padding-bottom: 96px; }

.lost h1 { margin-bottom: 8px; }

@media (max-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 28px;
    row-gap: 22px;
  }

  .kicker,
  .hero h1,
  .pitch,
  .demo { grid-column: 1; }

  .hero h1 { margin-bottom: 0; font-size: 46px; }

  .radio,
  .hint { margin-left: 0; margin-right: 0; }

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

  .habits article { padding-right: 0; }

  .habits article + article {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .clock, .bar-status { display: none; }

  .hero h1 { font-size: 36px; }

  .stage-top { grid-template-columns: 92px 1fr; height: 132px; }

  .lede { font-size: 17px; }
}

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

  body[data-state="grace"] .grace span { transform: scaleX(0.45); }
}
