/* Site styles for zhongwenhover.com, nihongohover.com and hangulhover.com.
   One file for every page. Paper and ink, one accent color per app (set as
   --accent on <body> or on a single element). */

/* ── Fonts (self-hosted, SIL Open Font License, see fonts/LICENSE.txt) ── */
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/instrument-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/instrument-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/instrument-serif-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(fonts/instrument-serif-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/instrument-serif-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ── */
:root {
  --paper: #f2eee6;
  --paper-2: #e8e2d6;
  --sheet: #faf8f3;
  --ink: #161412;
  --ink-2: #4a453e;
  --muted: #857e72;
  --rule: rgb(22 20 18 / .13);
  --rule-2: rgb(22 20 18 / .3);
  --night: #171512;
  --on-night: #efe9df;
  --on-night-2: #a39b8f;
  --night-rule: rgb(239 233 223 / .15);
  --pop-bg: #f5f3e9;
  --pop-ink: #1c1a17;
  --sans: "Instrument Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --cjk: "PingFang SC", "Hiragino Sans", "Hiragino Sans GB", "Apple SD Gothic Neo", "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans CJK KR", "Microsoft YaHei", "Malgun Gothic", sans-serif;
  --pad: clamp(20px, 4.2vw, 64px);
  --max: 1480px;
  --gap: clamp(16px, 2vw, 28px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --squircle: 22.5%;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13110f;
    --paper-2: #1d1a17;
    --sheet: #1c1a16;
    --ink: #eee8dd;
    --ink-2: #c3baad;
    --muted: #8f877b;
    --rule: rgb(238 232 221 / .12);
    --rule-2: rgb(238 232 221 / .28);
    --night: #0b0a09;
    --night-rule: rgb(238 232 221 / .13);
  }
}
body { --accent-text: var(--accent); }
@media (prefers-color-scheme: dark) {
  body { --accent-text: color-mix(in oklab, var(--accent) 74%, white); }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}
/* smooth only for clicks inside the page, so a link with #anchor lands at once */
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .08  0 0 0 0 .05  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark) { body::before { opacity: .05; filter: invert(1); } }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 450;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.skip {
  position: absolute; left: -9999px; top: 10px; z-index: 300;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { left: 12px; }

/* Display type: condensed capitals with an italic serif accent */
.display, .title, .row-title, .ix-name, .statement-text, .ft-line, .menu-list a, .ft-word {
  font-family: var(--sans);
  font-weight: 600;
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.display em, .title em, .ft-line em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: none;
  letter-spacing: -.015em;
  color: var(--accent-text);
}
.display {
  margin: 0;
  font-size: clamp(54px, 8.4vw, 150px);
  line-height: .86;
}
.display .ln { display: block; overflow: hidden; padding: 0 .08em .06em; margin: 0 -.08em -.06em; }
.display .ln > span { display: inline-block; }
.display em { font-size: 1.06em; line-height: .8; }
.title { margin: 0; font-size: clamp(40px, 6vw, 100px); line-height: .88; }

/* Crop marks around figures (four corners) */
.crop { position: relative; padding: 16px; }
.crop::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  --c: var(--rule-2);
  --l: 13px;
  background:
    linear-gradient(var(--c) 0 0) 0 0 / var(--l) 1px,
    linear-gradient(var(--c) 0 0) 0 0 / 1px var(--l),
    linear-gradient(var(--c) 0 0) 100% 0 / var(--l) 1px,
    linear-gradient(var(--c) 0 0) 100% 0 / 1px var(--l),
    linear-gradient(var(--c) 0 0) 0 100% / var(--l) 1px,
    linear-gradient(var(--c) 0 0) 0 100% / 1px var(--l),
    linear-gradient(var(--c) 0 0) 100% 100% / var(--l) 1px,
    linear-gradient(var(--c) 0 0) 100% 100% / 1px var(--l);
  background-repeat: no-repeat;
}

/* App icons share one rounded square */
.icon {
  border-radius: var(--squircle);
  background: var(--paper-2);
  box-shadow: 0 0 0 .5px rgb(0 0 0 / .08), 0 1px 1px rgb(0 0 0 / .05), 0 8px 16px -8px rgb(30 20 10 / .3);
}
.icon-xl {
  width: 100%;
  aspect-ratio: 1;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / .06),
    0 2px 3px rgb(0 0 0 / .06),
    0 30px 60px -28px rgb(40 28 16 / .5),
    0 70px 130px -50px rgb(40 28 16 / .45);
}

