/* DockMute landing page. One stylesheet, no web fonts, no gradients/glows/blur.
   Colors follow the app's Theme.swift: warm paper neutrals + one indigo accent,
   with a little vermilion (shu) and mustard as hand-drawn accents. */

:root {
  color-scheme: light;
  --paper: #f3efe7;
  --sheet: #fcfaf5;
  --well: #e8e2d6;
  --side: #c9c1b1;
  --ink: #24211c;
  --ink-soft: #5c564c;
  --accent: #3b35a8;
  --accent-side: #1f1b6e;
  --on-accent: #ffffff;
  --shu: #c4452c;
  --mustard: #e2b33c;
  --note: #f8e9b0;

  --font: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", ui-rounded,
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI",
    "Yu Gothic", Meiryo, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* hand-cut corners: never quite the same on every side */
  --r-a: 16px 12px 18px 10px / 12px 18px 10px 16px;
  --r-b: 10px 18px 12px 16px / 16px 10px 18px 12px;
}

html:lang(en) { --font: ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif; }

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--paper);
  /* graph paper: 24px squares, drawn with an SVG pattern (no gradients) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M24 0V24H0' fill='none' stroke='%233b35a8' stroke-opacity='.07'/%3E%3C/svg%3E");
  /* grid lines fall on the content column's edges (1008px = 42 squares) */
  background-position: calc(50% + 12px) 0;
  overflow-wrap: anywhere;
  line-break: strict;
}

img, video, svg { max-width: 100%; height: auto; }

/* Japanese line breaks: keep phrases together, avoid one-character last lines */
h1, h2, h3, h4, summary { text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }
:lang(ja) body { word-break: auto-phrase; }

/* one stroke weight for every hand-drawn line */
:root { --stroke: 2.5px; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent-side); text-decoration-thickness: 2.5px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}

code, kbd, pre { font-family: var(--mono); font-size: .9em; }
pre code { font-size: inherit; }
.keys { white-space: nowrap; }
:not(pre) > code {
  background: var(--well);
  padding: .1em .35em;
  border-radius: 4px;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 .4em;
  line-height: 1.6;
  text-align: center;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  border-radius: 6px 5px 7px 5px;
  box-shadow: 0 2px 0 var(--ink);
  font-size: .85em;
}

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

.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: var(--paper);
  padding: 11px 14px; min-height: 44px; line-height: 1.3; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 12px; color: var(--paper); }

.wrap { max-width: 1048px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 420px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px;
  font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none;
}
.brand img { width: 36px; height: 36px; transform: rotate(-4deg); }
.top nav ul { display: flex; flex-wrap: wrap; gap: 0 16px; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.top nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 4px; color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; color: var(--accent); }
@media (max-width: 720px) { .top nav .opt { display: none; } }

/* ---------- headings ---------- */
h1, h2, h3 { line-height: 1.4; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.5rem); margin: .2em 0 .5em; letter-spacing: .01em; }
h2 {
  display: inline-block;
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  margin: 0 0 24px;
  padding: 0 .1em 12px;
  /* wobbly hand-drawn underline */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M3 7c40-4 70 2 110-1s80-5 120-1 45 3 64-1' fill='none' stroke='%233b35a8' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") bottom left / 100% 12px no-repeat;
}
h3 { font-size: 1.12rem; margin: 0 0 .3em; }

section { padding: 72px 0; }
@media (max-width: 560px) { section { padding: 48px 0; } }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 36em; }

/* ---------- hero ---------- */
.hero { padding-top: 24px; padding-bottom: 48px; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; } }

.phrase { display: inline-block; max-width: 100%; }
.circled {
  position: relative; white-space: nowrap;
  /* room for the ring on both sides without moving the word itself */
  padding: 0 .3em; margin-left: -.3em;
}
.circled svg {
  /* sized from the span (width) and the font size (height), so it follows any font */
  position: absolute; left: 0; top: 50%;
  width: 100%; max-width: none; height: 1.5em;
  transform: translateY(-50%);
  overflow: visible; pointer-events: none;
}

