/* biome-ignore-all lint/style/noDescendingSpecificity: the flagged pairs style different components. */

/*
 * Joey's website. The app's Riso palette (src/global.css, docs/design/palette.md) on graph
 * paper: Riso Blue is the print ink, Fluorescent Pink only ever marks a PR. Headings use Zen
 * Kaku Gothic New, labels IBM Plex Mono, handwriting Klee One, all subset and self-hosted
 * (site/README.md). Body text and the note mockups use the system font, as the app does.
 */

@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("fonts/zen-kaku-gothic-new-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("fonts/zen-kaku-gothic-new-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Klee One";
  src: url("fonts/klee-one-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #171614;
  --ink-soft: #3b3935;
  --muted: #6e6b65;
  --rule: #e6e4df;
  --separator: #ceccc5;
  --wash: #f3f2ed;
  --blue: #0072b1;
  --cornflower: #62a8e5;
  --navy: #073567;
  --pr: #ff48b0;
  --pr-ink: #ca186c;
  --warning: #a8560c;
  --grid-minor: rgb(23 22 20 / 4.5%);
  --grid-major: rgb(23 22 20 / 8%);

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic UI", Meiryo, "Segoe UI", sans-serif;
  --font-display: "Zen Kaku Gothic New", var(--font-sans);
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-hand: "Klee One", "Hiragino Maru Gothic ProN", var(--font-sans);
  --font-note:
    -apple-system, "SF Pro Text", BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI",
    sans-serif;

  --header: 68px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
  background-position: center top;
  font: 16px/1.85 var(--font-sans);
  overflow-x: clip;
}

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

/* Widths come from CSS; the width and height attributes only reserve the shape. */
img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--blue);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: [hidden] has to beat every display rule. */
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 760px) {
  .wrap {
    padding: 0 40px;
  }
}

.nw {
  display: inline-block;
}

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

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

/* ---------- Type ---------- */

.display,
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-feature-settings: "palt";
  word-break: auto-phrase;
}

h1 {
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.14;
}

h2 {
  font-size: clamp(30px, 4.4vw, 50px);
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.45;
  font-feature-settings: "palt";
}

.lead {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.9;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 600;
}

/* A drawing-number label, as on a technical drawing: "SET 3 ── 使い方". */
.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.label b {
  color: var(--ink);
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--separator);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 4px 4px 0 var(--blue);
  font: 700 16px/1 var(--font-display);
  text-decoration: none;
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

.btn:hover {
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blue);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--blue);
}