/* ── Buttons ── */
.btn {
  --h: 52px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: var(--h);
  padding: 0 6px 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 15px/1 var(--sans);
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s;
}
.btn .arr {
  display: grid;
  place-items: center;
  width: calc(var(--h) - 12px);
  height: calc(var(--h) - 12px);
  border-radius: 50%;
  font-family: var(--sans);
  font-size: 16px;
  transition: transform .4s var(--ease);
}
.btn:hover .arr { transform: translateX(2px); }
.btn[href^="http"]:hover .arr { transform: translate(2px, -2px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink .arr { background: var(--paper); color: var(--ink); }
.btn-line { border-color: var(--rule-2); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-line .arr { background: var(--ink); color: var(--paper); }
.btn-paper { background: var(--on-night); color: var(--night); }
.btn-paper .arr { background: var(--night); color: var(--on-night); }
.btn-ghost { border-color: var(--night-rule); color: var(--on-night); }
.btn-ghost:hover { border-color: var(--on-night); }
.btn-ghost .arr { background: var(--on-night); color: var(--night); }
.btn.is-soon { padding: 0 22px; background: transparent; border: 1px dashed var(--rule-2); color: var(--muted); cursor: default; }
.band .btn.is-soon { border-color: var(--night-rule); color: var(--on-night-2); }
.btn-sm { --h: 38px; gap: 8px; padding-left: 16px; font-size: 13.5px; }
.btn-sm .arr { font-size: 13px; }
.btn-sm.is-soon { padding: 0 14px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Header ── */
.sh {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color .3s, box-shadow .3s;
}
.sh-in {
  max-width: var(--max);
  margin-inline: auto;
  padding: 12px var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.sh.is-scrolled, .menu-open .sh {
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 var(--rule);
}
.menu-open .sh { background: var(--paper); }
.sh-brand {
  justify-self: start;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -.01em;
  text-decoration: none;
}
.sh-brand .icon { width: 30px; height: 30px; flex: none; box-shadow: 0 0 0 .5px rgb(0 0 0 / .1); }
.sh-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-mark { color: var(--accent-text); font-size: 12px; }
.sh-nav { display: flex; gap: clamp(14px, 1.8vw, 26px); }
.sh-nav a { position: relative; padding: 6px 0; color: var(--ink-2); text-decoration: none; }
.sh-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.sh-nav a:hover, .sh-nav a[aria-current] { color: var(--ink); }
.sh-nav a:hover::after, .sh-nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.sh-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.sh-menu {
  display: none;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
@media (max-width: 1080px) {
  .sh-in { grid-template-columns: minmax(0, 1fr) auto; }
  .sh-nav { display: none; }
  .sh-menu { display: inline-flex; align-items: center; }
}
.sh-menu-icon { display: none; }
@media (max-width: 520px) {
  .sh-in { gap: 10px; }
  .sh-cta.btn-sm { padding-left: 13px; font-size: 13px; }
  .sh-cta .arr, .sh-cta .opt { display: none; }
  .sh-cta.btn-sm:not(.is-soon) { padding-right: 13px; }
  .sh-menu { width: 38px; padding: 0; justify-content: center; }
  .sh-menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sh-menu-icon { display: block; position: relative; width: 16px; height: 9px; }
  .sh-menu-icon::before, .sh-menu-icon::after {
    content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
    transition: transform .35s var(--ease), top .35s var(--ease);
  }
  .sh-menu-icon::before { top: 0; }
  .sh-menu-icon::after { top: 7.5px; }
  .menu-open .sh-menu-icon::before { top: 3.75px; transform: rotate(45deg); }
  .menu-open .sh-menu-icon::after { top: 3.75px; transform: rotate(-45deg); }
}

/* ── Menu (small screens) ── */
.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  padding: 88px var(--pad) 48px;
  background: var(--paper);
}
.menu[hidden] { display: none; }
.menu-in { max-width: 760px; }
.menu-label { margin: 0 0 12px; color: var(--muted); }
.menu-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.menu-list a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}
.menu-list a[aria-current] { color: var(--accent-text); }
.menu-list .icon { width: 38px; height: 38px; }
.menu-list .mono { color: var(--muted); font-stretch: 100%; max-width: 13ch; text-align: right; }
.menu-foot { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 28px 0 0; }
.menu-foot a { text-decoration: none; }
html.menu-open { overflow: hidden; }

/* ── Hero ── */
.hero { padding-block: clamp(108px, 15vh, 168px) clamp(40px, 7vh, 90px); }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px clamp(18px, 3vw, 42px);
  margin: 0 0 clamp(28px, 5vh, 60px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.hero-meta span:first-child { color: var(--ink); }
.hero-meta [lang] { text-transform: none; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: center;
}
.lead { margin: clamp(24px, 4vh, 40px) 0 0; max-width: 50ch; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--ink-2); }
.hero .cta-row { margin-top: clamp(26px, 4vh, 40px); }
.fine { margin: 20px 0 0; color: var(--muted); }
.hero-fig { margin: 0; justify-self: center; width: min(100%, 470px); }
.hero-fig .crop { padding: clamp(18px, 3vw, 34px); perspective: 1200px; }
.tilt { transition: transform .9s var(--ease); transform-style: preserve-3d; will-change: transform; }
.hero-fig figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-inline: clamp(18px, 3vw, 34px); color: var(--muted); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-fig { order: -1; width: min(62vw, 300px); justify-self: start; }
  .hero-fig figcaption { display: none; }
}

/* ── Sections ── */
.sec { padding-top: clamp(80px, 13vh, 170px); }
.sec-head {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) minmax(0, 10fr) auto;
  column-gap: var(--gap);
  align-items: end;
  margin-bottom: clamp(32px, 6vh, 72px);
}
.sec-head .idx { grid-column: 1; grid-row: 1; align-self: start; margin: .55em 0 0; color: var(--muted); }
.sec-head .title { grid-column: 2; grid-row: 1; }
.sec-sub { grid-column: 2; margin: 20px 0 0; max-width: 58ch; font-size: 18px; color: var(--ink-2); }
.gal-ctl { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); }
@media (max-width: 720px) {
  .sec-head { grid-template-columns: minmax(0, 1fr) auto; }
  .sec-head .idx { grid-column: 1 / -1; margin: 0 0 12px; }
  .sec-head .title, .sec-sub { grid-column: 1 / -1; grid-row: auto; }
  .gal-ctl { grid-column: 1 / -1; grid-row: auto; margin-top: 22px; }
}

/* ── Hover demo ── */
.demo { position: relative; max-width: 1020px; margin-inline: auto; }
.demo .crop { padding: clamp(12px, 2vw, 22px); }
.sheet {
  background: var(--sheet);
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--rule), 0 50px 90px -60px rgb(40 28 16 / .55);
}
.sheet-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.sheet-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule-2); }
.sheet-bar span { margin-left: 10px; text-transform: none; letter-spacing: .02em; }
.sheet-text {
  padding: clamp(26px, 4.5vw, 56px) clamp(22px, 5vw, 70px) clamp(34px, 6vw, 76px);
  font-family: var(--cjk);
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 2.05;
  letter-spacing: .02em;
}
.sheet-text.is-spaced { word-break: keep-all; letter-spacing: 0; }
.dw { border-radius: 5px; padding: 3px 1px; cursor: default; transition: background-color .15s, box-shadow .15s; outline: none; }
.dw:hover, .dw.is-on, .dw:focus-visible {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.pop {
  position: absolute;
  z-index: 20;
  width: min(330px, 100%);
  padding: 16px 18px 12px;
  border-radius: 12px;
  background: var(--pop-bg);
  color: var(--pop-ink);
  font-family: var(--sans);
  box-shadow: 0 0 0 1px rgb(0 0 0 / .09), 0 22px 44px -14px rgb(30 20 10 / .42);
  pointer-events: none;
  color-scheme: light;
}
.pop[hidden] { display: none; }
.pop-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pop-word { font-family: var(--cjk); font-size: 34px; line-height: 1.15; font-weight: 500; }
.pop-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; padding-top: 6px; }
.pop-badge {
  padding: 5px 9px;
  border-radius: 999px;
  font: 600 11px/1 var(--sans);
  white-space: nowrap;
  background: color-mix(in srgb, var(--accent) 15%, #fff);
  color: color-mix(in srgb, var(--accent) 75%, #000);
}
.pop-read { margin-top: 4px; font-size: 18px; font-weight: 500; letter-spacing: .02em; }
.pop-read .pop-r { color: color-mix(in srgb, var(--accent) 85%, #000); }
.pop-def { margin: 10px 0 0; font-size: 15px; line-height: 1.45; }
.pop-def span { color: #8b8578; margin-right: 4px; }
.pop-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgb(0 0 0 / .08);
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8b8578;
}
.t1 { color: #df433d; } .t2 { color: #e5841f; } .t3 { color: #25965a; } .t4 { color: #2a68dc; } .t5 { color: #8b8578; }
.toast {
  position: absolute;
  right: clamp(12px, 2vw, 22px);
  top: 0;
  z-index: 25;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: translateY(-40%);
  transition: opacity .3s, transform .4s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(-70%); }
.demo-hint { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 18px 0 0; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 1.8s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .3; } }

/* ── Feature rows ── */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) minmax(0, 6fr) minmax(0, 4fr);
  column-gap: var(--gap);
  align-items: baseline;
  padding: clamp(18px, 2.4vw, 30px) 0;
  border-bottom: 1px solid var(--rule);
}
.row-idx { color: var(--muted); transition: color .4s; }
.row-title {
  margin: 0;
  font-size: clamp(28px, 4.1vw, 64px);
  line-height: .92;
  color: color-mix(in srgb, var(--ink) 36%, var(--paper));
  transition: color .5s var(--ease);
}
.row-text { margin: 0; max-width: 46ch; font-size: 16.5px; color: var(--ink-2); }
.row:hover .row-title, .row.on .row-title { color: var(--ink); }
.row.on .row-idx, .row:hover .row-idx { color: var(--accent-text); }
@media (max-width: 860px) {
  .row { grid-template-columns: 40px minmax(0, 1fr); }
  .row-text { grid-column: 2; margin-top: 12px; }
}

/* ── Screenshot gallery ── */
.gal-track {
  display: flex;
  gap: clamp(12px, 2vw, 28px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-inline: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  scroll-padding-inline: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  padding-bottom: 6px;
  scrollbar-width: none;
  cursor: grab;
  outline-offset: -2px;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-track.is-drag { cursor: grabbing; scroll-snap-type: none; }
.gal-track.is-drag img { pointer-events: none; }
.shot { flex: none; width: min(80vw, 780px); margin: 0; scroll-snap-align: start; }
.gal-track.is-portrait .shot { width: min(64vw, 300px); }
.shot .crop { padding: 12px; }
.shot img {
  width: 100%;
  border-radius: 10px;
  background: var(--paper-2);
  box-shadow: 0 0 0 1px var(--rule), 0 26px 50px -34px rgb(40 28 16 / .55);
  -webkit-user-drag: none;
  user-select: none;
}
.gal-track.is-portrait .shot img { border-radius: 24px; }
.shot figcaption { display: flex; gap: 14px; padding: 4px 12px 0; color: var(--muted); }
.shot figcaption span:first-child { color: var(--ink); }
.gal-bar { position: relative; height: 1px; margin-top: 26px; overflow: hidden; background: var(--rule); }
.gal-bar span { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(.1); transition: transform .25s linear; }
.gal-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  transition: background-color .25s, color .25s, opacity .25s;
}
.gal-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.gal-btn:disabled { opacity: .35; cursor: default; }
[data-gal-count] { min-width: 7ch; margin-right: 6px; }

/* ── Dark band: companion app ── */
.band {
  --ink: var(--on-night);
  --ink-2: var(--on-night-2);
  --muted: var(--on-night-2);
  --rule: var(--night-rule);
  margin-top: clamp(90px, 14vh, 180px);
  padding-block: clamp(76px, 12vh, 150px);
  background: var(--night);
  color: var(--on-night);
}
.band .title em { color: color-mix(in oklab, var(--accent) 55%, white); }
.band-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.band .idx { margin: 0 0 18px; color: var(--on-night-2); }
.band-lead { max-width: 46ch; margin: 24px 0 32px; font-size: 18.5px; color: var(--on-night-2); }
.pair { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; }
.pair-a, .pair-b { display: grid; justify-items: center; gap: 14px; color: var(--on-night-2); text-align: center; }
.pair .icon { width: clamp(92px, 11vw, 168px); box-shadow: 0 30px 60px -30px rgb(0 0 0 / .8); }
.pair-b { transform: translateY(18%); }
.pair-a { transform: translateY(-12%); }
.pair-line { width: 100%; height: 70px; overflow: visible; }
.pair-line path { fill: none; stroke: var(--on-night-2); stroke-width: 1.2; stroke-dasharray: 3 7; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: no-preference) {
  .pair-line path { animation: dash 1.6s linear infinite; }
}
@keyframes dash { to { stroke-dashoffset: -20; } }
@media (max-width: 860px) { .band-grid { grid-template-columns: 1fr; } .pair { max-width: 440px; } }

/* ── Specs ── */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); margin: 0; border-top: 1px solid var(--rule); }
.specs div { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(0, 2.6fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.specs dt { padding-top: 3px; color: var(--muted); }
.specs dd { margin: 0; }
.spec-links { display: flex; flex-wrap: wrap; gap: 26px; margin: 26px 0 0; }
.spec-links a { text-decoration: none; border-bottom: 1px solid var(--rule-2); padding-bottom: 2px; }
.spec-links a:hover { border-color: var(--ink); }
@media (max-width: 860px) { .specs { grid-template-columns: 1fr; } }

/* ── Statement with words that light up while scrolling ── */
.statement { padding-block: clamp(110px, 20vh, 240px); }
.statement-text {
  max-width: 19ch;
  margin: 0 auto;
  font-size: clamp(36px, 5.6vw, 92px);
  line-height: .94;
  text-align: center;
}
.statement-text.is-split .sw { color: color-mix(in srgb, var(--ink) 17%, var(--paper)); transition: color .35s; }
.statement-text.is-split .sw.lit { color: var(--ink); }

/* ── App index ── */
.ix-group + .ix-group { margin-top: clamp(44px, 7vh, 80px); }
.ix-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 24px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--muted);
}
.ix-head span:first-child { color: var(--ink); }
.ix-list { list-style: none; margin: 0; padding: 0; }
.ix-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 140px 160px 110px 32px;
  align-items: center;
  gap: var(--gap);
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  isolation: isolate;
}
.ix-row::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gap) * -.6);
  z-index: -1;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  opacity: 0;
  transition: opacity .3s;
}
.ix-row:hover::before, .ix-row:focus-visible::before { opacity: 1; }
.ix-row .icon { width: 56px; height: 56px; transition: transform .5s var(--ease); }
.ix-row:hover .icon { transform: rotate(-7deg) scale(1.08); }
.ix-name { font-size: clamp(26px, 3.3vw, 50px); line-height: 1; }
.ix-meta { color: var(--muted); }
.ix-state { justify-self: end; }
.ix-state.is-soon { color: var(--muted); }
.ix-row.is-current .ix-state { color: var(--accent-text); }
.ix-arr { justify-self: end; font-size: 20px; transition: transform .4s var(--ease); }
.ix-row:hover .ix-arr { transform: translateX(6px); }
.page-apps .ix-row { grid-template-columns: 72px minmax(0, 1fr) 140px 160px 110px 32px; padding: 18px 0; }
.page-apps .ix-row .icon { width: 72px; height: 72px; }
@media (max-width: 960px) {
  .ix-row, .page-apps .ix-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: "i n s" "i m s";
    row-gap: 4px;
    column-gap: 16px;
  }
  .ix-row .icon, .page-apps .ix-row .icon { grid-area: i; width: 52px; height: 52px; }
  .ix-name { grid-area: n; font-size: 28px; }
  .ix-meta { grid-area: m; }
  .ix-dev, .ix-arr { display: none; }
  .ix-state { grid-area: s; }
  .ix-head { grid-template-columns: minmax(0, 1fr) auto; }
  .ix-head span:nth-child(2) { display: none; }
}