.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 24px 0 12px; }
.meta { font-size: .88rem; color: var(--ink-soft); margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 13px;
  font: inherit; font-weight: 700; line-height: 1.3;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--r-a);
  min-height: 48px;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background-color .15s;
}
.btn:focus-visible { outline-offset: 5px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 5px 0 var(--accent-side); border-color: var(--accent-side); }
.btn-primary:hover { color: var(--on-accent); background: #342e9a; }
.btn-plain { background: var(--sheet); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn-plain:hover { color: var(--ink); background: #fff; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary:active { box-shadow: 0 2px 0 var(--accent-side); }
.btn svg { flex: none; }
.btn small { font-weight: 400; opacity: .85; margin-left: -4px; }

/* ---------- the dock toy (ARIA tabs, see site.js) ---------- */
.toy { position: relative; padding: 8px 4px 0; max-width: 520px; }
.tabs { display: flex; gap: 10px; padding-left: 26px; margin-bottom: -4px; position: relative; z-index: 1; }
.tabs button {
  min-height: 44px;
  padding: 8px 16px 12px;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.4;
  color: var(--ink);
  background: var(--note);
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 14px 0 0 / 12px 9px 0 0;
  cursor: pointer;
  transform: translateY(10px) rotate(-1.5deg);
  transition: transform .22s cubic-bezier(.3, 1.4, .5, 1), background-color .2s, color .2s;
}
.tabs button:nth-child(2) { transform: translateY(10px) rotate(1deg); }
.tabs button:nth-child(3) { transform: translateY(10px) rotate(-.5deg); }
/* unselected notes are plain paper; the selected one shows its color */
.tabs button[aria-selected="false"] { background: var(--well); color: var(--ink-soft); }
.tabs button[aria-selected="false"]:hover { background: var(--sheet); color: var(--ink); }
.tabs button:nth-child(2)[aria-selected="true"] { background: #f3d5cb; }
.tabs button:nth-child(3)[aria-selected="true"] { background: #d9d6f3; }
.tabs button:hover { transform: translateY(5px) rotate(0); }
.tabs button:active { transform: translateY(8px) rotate(0); }
.tabs button[aria-selected="true"] { transform: translateY(0) rotate(0); cursor: default; }
.tabs button:focus-visible { outline-offset: 2px; }
.toy-panel { border-radius: 14px; }
.toy-panel:focus-visible { outline-offset: 0; }

.dock-svg { display: block; width: 100%; }
.dock-svg .set .t { opacity: 0; transform: translateY(18px) rotate(-6deg); transform-box: fill-box; transform-origin: center; }
.toy[data-preset="work"] .set-work .t,
.toy[data-preset="write"] .set-write .t,
.toy[data-preset="game"] .set-game .t { opacity: 1; transform: none; }
/* outgoing tiles leave quickly, incoming ones hop in one after another */
.dock-svg .set .t { transition: opacity .12s ease-out, transform .14s ease-in; }
.toy[data-preset="work"] .set-work .t,
.toy[data-preset="write"] .set-write .t,
.toy[data-preset="game"] .set-game .t {
  transition: opacity .2s ease-out .1s, transform .38s cubic-bezier(.3, 1.5, .5, 1) .1s;
}
.toy[data-preset="work"] .set-work .t:nth-child(2),
.toy[data-preset="write"] .set-write .t:nth-child(2),
.toy[data-preset="game"] .set-game .t:nth-child(2) { transition-delay: .15s; }
.toy[data-preset="work"] .set-work .t:nth-child(3),
.toy[data-preset="write"] .set-write .t:nth-child(3),
.toy[data-preset="game"] .set-game .t:nth-child(3) { transition-delay: .2s; }
.toy[data-preset="work"] .set-work .t:nth-child(4),
.toy[data-preset="write"] .set-write .t:nth-child(4),
.toy[data-preset="game"] .set-game .t:nth-child(4) { transition-delay: .25s; }
.toy[data-preset="work"] .set-work .t:nth-child(5),
.toy[data-preset="write"] .set-write .t:nth-child(5),
.toy[data-preset="game"] .set-game .t:nth-child(5) { transition-delay: .3s; }
.toy-note {
  margin: 4px 0 0 18px; font-size: .9rem; color: var(--ink-soft);
  transform: rotate(-1.2deg); transform-origin: left;
}

/* ---------- demo ---------- */
.demo-grid { display: grid; gap: 48px 32px; }
@media (min-width: 880px) { .demo-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.frame {
  position: relative;
  margin: 0;
  padding: 10px 10px 8px;
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: var(--r-b);
  box-shadow: 4px 5px 0 var(--side);
}
.frame:nth-of-type(odd) { transform: rotate(-.6deg); }
.frame:nth-of-type(even) { transform: rotate(.5deg); }
.frame img, .frame video { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--well); }
.frame figcaption { font-size: .9rem; color: var(--ink-soft); padding: 10px 4px 2px; line-height: 1.7; }

.tape {
  display: inline-block;
  padding: 2px 14px;
  font-size: .82rem; font-weight: 700; line-height: 1.6;
  color: var(--ink);
  background: rgba(226, 179, 60, .62);
  /* torn ends */
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 86% 0, 92% 8%, 96% 0, 100% 10%, 98% 50%, 100% 92%, 95% 100%, 90% 92%, 84% 100%, 12% 100%, 7% 92%, 3% 100%, 0 90%, 2% 50%);
  transform: rotate(-3deg);
}
.frame > .tape { position: absolute; top: -14px; left: 22px; }

/* ---------- features: a notebook page ---------- */
.notebook {
  position: relative;
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: var(--r-a);
  padding: 32px 32px 24px 72px;
  box-shadow: 5px 6px 0 var(--side);
}
/* binder holes + red margin line */
.notebook::before {
  content: ""; position: absolute; top: 18px; bottom: 18px; left: 14px; width: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='56'%3E%3Ccircle cx='9' cy='14' r='6' fill='%23e8e2d6' stroke='%23c9c1b1' stroke-width='1.5'/%3E%3C/svg%3E") repeat-y;
}
.notebook::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 48px; width: 0;
  border-left: 1.5px solid rgba(196, 69, 44, .45);
}
@media (max-width: 560px) {
  .notebook { padding: 24px 16px 20px 40px; }
  .notebook::before { left: 6px; transform: scale(.8); transform-origin: top left; }
  .notebook::after { left: 30px; }
}
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px 48px; }
@media (min-width: 820px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { position: relative; padding-left: 34px; }
.features li > svg { position: absolute; left: 0; top: 4px; width: 24px; height: 24px; }
.features p { margin: 0; }
.extras { margin: 24px 0 0; padding-top: 16px; border-top: 1.5px dashed var(--side); font-size: .95rem; color: var(--ink-soft); }

/* ---------- limits: a sticky note ---------- */
.limits-grid { display: grid; gap: 24px 48px; align-items: start; }
@media (min-width: 880px) { .limits-grid { grid-template-columns: 1fr 1.6fr; } }
.sticky {
  position: relative;
  background: var(--note);
  padding: 32px 28px 24px;
  border-radius: 2px 2px 14px 3px / 2px 2px 24px 3px;
  box-shadow: 0 3px 0 rgba(36, 33, 28, .12);
  transform: rotate(-.8deg);
}
.sticky > .tape { position: absolute; top: -12px; left: 50%; margin-left: -50px; width: 100px; height: 26px; background: rgba(252, 250, 245, .7); }
.sticky ul { margin: 0; padding: 0; list-style: none; }
.sticky li { position: relative; padding-left: 30px; margin-bottom: 14px; }
.sticky li:last-child { margin-bottom: 0; }
.sticky li > svg { position: absolute; left: 0; top: 6px; width: 18px; height: 18px; }

/* ---------- install ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 24px 60px; counter-increment: step; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.15rem; color: var(--accent);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 42'%3E%3Cpath d='M22 4c10 0 17 7 16 17-1 11-8 17-18 17S4 31 4 21C5 11 11 5 21 5c4 0 6 1 8 2' fill='%23fcfaf5' stroke='%233b35a8' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.steps > li > h3 { padding-top: 6px; }
@media (max-width: 560px) {
  /* narrow screens: the number sits next to the heading only, the body uses the full width */
  .steps > li { padding-left: 0; }
  .steps > li > h3 { padding-left: 54px; min-height: 42px; }
  .callout { padding: 16px 14px 4px; }
  .way { padding: 12px 12px 4px; }
}
.steps p { margin: .3em 0 .8em; }

.callout {
  background: var(--sheet);
  border: 2px dashed var(--ink);
  border-radius: var(--r-b);
  padding: 20px 20px 8px;
  margin: 12px 0;
}
.callout > p:first-child { margin-top: 0; }
.ways { display: grid; gap: 16px; margin: 16px 0; }
@media (min-width: 880px) { .ways { grid-template-columns: 1fr 1fr; } }
.way { background: var(--paper); border-radius: var(--r-a); padding: 14px 16px 6px; border: 1.5px solid var(--side); min-width: 0; }
.way h4 { margin: 0 0 .3em; font-size: 1rem; }
.way p { margin: .3em 0 .8em; }

.code {
  display: flex; flex-direction: column;
  margin: 8px 0 14px;
  background: var(--ink);
  color: #f3efe7;
  border-radius: 8px 10px 7px 11px;
}
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-size: .88rem; line-height: 1.7;
  white-space: pre;
}
.code pre:focus-visible { outline-color: var(--mustard); outline-offset: -3px; }
/* commands people copy for the install: wrap (at spaces first) so the whole command is always visible */
.way .code pre { white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; }
.code .copy { order: -1; align-self: flex-end; margin: 8px 8px -4px; }
.code .copy[hidden] { display: none; }
.copy {
  font: inherit; font-size: .78rem; font-weight: 700;
  padding: 3px 10px;
  color: var(--ink); background: var(--note);
  border: 1.5px solid var(--ink);
  border-radius: 6px 8px 5px 7px;
  cursor: pointer;
  position: relative;
  min-height: 32px;
}
/* invisible 44px hit area around the small button */
.copy::after { content: ""; position: absolute; inset: -6px -6px; min-height: 44px; }
.copy:hover { background: #fff3c4; }
.copy:active { transform: translateY(1px); }
.copy:focus-visible { outline-color: var(--mustard); }

/* ---------- details (FAQ) ---------- */
details {
  background: var(--sheet);
  border: 2px solid var(--ink);
  border-radius: var(--r-b);
  margin: 0 0 16px;
}
details:nth-of-type(even) { border-radius: var(--r-a); }
summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 48px 14px 18px;
  min-height: 48px;
  font-weight: 700;
  position: relative;
  border-radius: inherit;
  transition: background-color .15s;
}
summary:hover { background: #fff; }
summary:hover::after { color: var(--accent-side); }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute; right: 18px; top: 50%;
  translate: 0 -52%;
  font-size: 1.5rem; font-weight: 400; color: var(--accent);
  line-height: 1;
}
details[open] > summary::after { content: "−"; }
details[open] > summary { border-bottom: 1.5px dashed var(--side); }
details > .body { padding: 12px 18px 6px; }
details > .body > p:first-child { margin-top: 0; }

.faq details { max-width: 780px; }

/* ---------- footer ---------- */
.foot {
  margin-top: 24px;
  padding: 16px 0 40px;
  border-top: 2px solid var(--ink);
  font-size: .92rem;
}
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; align-items: center; }
.foot p { margin: 0; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0; padding: 0; list-style: none; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.foot p a { padding: 0; }

/* ---------- 404 ---------- */
.lost { padding-top: 48px; padding-bottom: 72px; }
.lost .sticky { max-width: min(560px, calc(100% - 12px)); margin: 24px 6px 32px; }
.lost .sticky p { margin: 0; }
.lost .actions { margin-top: 0; }