.btn-line {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.btn-line:hover {
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.arrow {
  font-family: var(--font-mono);
  transition: transform 160ms var(--ease-out);
}

.btn:hover .arrow {
  transform: translateY(2px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: rgb(255 255 255 / 88%);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.header-row {
  display: flex;
  height: var(--header);
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 900 22px/1 var(--font-display);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

.brand small {
  color: var(--muted);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.site-nav {
  display: none;
  margin-left: auto;
  gap: 26px;
  font: 700 15px/1 var(--font-display);
}

.site-nav a {
  text-decoration: none;
}

.lang {
  display: flex;
  margin-left: auto;
  gap: 4px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.06em;
}

.lang a {
  padding: 8px 6px;
  color: var(--muted);
  text-decoration: none;
}

.lang a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.header-cta {
  display: none;
}

@media (min-width: 1060px) {
  .site-nav {
    display: flex;
  }

  .lang {
    margin-left: 8px;
  }
}

@media (min-width: 560px) {
  .header-cta {
    display: inline-flex;
  }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 72px;
}

@media (min-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 560px;
    align-items: center;
    gap: 32px;
    padding-top: 64px;
    padding-bottom: 96px;
  }
}

.hero h1 {
  margin-bottom: 26px;
}

.hero .lead {
  margin-bottom: 32px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 18px;
}

/* The hand-drawn ring around a word in the headline. */
.ring {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.ring svg {
  position: absolute;
  top: -12%;
  left: -9%;
  width: 118%;
  height: 128%;
  overflow: visible;
  pointer-events: none;
}

.ring path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* A spec block like the title block of a drawing. */
.spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 520px;
  margin-top: 40px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.spec div {
  padding: 12px 16px 14px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.spec div:nth-child(2n) {
  border-right: 0;
}

.spec div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.spec dt {
  margin-bottom: 4px;
  color: var(--muted);
  font: 600 11px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
}

.spec dd {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Hero picture: a paper log, the phone, Joey ---------- */

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 640px;
  margin: 0 auto;
}

.paper {
  position: absolute;
  top: 74px;
  left: -16px;
  width: 250px;
  height: 330px;
  padding: 38px 16px 0 32px;
  border: 1px solid var(--separator);
  background-color: #fffefa;
  background-image:
    linear-gradient(90deg, transparent 22px, rgb(202 24 108 / 22%) 22px 23px, transparent 23px),
    repeating-linear-gradient(transparent 0 33px, rgb(0 114 177 / 22%) 33px 34px);
  background-position:
    0 0,
    0 30px;
  box-shadow: 0 18px 30px -18px rgb(23 22 20 / 35%);
  transform: rotate(-6deg);
}

.paper::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 82px;
  width: 104px;
  height: 30px;
  background: rgb(98 168 229 / 38%);
  transform: rotate(3deg);
}

.paper p {
  color: #2b2a6e;
  font: 600 18px/34px var(--font-hand);
  white-space: nowrap;
}

.paper .paper-date {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.paper-arrow {
  position: absolute;
  top: 8px;
  left: 98px;
  width: 104px;
  overflow: visible;
}

.paper-arrow path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone {
  position: absolute;
  top: 0;
  left: 176px;
  width: 300px;
  height: 620px;
  padding: 10px;
  border-radius: 48px;
  background: var(--ink);
  box-shadow:
    0 30px 60px -30px rgb(23 22 20 / 55%),
    0 0 0 1.5px #3b3935 inset;
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 38px;
  background: var(--paper);
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.statusbar {
  display: flex;
  height: 46px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 4px 26px 0 30px;
  font-weight: 600;
  font-size: 14px;
}

.island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 92px;
  height: 27px;
  border-radius: 20px;
  background: var(--ink);
  transform: translateX(-50%);
}

.battery {
  width: 24px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ink) 70%, transparent 70%) content-box;
  padding: 1px;
}

.notebar {
  display: flex;
  height: 40px;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 18px;
  color: var(--blue);
  font-size: 15px;
}

.notebar .icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--wash);
}

.notebar b {
  font-weight: 600;
}

.note {
  flex: 1;
  padding: 2px 18px 0;
}

.note-date {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.note-title {
  margin-bottom: 6px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
}

.note-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15.5px;
  line-height: 30px;
  white-space: nowrap;
}

.note-line .text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-line .name {
  font-weight: 600;
}

.note-line .value {
  color: var(--muted);
  font-size: 13.5px;
}

.note-line .value.pr {
  color: var(--pr-ink);
  font-weight: 600;
}

.note-line .value.flag {
  color: var(--warning);
  font-weight: 700;
}

.note-line .suggestion {
  color: #a9a6a0;
  font-style: italic;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 19px;
  margin-top: 5px;
  background: var(--blue);
  vertical-align: top;
}

.keyboard {
  flex: none;
  padding: 0 0 10px;
  background: #d5d7dd;
}

.kbar {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-top: 1px solid #c5c7cd;
  background: #f1f1f3;
}

.kbar .key {
  display: inline-flex;
  min-width: 34px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--paper);
  font-weight: 600;
  font-size: 16px;
}

.kbar .timer {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
}

.kbar .timer::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentcolor;
  border-radius: 50%;
}

/* Keys drawn with gradients rather than a few dozen elements. */
.keys {
  display: grid;
  gap: 11px;
  padding: 10px 4px 0;
}

.keys i {
  display: block;
  height: 38px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, #fff 0 23.4px, transparent 23.4px 27.2px);
  box-shadow: 0 1px 0 #a2a4aa;
}

.keys i:nth-child(2) {
  margin: 0 13px;
  background: repeating-linear-gradient(90deg, #fff 0 23.4px, transparent 23.4px 27.2px);
}

.keys i:nth-child(3) {
  margin: 0 40px;
}

.keys i:nth-child(4) {
  margin: 0 64px;
  background: #fff;
}

/* Handwritten notes in the margin, joined to the phone by leader lines. */
.annotations {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.annotations path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5;
}

.annotations circle {
  fill: var(--blue);
}

.annotation {
  position: absolute;
  color: var(--blue);
  font: 600 17px/1.3 var(--font-hand);
  white-space: nowrap;
}

.joey {
  position: absolute;
  bottom: 0;
  left: 4px;
  width: 128px;
}

.bubble {
  position: absolute;
  z-index: 1;
  bottom: 192px;
  left: -12px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 18px 18px 18px 4px;
  background: var(--paper);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

/* On the notebook page, so it has to beat .paper p. */
.paper .stamp {
  position: absolute;
  bottom: 34px;
  left: 6px;
  padding: 5px 10px 6px;
  border: 2.5px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font: 900 18px/1.15 var(--font-display);
  text-align: center;
  transform: rotate(-4deg);
  mix-blend-mode: multiply;
  opacity: 0.88;
}

.paper .stamp small {
  display: block;
  font: 600 9px/1.4 var(--font-mono);
  letter-spacing: 0.02em;
}

/* Narrow screens: the phone in the middle, the paper and Joey tucked behind and beside it. */
@media (max-width: 639px) {
  .hero-visual {
    height: 600px;
  }

  .paper {
    top: 40px;
    left: -6px;
    transform: rotate(-8deg) scale(0.86);
    transform-origin: top left;
  }

  .phone {
    left: 50%;
    margin-left: -126px;
    transform: scale(0.86);
    transform-origin: top center;
  }

  .paper-arrow {
    display: none;
  }

  .joey {
    left: -8px;
    width: 108px;
  }

  .bubble {
    bottom: 176px;
    left: -4px;
    font-size: 13px;
  }

  .stamp {
    display: none;
  }
}

/* The margin notes reach past the column, so they need the room of a wide window. */
@media (max-width: 1239px) {
  .annotations,
  .annotation {
    display: none;
  }
}

/* ---------- Page-load sequence ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 700ms var(--ease-out) both;
  }

  /* The label, headline and lead paint in the first frame (they are the LCP); what follows
     them rises in. */
  .hero-copy .buttons,
  .hero-copy .spec {
    animation: rise 700ms var(--ease-out) both;
  }

  .hero-copy .buttons {
    animation-delay: 80ms;
  }

  .hero-copy .spec {
    animation-delay: 160ms;
  }

  .ring path {
    stroke-dashoffset: 1;
    animation: draw 900ms 650ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }

  .paper {
    animation: paper-in 900ms 100ms var(--ease-out) both;
  }

  .phone {
    animation: rise 900ms 200ms var(--ease-out) both;
  }

  .paper-arrow path,
  .annotations path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 700ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
  }

  .paper-arrow path {
    animation-delay: 900ms;
  }

  /* Each line is written left to right, then its value appears at the edge. --i is the line. */
  .note-title,
  .phone .note-line .text {
    animation: write 520ms steps(14, end) both;
  }

  .phone .note-line .value {
    animation: fade 360ms var(--ease-out) both;
  }

  .note-title {
    animation-delay: 700ms;
  }

  .phone .note-line .text {
    animation-delay: calc(400ms + var(--i, 0) * 750ms);
  }

  .phone .note-line .value {
    animation-delay: calc(850ms + var(--i, 0) * 750ms);
  }

  .phone .note-line:last-child {
    animation: fade 200ms 4100ms both;
  }

  .caret {
    animation: blink 1100ms 4300ms steps(1) infinite;
  }

  .annotations .a1 {
    animation-delay: 1750ms;
  }

  .annotations .a2 {
    animation-delay: 2500ms;
  }

  .annotations .a3 {
    animation-delay: 4300ms;
  }

  .annotations circle,
  .annotation {
    animation: fade 300ms var(--ease-out) both;
  }

  .annotations .d1,
  .annotation.n1 {
    animation-delay: 2000ms;
  }

  .annotations .d2,
  .annotation.n2 {
    animation-delay: 2750ms;
  }

  .annotations .d3,
  .annotation.n3 {
    animation-delay: 4550ms;
  }

  .hero-visual .joey {
    animation: hop-in 800ms 300ms var(--ease-out) both;
    transform-origin: 50% 100%;
  }

  .bubble {
    animation: pop 420ms 2500ms var(--ease-out) both;
    transform-origin: 12% 100%;
  }

  .stamp {
    animation: stamp 380ms 1500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes paper-in {
  from {
    opacity: 0;
    transform: rotate(-14deg) translate(-24px, 24px);
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes write {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-4deg) scale(1.6);
  }
}

/* Transform only, so Joey paints in the first frame and only his position moves. */
@keyframes hop-in {
  0% {
    transform: translateY(6px) scaleY(0.94);
  }

  45% {
    transform: translateY(-12px) scaleY(1.03);
  }

  75% {
    transform: translateY(0) scaleY(0.96);
  }
}

/* ---------- Campaign code: shown only when the link carries ?code= ---------- */

.campaign {
  padding-bottom: 64px;
}

.ticket {
  padding: 32px 28px;
  border: 2px dashed var(--blue);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--blue);
}

.ticket h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3.2vw, 36px);
}

