/* notonote.app: Noto 4.0's site. It takes its look from the app icon and
   the App Store slides: a dusty-blue ground, ink type with the icon's square
   marker behind one word per title, the folders' colors, and the app's own
   screens and folders. Each picture gets at most one colored shape. */

:root {
  color-scheme: light dark;

  --bg: #e9eef3;          /* a light tint of the icon's #C3D1DF */
  --panel: #f5f7f9;
  --card: #ffffff;
  --ink: #1d1d1f;         /* the icon's N */
  --text: #3d474e;
  --muted: #6b757d;
  --line: rgba(29, 29, 31, 0.1);
  --marker: #ffd84d;      /* the icon's bar */
  --mark-sky: #cfe7ff;
  --mark-mint: #c9f0e6;
  --mark-violet: #e3daf7;
  --mark-coral: #fdd5cf;
  --hit: #ffd84d;

  /* folder colors */
  --coral: #f5685b;
  --sky: #50b6ff;
  --mint: #66c6c2;
  --amber: #fa9757;
  --violet: #b49be3;
  --gold: #fdbf6e;
  --shadow: 0 1px 2px rgba(29, 42, 56, 0.06), 0 8px 24px -12px rgba(29, 42, 56, 0.22);
  --device-shadow: 0 30px 60px -24px rgba(29, 42, 56, 0.35);
  --button: #1d1d1f;
  --button-text: #ffffff;

  /* the app's note colors */
  --app-text: #2e3336;
  --app-muted: #7a8186;
  --app-line: #dedfe2;
  --app-highlight: #cfe7ff;
  --app-code: #f4f6f8;

  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Baskerville, "Baskerville Old Face", "Libre Baskerville", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: clamp(1.5rem, 3vw, 2.25rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The icon's own dark look: a navy ground and the bar in deep gold. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a20;
    --panel: #1d2229;
    --card: #262b33;
    --ink: #f4f5f7;
    --text: #c8cfd6;
    --muted: #8f99a3;
    --line: rgba(255, 255, 255, 0.1);
    --marker: #a8873f;
    --mark-sky: #2c4a6b;
    --mark-mint: #22544d;
    --mark-violet: #4a3d6b;
    --mark-coral: #6b3631;
    --hit: #a8873f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --device-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
    --button: #f4f5f7;
    --button-text: #111214;

    --app-text: #eceef0;
    --app-muted: #9aa0a6;
    --app-line: #3a3f46;
    --app-highlight: #2c4a6b;
    --app-code: #20242a;
  }
}

/* -------------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }

:focus-visible { outline: 3px solid #50b6ff; outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------------ type */