/* ── Footer ── */
.ft {
  --ink: var(--on-night);
  --ink-2: var(--on-night-2);
  --muted: var(--on-night-2);
  --rule: var(--night-rule);
  margin-top: clamp(80px, 12vh, 150px);
  padding: clamp(60px, 10vh, 110px) 0 30px;
  background: var(--night);
  color: var(--on-night);
  overflow: hidden;
}
.band + .statement { padding-top: clamp(110px, 20vh, 240px); }
.ft-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(36px, 6vw, 110px); }
.ft-line { margin: 0 0 28px; max-width: 15ch; font-size: clamp(30px, 3.6vw, 54px); line-height: .95; }
.ft-mail { display: grid; gap: 6px; margin: 0; color: var(--on-night-2); }
.ft-mail a { font-size: 14px; text-transform: none; letter-spacing: .01em; color: var(--on-night); }
.ft-apps { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: clamp(24px, 3vw, 44px); }
.ft-apps li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--night-rule); break-inside: avoid; }
.ft-apps a { text-decoration: none; }
.ft-app { color: var(--on-night); }
.ft-links { display: flex; gap: 12px; }
.ft-links a { color: var(--on-night-2); }
.ft-links a:hover, .ft-app:hover { color: var(--accent-text); }
.ft-mark { margin-top: clamp(56px, 10vh, 120px); }
.ft-word {
  display: inline-block;
  margin: 0;
  font-size: 15vw;
  line-height: .8;
  white-space: nowrap;
  color: var(--on-night);
  opacity: .94;
}
.ft-base {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--night-rule);
  color: var(--on-night-2);
}
.ft-base a { text-decoration: none; }
.ft-base a:hover { color: var(--on-night); }
@media (max-width: 960px) { .ft-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ft-apps { columns: 1; } }