.ticket-lead {
  margin-bottom: 24px;
  font-size: 17px;
}

.code {
  display: inline-block;
  padding: 2px 12px;
  background: var(--wash);
  font: 600 20px/1.5 var(--font-mono);
  letter-spacing: 0.08em;
  user-select: all;
}

/* ---------- Notation marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  background: var(--paper);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 12px;
  padding: 16px 0;
}

.marquee-track li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--paper);
  font: 600 15px/1.4 var(--font-mono);
  white-space: nowrap;
}

.marquee-track li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

@media (prefers-reduced-motion: no-preference) {
  .marquee-track {
    animation: marquee 70s linear infinite;
  }

  .marquee:hover .marquee-track {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    overflow-x: auto;
  }

  .marquee-track [aria-hidden="true"] {
    display: none;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-top: 112px;
}

@media (max-width: 759px) {
  .section {
    padding-top: 88px;
  }
}

.section-head {
  max-width: 760px;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-bottom: 20px;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 17px;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

/* Why: words on the left, the comparison on the right. */
.split {
  display: grid;
  gap: 48px;
}

@media (min-width: 980px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 64px;
  }
}

.split-copy h2 {
  margin-bottom: 24px;
}

.split-copy p {
  max-width: 32em;
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 17px;
}

/* A bordered table in the drawing style, used for comparisons, data and parts lists. */
.sheet {
  width: 100%;
  border: 1.5px solid var(--ink);
  border-collapse: collapse;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.sheet caption {
  padding-bottom: 12px;
  font: 700 15px/1.4 var(--font-display);
  text-align: left;
}

.sheet th,
.sheet td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink);
  text-align: left;
  vertical-align: top;
}