/* Tracking tightens as type grows; body text keeps the font's own. */
.display, .title {
  color: var(--ink);
  font-weight: 700;
  text-wrap: balance;
}
.display {
  font-size: clamp(2.75rem, 7.2vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.title {
  font-size: clamp(2.125rem, 4.4vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}
.lede {
  font-size: clamp(1.1875rem, 1.8vw, 1.375rem);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--muted);
  text-wrap: pretty;
}

/* The icon's marker: a square yellow swipe behind a word. It sweeps in once,
   left to right, like the app's onboarding titles. */
.mark {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}
.mark::before {
  content: "";
  position: absolute;
  inset: 0.2em -0.06em 0.04em;
  z-index: -1;
  background: var(--mark, var(--marker));
  transform: rotate(-2deg);
  transform-origin: left center;
}
.js .mark::before {
  transform: rotate(-2deg) scaleX(0);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.25s;
}
.js .in .mark::before { transform: rotate(-2deg) scaleX(1); }

/* --------------------------------------------------------------- buttons */

.button, .store {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out, opacity 0.2s;
}
.button { padding: 0.5rem 1rem; font-size: 0.9375rem; }
.store { padding: 0.875rem 1.5rem; font-size: 1.0625rem; }
.button:hover, .store:hover { opacity: 0.88; }
.button:active, .store:active { transform: scale(0.97); }

/* ------------------------------------------------------------------- nav */

/* A translucent bar; content scrolls under it, and a soft edge fades in
   once it does. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
}
.nav::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 1.25rem;
  background: linear-gradient(color-mix(in srgb, var(--bg) 70%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.nav.scrolled::after { opacity: 1; }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img { width: 2rem; height: 2rem; border-radius: 0.45rem; }
.nav-links { display: flex; gap: 1.75rem; margin-left: auto; margin-right: 1.75rem; }
.nav-links a { color: var(--muted); font-size: 0.9375rem; font-weight: 500; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 640px) { .nav-links { display: none; } }

@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ------------------------------------------------------------------ hero */

.hero {
  overflow-x: clip;
  padding-top: clamp(3rem, 8vw, 6rem);
  text-align: center;
}
.hero-copy { display: grid; justify-items: center; gap: 1.5rem; }
.hero .lede { max-width: 26em; }
.cta { display: grid; justify-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.cta small { color: var(--muted); font-size: 0.875rem; }

/* ---------------------------------------------------------------- scenes */

/* A scene is a design canvas --sw units wide that scales with its width.
   Children sit at --x/--y and are --w wide, in those units. */
.scene {
  position: relative;
  container-type: inline-size;
  --u: calc(100cqw / var(--sw));
}
.scene > * {
  position: absolute;
  left: calc(var(--x, 0) * var(--u));
  top: calc(var(--y, 0) * var(--u));
  width: calc(var(--w) * var(--u));
  rotate: calc(var(--r, 0) * 1deg);
  z-index: var(--z, 10);
}
.scene > .shape { color: var(--c); z-index: var(--z, 1); }
.scene > .circle { aspect-ratio: 1; border-radius: 50%; background: var(--c); }
.scene > .arrows { inset: 0; width: 100%; height: 100%; rotate: none; z-index: 60; color: var(--ink); pointer-events: none; }

/* A feature label, like the App Store slides'. */
.pill {
  display: inline-block;
  width: auto;
  padding: calc(8 * var(--u)) calc(16 * var(--u));
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-size: calc(16 * var(--u));
  font-weight: 700;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 calc(8 * var(--u)) calc(18 * var(--u)) calc(-8 * var(--u)) rgba(29, 42, 56, 0.45);
}

.devices {
  --sw: 1100;
  aspect-ratio: 1100 / 680;
  max-width: 68rem;
  margin: clamp(2.5rem, 6vw, 4.5rem) auto 0;
}
.devices .tablet { --x: 206; --y: 0; --w: 860; }
.devices .phone { --x: 46; --y: 112; --w: 252; --r: -4; --z: 20; }
.devices .h-blob { --x: 850; --y: -50; --w: 330; --r: 20; --c: var(--coral); }
.devices .h-circle { --x: -10; --y: 420; --w: 190; --c: var(--sky); }
.devices .h-sparkle { --x: 150; --y: 56; --w: 40; --r: 10; --c: var(--amber); --z: 30; }
.devices .h-folder { --x: 862; --y: 430; --w: 250; --r: 8; --z: 40; }
.devices .h-folder:not(.front) { filter: drop-shadow(0 10px 14px rgba(29, 42, 56, 0.25)); }
/* The same render again, clipped to the folder's front cover, so the card
   below sits between the folder's back and its front. */
.devices .h-folder.front {
  --z: 42;
  clip-path: polygon(0 46%, 9% 46%, 11% 44.4%, 40.5% 44.5%, 43.5% 47%, 46.5% 49.5%, 89% 49.8%, 91% 52.5%, 100% 52.5%, 100% 100%, 0 100%);
}
/* A Home note card on its way into the Travel folder. Its center sits above
   the folder's center, turned with the folder, plus a slight tilt of its own. */
.devices .h-card {
  --x: 943; --y: 391; --r: 2; --z: 41;
  width: 11em;
  height: 10em;
  overflow: hidden;
  padding: 1em 1.1em;
  border-radius: 1.6em;
  background: linear-gradient(to top, rgba(60, 40, 110, 0.08), transparent 35%), var(--card);
  color: var(--app-text);
  box-shadow: 0 0.2em 0.8em rgba(29, 42, 56, 0.12);
  font-size: calc(var(--k, 1) * 10 * var(--u));
  line-height: 1.4;
  text-align: left;
}
.devices .h-card h3 { margin-bottom: 0.6em; padding-bottom: 0.6em; border-bottom: 1px solid var(--app-line); font-size: 1.35em; font-weight: 600; }
.devices .h-card p { font-size: 0.98em; }
@media (max-width: 700px) {
  .devices { --sw: 400; aspect-ratio: 400 / 580; max-width: 26rem; }
  .devices .tablet { display: none; }
  .devices .phone { --x: 64; --y: 12; --w: 236; }
  .devices .h-blob { --x: 236; --y: -16; --w: 210; }
  .devices .h-circle { --x: -56; --y: 330; --w: 150; }
  .devices .h-sparkle { --x: 30; --y: 20; --w: 30; }
  .devices .h-folder { --x: 226; --y: 392; --w: 180; }
  .devices .h-card { --x: 284.6; --y: 363.8; --k: 0.72; }
}

/* A native app screen in a device frame, sized by its screen width. */
.device {
  --dw: calc(var(--w) * var(--u));
  box-sizing: content-box;
  padding: var(--bezel);
  border-radius: calc(var(--radius) + var(--bezel));
  background: #0d0d0f;
  box-shadow: 0 0 0 calc(var(--bezel) * 0.16) #b8bcc2, var(--device-shadow);
}
.device img { width: 100%; border-radius: var(--radius); }
.device::before {
  /* home indicator */
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
  border-radius: 99px;
  background: #1c1c1e;
}
.phone { --bezel: calc(var(--dw) * 13 / 440); --radius: calc(var(--dw) * 55 / 440); }
.phone::before {
  bottom: calc(var(--bezel) + var(--dw) * 8 / 440);
  width: calc(var(--dw) * 146 / 440);
  height: calc(var(--dw) * 5 / 440);
}
.phone::after {
  /* Dynamic Island */
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: calc(var(--bezel) + var(--dw) * 11 / 440);
  width: calc(var(--dw) * 126 / 440);
  height: calc(var(--dw) * 37 / 440);
  border-radius: 99px;
  background: #000;
}
.tablet { --bezel: calc(var(--dw) * 18 / 1210); --radius: calc(var(--dw) * 34 / 1210); }
.tablet::before {
  bottom: calc(var(--bezel) + var(--dw) * 8 / 1210);
  width: calc(var(--dw) * 200 / 1210);
  height: calc(var(--dw) * 5 / 1210);
}
@media (prefers-color-scheme: dark) { .devices .phone::before { background: #f2f2f2; } }

/* -------------------------------------------------------------- sections */

.section { padding-top: clamp(5rem, 11vw, 9rem); }

.head { display: grid; gap: 1rem; max-width: 34rem; }
.head.center { justify-items: center; margin-inline: auto; text-align: center; max-width: 40rem; }
.head .lede { color: var(--text); }
.head.center + * { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* Copy beside a picture, alternating sides. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.split.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.split.flip .head { order: 2; }
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); }
  .split.flip .head { order: 0; }
}

.panel {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.panel-shape { position: absolute; z-index: -1; color: var(--c); }

@media (prefers-contrast: more) {
  .pill { outline: 1px solid var(--ink); }
  .panel, .theme-preview, .pro { box-shadow: inset 0 0 0 1px var(--ink); }
}

/* --------------------------------------------------------------- write */

.write { --sw: 520; aspect-ratio: 520 / 560; }
.write .phone { --x: 150; --y: 40; --w: 270; }

/* The editor's format bar, rendered by the app (build-assets.sh), with room
   around it for its shadow: 376 units wide for a 328-point bar. */
.write .format-bar { --x: -4; --y: -4; --w: 376; --r: -3; --z: 45; }

/* --------------------------------------------------------- attachments */

/* A collage of note bits, at the app's point sizes in design units. */
.collage { --sw: 560; aspect-ratio: 560 / 620; }
.collage .ring { aspect-ratio: 1; border-radius: 50%; border: calc(6 * var(--u)) solid var(--c); }

.collage .float {
  border-radius: calc(20 * var(--u));
  background: var(--card);
  color: var(--app-text);
  box-shadow: 0 calc(18 * var(--u)) calc(40 * var(--u)) calc(-10 * var(--u)) rgba(40, 52, 66, 0.3), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  font-size: calc(14 * var(--u));
  line-height: 1.45;
  z-index: 40;
}
.collage .polaroid {
  padding: calc(10 * var(--u)) calc(10 * var(--u)) calc(34 * var(--u));
  border-radius: calc(6 * var(--u));
  background: #fff;
  box-shadow: 0 calc(18 * var(--u)) calc(40 * var(--u)) calc(-10 * var(--u)) rgba(40, 52, 66, 0.35);
  z-index: 40;
}
.collage .polaroid img { border-radius: calc(2 * var(--u)); }
.collage .pill { z-index: 46; }

/* Tables as 4.0 draws them: a rounded outline and hairlines between cells. */
.note-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--app-line);
  border-radius: calc(9 * var(--u));
  overflow: hidden;
  font-size: calc(15 * var(--u));
}
.note-table th, .note-table td { border: 0 solid var(--app-line); border-width: 0 1px 1px 0; padding: calc(6 * var(--u)) calc(12 * var(--u)); text-align: left; }
.note-table tr > :last-child { border-right-width: 0; }
.note-table tr:last-child > * { border-bottom-width: 0; }
.note-table th { font-weight: 600; }

.collage .math {
  padding: calc(14 * var(--u)) calc(18 * var(--u));
  font-family: "STIX Two Math", "Latin Modern Math", "Cambria Math", "Times New Roman", serif;
  font-size: calc(26 * var(--u));
}
.collage .math small { display: block; margin-bottom: calc(4 * var(--u)); font-family: var(--font); font-size: calc(13 * var(--u)); font-weight: 700; color: var(--app-muted); }

.collage .code {
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  background: var(--app-code);
  font-family: var(--font-mono);
  font-size: calc(13.5 * var(--u));
  line-height: 1.75;
  white-space: pre;
}
.code .k { color: #a43fbf; }
.code .f { color: #2f6fd6; }
.code .t { color: #c6631a; }
.code .s { color: #c2382f; }
@media (prefers-color-scheme: dark) {
  .code .k { color: #d38cf0; }
  .code .f { color: #79a8ff; }
  .code .t { color: #f2a65a; }
  .code .s { color: #ff7a70; }
}

.link-preview { display: flex; align-items: center; gap: calc(12 * var(--u)); padding: calc(10 * var(--u)); }
.link-preview img { width: calc(46 * var(--u)); border-radius: calc(11 * var(--u)); }
.link-preview b { display: block; font-size: calc(15 * var(--u)); font-weight: 600; }
.link-preview small { color: var(--app-muted); font-size: calc(13 * var(--u)); }

/* Note bits shared by the search results and the theme preview. */
.todo { display: flex; align-items: flex-start; gap: 0.55em; }
.todo svg { flex: none; width: 1.15em; height: 1.15em; margin-top: 0.17em; color: var(--app-muted); }
.todo.done { color: var(--app-muted); }
.todo.done span { text-decoration: line-through; }
.hl { background: var(--app-highlight); border-radius: 0.3em; padding: 0.05em 0.3em; }
.hit { background: var(--hit); color: #1d1d1f; border-radius: 0.2em; padding: 0 0.15em; }
@media (prefers-color-scheme: dark) { .hit { color: #fff; } }

/* ------------------------------------------------------------ organize */

.folders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0rem, 1vw, 0.5rem);
  padding: clamp(1.25rem, 5%, 2.75rem);
}
.folders img:nth-of-type(1) { rotate: -4deg; }
.folders img:nth-of-type(2) { rotate: 3deg; }
.folders img:nth-of-type(3) { rotate: 2deg; }
.folders img:nth-of-type(4) { rotate: -3deg; }

/* -------------------------------------------------------------- search */

.search { padding: clamp(1rem, 4%, 2rem); font-size: clamp(0.8125rem, 1.4vw, 0.9375rem); }
.search-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--app-text);
  font-size: 1.25em;
  font-weight: 500;
}
.search-field svg { width: 1.1em; height: 1.1em; color: var(--app-muted); }
.caret { width: 2px; height: 1.15em; margin-left: -0.45rem; background: #50b6ff; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: start;
}

.note {
  padding: 1em 1em 0.9em;
  border-radius: 1.1em;
  background: var(--card);
  color: var(--app-text);
  box-shadow: var(--shadow);
  line-height: 1.45;
}
.note h3 {
  margin-bottom: 0.55em;
  padding-bottom: 0.55em;
  border-bottom: 1px solid var(--app-line);
  font-size: 1.1em;
  font-weight: 600;
}
.note p + p, .note .todo + .todo { margin-top: 0.35em; }
.folder-tag {
  display: block;
  margin: 0.8em -1em -0.9em;
  padding: 0.45em 1em;
  border-radius: 0 0 1.1em 1.1em;
  background: #66c6c2;
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
}

/* Results rise in one by one once the query is typed. */
.js .results .note { opacity: 0; translate: 0 0.75rem; transition: opacity 0.4s var(--ease-out), translate 0.5s var(--ease-out); }
.js .search.found .note { opacity: 1; translate: 0 0; }
.js .search.found .note:nth-child(2) { transition-delay: 0.06s; }
.js .search.found .note:nth-child(3) { transition-delay: 0.12s; }
.js .search.found .note:nth-child(4) { transition-delay: 0.18s; }

/* -------------------------------------------------------------- themes */

.theme-preview {
  --t-bg: #f2f3f5; --t-card: #fff; --t-text: #344046; --t-muted: #666; --t-line: #dddfe2; --t-tint: #303236;
  max-width: 56rem;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--t-bg);
  color: var(--t-text);
  columns: 2;
  column-gap: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: background-color 0.4s, color 0.4s;
}
.theme-preview .note {
  break-inside: avoid;
  margin-bottom: 1rem;
  background: var(--t-card);
  color: var(--t-text);
  box-shadow: none;
  transition: background-color 0.4s, color 0.4s;
}
.theme-preview .note h3 { border-color: var(--t-line); transition: border-color 0.4s; }
.theme-preview h4 { margin: 0.7em 0 0.25em; font-size: 1em; font-weight: 600; }
.theme-preview .todo { margin-top: 0.35em; }
.theme-preview .todo svg { color: var(--t-tint); }
.theme-preview .todo.done, .theme-preview .muted { color: var(--t-muted); }
.theme-preview blockquote { margin: 0.6em 0; padding: 0.55em 0.8em; border-radius: 0.6em; background: color-mix(in srgb, var(--t-text) 7%, transparent); }
.theme-preview ol, .theme-preview ul { margin: 0.4em 0 0; padding-left: 1.3em; }
.theme-preview .hl { background: color-mix(in srgb, var(--t-tint) 20%, transparent); }
@media (max-width: 600px) {
  .theme-preview { columns: 1; }
  .theme-preview .note:nth-child(n + 3) { display: none; }
}

.theme-picker { display: grid; justify-items: center; gap: 1.25rem; margin-top: 2rem; }
.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.segmented button {
  appearance: none;
  min-width: 6.5rem;
  border: 0;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, color 0.2s;
}
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* One row of nine, shrinking to fit narrow screens. */
.swatches { display: grid; grid-template-columns: repeat(9, minmax(0, 2.5rem)); gap: clamp(0.4rem, 1.5vw, 0.6rem); }
.swatch {
  appearance: none;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--s-bg) 50%, var(--s-card) 50%);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease-out;
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: var(--s-tint);
}
.swatch:active { transform: scale(0.92); }
.swatch[aria-checked="true"] { outline: 2px solid var(--ink); outline-offset: 3px; }
.theme-name { min-height: 1.5em; color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------------- pro */

.pro {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4rem);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.pro-list {
  columns: 2;
  column-gap: 2.5rem;
}
.pro-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  break-inside: avoid;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}
.pro-list .ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: var(--c);
  color: #fff;
}
.pro-list svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pro-icon { width: 4.5rem; border-radius: 22%; box-shadow: var(--shadow); rotate: -6deg; margin-bottom: 0.5rem; }
@media (max-width: 520px) { .pro-list { columns: 1; } }
.pro .fine { margin-top: 2rem; color: var(--muted); font-size: 0.9375rem; text-align: center; text-wrap: balance; }

/* ------------------------------------------------------------- closing */

.closing { padding-bottom: clamp(5rem, 11vw, 9rem); text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 1.25rem; }
.closing-icon { width: 6.5rem; border-radius: 22%; box-shadow: var(--shadow); rotate: -8deg; margin-bottom: 0.5rem; }
.closing .store { margin-top: 0.75rem; }

/* -------------------------------------------------------------- footer */

.footer { padding-block: 2rem 3rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; color: var(--muted); font-size: 0.875rem; }
.footer .brand { font-size: 1.25rem; }
.footer .brand img { width: 1.6rem; height: 1.6rem; border-radius: 0.38rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer nav a { text-decoration: none; }
.footer nav a:hover { color: var(--ink); }
.footer small { margin-left: auto; font-size: inherit; }
@media (max-width: 640px) { .footer small { margin-left: 0; width: 100%; } }

/* -------------------------------------------------------------- reveal */

/* Sections fade up once as they arrive. With reduced motion they only fade. */
.js .reveal { opacity: 0; translate: 0 1.25rem; transition: opacity 0.7s var(--ease-out), translate 0.8s var(--ease-out); }
.js .reveal.in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .results .note { translate: none; transition: opacity 0.3s; }
  .js .mark::before { transform: rotate(-2deg); transition: none; }
  .caret { animation: none; }
}

/* --------------------------------------------------------------- legal */

.legal { padding-block: clamp(3rem, 8vw, 6rem); }
.legal .wrap { max-width: calc(46rem + 2 * var(--gutter)); }
.legal header { display: grid; gap: 0.75rem; margin-bottom: 2.5rem; }
.legal .updated { color: var(--muted); font-size: 0.9375rem; }
.legal article { line-height: 1.65; }
.legal article > * + * { margin-top: 1em; }
.legal h2 { margin-top: 2.5em; color: var(--ink); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.legal h2:not(.plain) { font-size: 0.875rem; letter-spacing: 0.05em; }
.legal h3 { margin-top: 1.75em; color: var(--ink); font-size: 1.0625rem; font-weight: 600; }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: 0.6em; }
.legal .short { padding-left: 1rem; border-left: 3px solid var(--marker); color: var(--ink); }
.legal a { text-decoration-color: var(--marker); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ----------------------------------------------------------------- 404 */

.lost { display: grid; place-items: center; min-height: 60vh; padding-block: 5rem; text-align: center; }
.lost .wrap { display: grid; justify-items: center; gap: 1.25rem; }