/* ── Documents: support, privacy, data, terms ── */
.doc { padding-top: clamp(104px, 14vh, 160px); }
.doc-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 7vh, 80px); padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.doc-app { display: inline-flex; align-items: center; gap: 14px; width: max-content; color: var(--ink-2); text-decoration: none; }
.doc-app .icon { width: 56px; height: 56px; }
.doc-app:hover { color: var(--ink); }
.doc-title { font-size: clamp(50px, 8vw, 128px); }
.doc-meta { margin: 0; color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { padding: 10px 15px; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink-2); text-decoration: none; transition: border-color .2s, color .2s; }
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.doc-grid { display: grid; grid-template-columns: minmax(200px, 290px) minmax(0, 1fr); gap: clamp(32px, 6vw, 120px); }
.doc-grid.no-toc { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-bottom: 20px; }
.toc-label { margin: 0 0 14px; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a {
  position: relative;
  display: block;
  padding: 6px 0 6px 16px;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .01em;
  text-transform: none;
  color: var(--muted);
  text-decoration: none;
}
.toc .lv3 a { padding-left: 26px; }
.toc a:hover { color: var(--ink); }
.toc a.is-on { color: var(--ink); }
.toc a.is-on::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-text);
  transform: translateY(-50%);
}
@media (max-width: 960px) { .doc-grid { grid-template-columns: 1fr; } .doc-side { display: none; } }