.sheet thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--wash);
  color: var(--muted);
  font: 600 11px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.sheet tbody tr:last-child > * {
  border-bottom: 0;
}

.sheet .no {
  width: 56px;
  color: var(--muted);
  font: 600 12px/1.9 var(--font-mono);
}

.sheet .item {
  width: 24%;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 559px) {
  .sheet .no {
    display: none;
  }

  .sheet th,
  .sheet td {
    padding: 12px 14px;
  }
}

.sheet .others {
  color: var(--muted);
}

.sheet .joey-col {
  border-left: 1px solid var(--ink);
  font-weight: 700;
}

.sheet .joey-col::before {
  content: "✓";
  margin-right: 8px;
  color: var(--blue);
  font-weight: 900;
}

/* Try: the app's parser, live. */
.try {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding: 32px 24px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--ink);
}

@media (min-width: 900px) {
  .try {
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: end;
    padding: 48px;
  }
}

.try-field {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-radius: 16px;
  background: var(--wash);
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.try-field:focus-within {
  box-shadow: 0 0 0 2px var(--blue);
}

.try-field input {
  flex: 1;
  min-width: 0;
  height: 64px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 20px/1 var(--font-note);
  font-variant-numeric: tabular-nums;
}

.try-field input::placeholder {
  color: #a9a6a0;
}

@media (max-width: 559px) {
  .try {
    padding: 24px 18px;
  }

  .try-field {
    padding: 0 14px;
  }

  .try-field input {
    font-size: 17px;
  }

  .try-value {
    font-size: 14px;
  }
}

.try-value {
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}

.try-reading {
  min-height: 84px;
  margin-top: 22px;
}

.try-reading .name {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font: 600 12px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.try-reading .words {
  font: 700 clamp(20px, 2.6vw, 26px) / 1.45 var(--font-display);
}

.try[data-read="false"] .try-reading .words {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
}

.try-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--separator);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1 var(--font-mono);
  cursor: pointer;
  transition:
    border-color 160ms,
    color 160ms;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.units {
  display: inline-flex;
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--wash);
}

.units button {
  min-width: 48px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--font-mono);
  cursor: pointer;
}

.units button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(23 22 20 / 18%);
}

.try-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.try-joey {
  display: none;
}

@media (min-width: 900px) {
  .try-joey {
    display: block;
    width: 170px;
    margin: 0 auto -8px;
    transform-origin: 50% 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .try-joey.hop {
    animation: hop 640ms var(--ease-out);
  }
}

@keyframes hop {
  30% {
    transform: translateY(-14%) scaleY(1.03);
  }

  58% {
    transform: translateY(0) scaleY(1);
  }

  70% {
    transform: scaleY(0.95);
  }
}

/* How: three steps, each with a slice of a note. */
.steps {
  display: grid;
  gap: 48px;
  counter-reset: step;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

.step h3 {
  margin: 20px 0 10px;
}

.step p {
  color: var(--ink-soft);
}

.step-num {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 28px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.step-num b {
  font: 900 44px/1 var(--font-display);
  letter-spacing: -0.02em;
}

/* A slice of a note, drawn flat like the app: white page, hairline frame, no card. */
.slice {
  min-height: 168px;
  padding: 18px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.slice .note-line {
  font-size: 16px;
}

.slice .kbar {
  margin: 12px -20px -18px;
  border-radius: 0 0 20px 20px;
}

/* Features: alternating rows, then a grid of smaller ones. */
.feature {
  display: grid;
  gap: 36px;
  padding: 56px 0;
  border-top: 1px dashed var(--separator);
}

.feature:first-of-type {
  border-top: 0;
  padding-top: 0;
}

@media (min-width: 980px) {
  .feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 72px;
  }

  .feature.flip .feature-copy {
    order: 2;
  }
}

.tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 10px;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  font: 700 13px/1.2 var(--font-display);
}

.feature-copy h3 {
  margin-bottom: 14px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 900;
  line-height: 1.3;
}

.feature-copy p {
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.figure {
  padding: 28px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.figure-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
  font: 600 12px/1.4 var(--font-mono);
  letter-spacing: 0.06em;
}

.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid {
  stroke: var(--rule);
}

.chart .axis {
  fill: var(--muted);
  font: 600 11px var(--font-mono);
}

.chart .series {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.chart .dot {
  fill: var(--blue);
}

.chart .pr {
  fill: var(--pr-ink);
}

.chart .pr-label {
  fill: var(--pr-ink);
  font: 700 12px var(--font-note);
}

.rm-table {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 22px;
  border: 1px solid var(--ink);
  font-variant-numeric: tabular-nums;
}

.rm-table div {
  padding: 8px 10px;
  border-right: 1px solid var(--ink);
}

.rm-table div:last-child {
  border-right: 0;
}

.rm-table dt {
  color: var(--muted);
  font: 600 11px/1.4 var(--font-mono);
}

.rm-table dd {
  font-weight: 700;
  font-size: 15px;
}

.rm-table .is-pr dd {
  color: var(--pr-ink);
}

/* Weekly sets per muscle: the app's three steps, below, inside and above the target. */
.bars {
  display: grid;
  gap: 12px;
}

.bar {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.bar-track {
  position: relative;
  height: 18px;
  background: linear-gradient(
    90deg,
    transparent calc(10 / 26 * 100%),
    var(--wash) calc(10 / 26 * 100%) calc(20 / 26 * 100%),
    transparent calc(20 / 26 * 100%)
  );
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--blue);
}

.bar-fill.low {
  background: var(--cornflower);
}

.bar-fill.high {
  background: var(--navy);
}

.bar b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bars-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.bars-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bars-legend i {
  width: 12px;
  height: 12px;
  background: var(--blue);
}

.bars-legend .low {
  background: var(--cornflower);
}

.bars-legend .high {
  background: var(--navy);
}

.bars-legend .band {
  background: var(--wash);
  outline: 1px solid var(--separator);
}

/* Rest timer: the Dynamic Island and a lock screen alert. */
.rest-figure {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 40px 28px;
  background: var(--ink);
  color: #fff;
}

.island-live {
  display: flex;
  width: min(100%, 300px);
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 999px;
  background: #000;
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.island-live span {
  color: rgb(255 255 255 / 70%);
  font-size: 13px;
}

.island-live b {
  color: var(--cornflower);
  font-size: 22px;
  font-weight: 600;
}

.lock-alert {
  width: min(100%, 340px);
  padding: 14px 16px;
  border-radius: 20px;
  background: rgb(255 255 255 / 14%);
  font-family: var(--font-note);
  font-size: 14px;
  line-height: 1.45;
}

.lock-alert b {
  display: block;
}

.lock-alert span {
  color: rgb(255 255 255 / 72%);
}

/* The parts list: smaller features in a ruled grid. */
.parts {
  display: grid;
  margin-top: 56px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

@media (min-width: 700px) {
  .parts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .parts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.part {
  padding: 26px 26px 30px;
  border-bottom: 1px solid var(--ink);
}

.part-no {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.06em;
}

.part h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

.part p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

@media (max-width: 699px) {
  .part:last-child {
    border-bottom: 0;
  }
}

@media (min-width: 700px) and (max-width: 1039px) {
  .part:nth-child(odd) {
    border-right: 1px solid var(--ink);
  }

  .part:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (min-width: 1040px) {
  .part:not(:nth-child(3n)) {
    border-right: 1px solid var(--ink);
  }

  .part:nth-last-child(-n + 3) {
    border-bottom: 0;
  }
}

/* Import: three ways in. */
.ways {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .ways {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.way {
  padding-top: 22px;
  border-top: 3px solid var(--ink);
}

.way h3 {
  margin-bottom: 10px;
}

.way p {
  color: var(--ink-soft);
  font-size: 15px;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.dates span {
  padding: 3px 9px;
  background: var(--wash);
  font: 600 13px/1.6 var(--font-mono);
}

.aside {
  margin-top: 36px;
  font: 700 17px/1.6 var(--font-display);
}

.aside::before {
  content: "→ ";
  color: var(--blue);
  font-family: var(--font-mono);
}

/* Pricing. */
.plans {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.plan {
  padding: 32px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.plan.pro {
  border-color: var(--blue);
  box-shadow: 10px 10px 0 var(--blue);
}

.plan-name {
  color: var(--blue);
  font: 700 15px/1.4 var(--font-display);
}

.price {
  margin: 8px 0 22px;
  font: 900 46px/1.1 var(--font-display);
  letter-spacing: -0.02em;
}

.price small {
  margin-left: 4px;
  color: var(--muted);
  font: 600 16px var(--font-sans);
  letter-spacing: 0;
}

.checks li {
  position: relative;
  padding: 12px 0 12px 30px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.7;
}

.checks li::before {
  content: "✓";
  position: absolute;
  top: 12px;
  left: 2px;
  color: var(--blue);
  font-weight: 900;
}

.plan-note {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--wash);
  font-weight: 700;
  font-size: 15px;
}

.fine {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* FAQ. */
.faq {
  max-width: 860px;
  border-top: 1.5px solid var(--ink);
}

.faq details {
  border-bottom: 1px solid var(--ink);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  font: 700 17px/1.5 var(--font-display);
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--blue);
  font: 600 24px/1 var(--font-mono);
  transition: transform 200ms var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  max-width: 44em;
  padding: 0 4px 24px;
  color: var(--ink-soft);
}

/* Closing band. */
.cta {
  position: relative;
  display: grid;
  gap: 28px;
  margin-top: 120px;
  padding: 48px 28px;
  border: 1.5px solid var(--ink);
  background-color: var(--blue);
  background-image: radial-gradient(rgb(255 255 255 / 22%) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  color: #fff;
  box-shadow: 10px 10px 0 var(--ink);
}

@media (min-width: 800px) {
  .cta {
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding: 56px 64px;
  }
}

/* Joey sits on a round sticker: on blue, his paper-white fill needs paper around it. */
.cta-joey {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: rotate(-6deg);
}

.cta-joey img {
  width: 76px;
  margin-top: 6px;
}

@media (min-width: 800px) {
  .cta-joey {
    width: 170px;
    height: 170px;
  }

  .cta-joey img {
    width: 88px;
  }
}

.cta h2 {
  margin-bottom: 24px;
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: 700 15px/1.3 var(--font-display);
}

.soon::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pr);
}

/* ---------- Footer: a drawing's title block ---------- */

.site-footer {
  margin-top: 120px;
  padding-bottom: 40px;
}

.titleblock {
  display: grid;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

@media (min-width: 900px) {
  .titleblock {
    grid-template-columns: 300px repeat(3, minmax(0, 1fr));
  }
}

.titleblock > div {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--ink);
}

.titleblock dt {
  margin-bottom: 6px;
  color: var(--muted);
  font: 600 11px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
}

.titleblock dd {
  font-weight: 700;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.titleblock .tb-brand {
  display: flex;
  align-items: center;
}

.titleblock .tb-links {
  border-bottom: 0;
}

.titleblock .tb-links dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

@media (min-width: 900px) {
  .titleblock > div {
    border-right: 1px solid var(--ink);
  }

  .titleblock > div:nth-child(4) {
    border-right: 0;
  }

  .titleblock .tb-brand {
    grid-row: span 2;
    border-bottom: 0;
  }

  .titleblock .tb-links {
    grid-column: span 3;
    border-right: 0;
  }
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font: 600 12px/1.6 var(--font-mono);
}

.footer-meta a {
  text-decoration: none;
}

/* ---------- Legal pages ---------- */

.doc-head {
  max-width: 860px;
  padding-top: 64px;
  padding-bottom: 40px;
}

.doc-head h1 {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 56px);
}

.doc-meta {
  color: var(--muted);
  font: 600 13px/1.6 var(--font-mono);
}

.doc-layout {
  display: grid;
  gap: 40px;
}

@media (min-width: 1000px) {
  .doc-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 64px;
  }
}

.toc {
  padding: 20px 22px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.6;
}

@media (min-width: 1000px) {
  .toc {
    position: sticky;
    top: calc(var(--header) + 24px);
    max-height: calc(100dvh - var(--header) - 48px);
    overflow-y: auto;
  }
}

.toc p {
  margin-bottom: 10px;
  color: var(--muted);
  font: 600 11px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
}

.toc ol {
  display: grid;
  gap: 8px;
  counter-reset: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  text-decoration: none;
}

.toc a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  color: var(--muted);
  font: 600 12px/1.6 var(--font-mono);
}

/* Japanese terms number their own articles (第1条). */
.toc.no-count a {
  display: block;
}

.toc.no-count a::before {
  content: none;
}

.doc-article {
  max-width: 760px;
  padding: 36px 24px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.95;
}

@media (min-width: 700px) {
  .doc-article {
    padding: 48px 56px;
  }
}

.doc-article > p,
.doc-article > ul {
  margin-bottom: 16px;
}

.doc-article section {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.doc-article section:first-of-type {
  margin-top: 32px;
}

.doc-article h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.doc-article h2 .num {
  flex: none;
  color: var(--blue);
  font: 600 13px/1 var(--font-mono);
  letter-spacing: 0.04em;
}

.doc-article section p,
.doc-article section ul,
.doc-article section ol {
  margin-bottom: 14px;
}

.doc-article ul li,
.doc-article ol li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 22px;
}

.doc-article ul li::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 4px;
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.doc-article ol {
  counter-reset: item;
}

.doc-article ol li {
  padding-left: 30px;
}

.doc-article ol li::before {
  counter-increment: item;
  content: counter(item) ".";
  position: absolute;
  left: 0;
  color: var(--muted);
  font: 600 13px/1.95 var(--font-mono);
}

.doc-article a {
  overflow-wrap: anywhere;
}

.doc-steps {
  margin: 18px 0 8px;
  padding: 20px 22px;
  background: var(--wash);
}

.doc-steps h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.doc-steps ol {
  margin-bottom: 0;
}