.prose { max-width: 74ch; font-size: 17.5px; line-height: 1.7; }
.prose > :first-child, .prose > section:first-child > :first-child { margin-top: 0; }
.prose section { scroll-margin-top: 96px; }
.prose h2 {
  margin: 2.2em 0 .7em;
  font-weight: 600;
  font-stretch: 75%;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: .95;
  letter-spacing: -.005em;
  text-transform: uppercase;
}
.prose h3 { margin: 2em 0 .5em; font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.prose p, .prose ul, .prose ol, .prose dl, .prose pre, .prose table { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { padding: 2px 6px; border-radius: 4px; background: var(--paper-2); font: .84em var(--mono); }
.prose pre { padding: 16px 18px; border-radius: 8px; background: var(--paper-2); font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.prose pre code { padding: 0; background: none; }
.prose .lastupdated, .prose .updated { margin-top: -.3em; font: 450 11.5px/1.5 var(--mono); letter-spacing: .045em; text-transform: uppercase; color: var(--muted); }
.prose .contact-box, .prose .contact { margin: 1.6em 0 2.2em; padding: 22px 24px; border: 1px solid var(--rule-2); border-radius: 14px; background: var(--sheet); }
.prose .contact-box > strong:first-child, .prose .contact > strong:first-child {
  display: block;
  margin-bottom: 6px;
  font: 450 11.5px/1.5 var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--muted);
}
.prose .contact p:last-child { margin-bottom: 0; }
.prose details { border-top: 1px solid var(--rule); scroll-margin-top: 96px; }
.prose details:last-of-type { border-bottom: 1px solid var(--rule); }
.prose details + h2 { margin-top: 2em; }
.prose summary {
  position: relative;
  padding: 18px 48px 18px 0;
  list-style: none;
  font-weight: 550;
  font-size: 18.5px;
  line-height: 1.35;
  cursor: pointer;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  font: 400 22px/1 var(--mono);
  color: var(--muted);
  transform: translateY(-50%);
  transition: transform .35s var(--ease), color .2s;
}
.prose summary:hover::after { color: var(--ink); }
.prose details[open] > summary::after { transform: translateY(-50%) rotate(45deg); color: var(--accent-text); }
.prose details[open] { padding-bottom: 10px; }
.prose .fineprint { margin-top: 3em; font-size: 14px; color: var(--muted); }
.prose .muted { color: var(--muted); }
.prose .center { text-align: center; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { font: 450 11px/1.4 var(--mono); letter-spacing: .045em; text-transform: uppercase; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }

/* ── All apps page: icons on orbits ── */
.apps-hero { padding-top: clamp(104px, 14vh, 160px); }
.orbit { position: relative; width: min(100%, 900px); aspect-ratio: 1; margin: 0 auto; container-type: inline-size; }
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--r) * 2cqw);
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ring:nth-child(2) { border-style: dashed; }
.orbit-track { position: absolute; inset: 0; }
.sat {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) / 900 * 100cqw);
  aspect-ratio: 1;
  translate: -50% -50%;
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1cqw)) rotate(calc(var(--a) * -1));
  text-decoration: none;
}
.sat-in { display: block; position: relative; }
.sat .icon { width: 100%; height: auto; transition: transform .45s var(--ease); }
.sat:hover .icon, .sat:focus-visible .icon { transform: scale(1.12); }
.sat-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  translate: -50% 0;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.sat:hover .sat-name, .sat:focus-visible .sat-name { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .orbit-track { animation: spin 180s linear infinite; }
  .sat-in { animation: spin 180s linear infinite reverse; }
  .orbit:hover .orbit-track, .orbit:hover .sat-in, .orbit:focus-within .orbit-track, .orbit:focus-within .sat-in { animation-play-state: paused; }
}
@keyframes spin { to { rotate: 360deg; } }
.orbit-core { position: absolute; inset: 28%; display: grid; place-content: center; gap: 14px; text-align: center; pointer-events: none; }
.orbit-core .display { font-size: clamp(28px, 6.4cqw, 66px); line-height: .9; }
.orbit-core .mono { margin: 0; color: var(--muted); }
.page-404 .nf .lead { margin-bottom: 0; }

/* ── Motion: entrance on load, reveal while scrolling ── */
@media (prefers-reduced-motion: no-preference) {
  .display[data-lines] .ln > span { animation: lineIn 1.15s var(--ease) both; }
  .display[data-lines] .ln:nth-child(2) > span { animation-delay: .07s; }
  .display[data-lines] .ln:nth-child(3) > span { animation-delay: .14s; }
  .hero-fig { animation: figIn 1.5s var(--ease) .12s both; }
  .hero-meta { animation: fadeIn 1s ease .05s both; }
  .hero .lead, .hero .cta-row, .hero .fine { animation: riseIn 1.1s var(--ease) both; }
  .hero .lead { animation-delay: .22s; }
  .hero .cta-row { animation-delay: .3s; }
  .hero .fine { animation-delay: .38s; }
  @supports (animation-timeline: view()) {
    [data-reveal] {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 220px;
    }
  }
}
@keyframes lineIn { from { transform: translateY(110%); } }
@keyframes figIn { from { opacity: 0; transform: translateY(34px) scale(.95); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } }

@media print {
  .sh, .menu, .ft, .gal-ctl, .demo, .statement, #apps { display: none !important; }
  body::before { display: none; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-side { display: none; }
}
