/* Mimitori website. Lexicon tokens from the app's DESIGN.md. */
:root {
  --page: #fbfbfc;
  --surface: #fff;
  --surface-2: #f3f4f6;
  --line: #e3e5ea;
  --line-soft: #eef0f3;
  --line-strong: #cdd1d8;
  --text: #15171c;
  --text-2: #5d6370;
  --text-3: #6b717d;
  --ink: #2747d1;
  --ink-strong: color-mix(in srgb, var(--ink) 90%, #000);
  --on-ink: #fff;
  --link: var(--ink-strong);
  --mark: color-mix(in srgb, var(--ink) 16%, transparent);
  --mark-strong: color-mix(in srgb, var(--ink) 30%, transparent);
  --serif: "Newsreader", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Georgia, serif;
  --sans: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #111317;
  --surface: #16191e;
  --surface-2: #1d2026;
  --line: #262a31;
  --line-soft: #1e2127;
  --line-strong: #3a3f48;
  --text: #eceef2;
  --text-2: #a3a9b5;
  --text-3: #858b97;
  --ink: #8ea3ff;
  --on-ink: #111317;
  --link: var(--ink);
  --mark: color-mix(in srgb, var(--ink) 18%, transparent);
  --mark-strong: color-mix(in srgb, var(--ink) 34%, transparent);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--page); }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1rem/1.65 var(--sans);
  caret-color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--mark-strong); color: var(--text); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 2px; }
:root[data-theme="dark"] :focus-visible { outline-color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
kbd {
  font: 500 0.75em/1 var(--mono);
  padding: 0.2em 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  padding: 0.5rem 0.875rem; background: var(--ink-strong); color: var(--on-ink);
}
.skip:focus { top: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 1rem;
  font: 500 0.9375rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 0; cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.btn--primary { background: var(--ink-strong); color: var(--on-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 78%, #000); }
:root[data-theme="dark"] .btn--primary { background: var(--ink); }
:root[data-theme="dark"] .btn--primary:hover { background: color-mix(in srgb, var(--ink) 85%, #fff); }
.btn--lg { height: 48px; padding: 0 1.375rem; font-size: 1rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  background: none; border: 0; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 0.5rem; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-right: auto;
  color: var(--text); text-decoration: none;
  font: 500 1.375rem/1 var(--serif); letter-spacing: -0.01em;
}
.brand__mark { width: 22px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top__nav { display: none; gap: 1.5rem; margin-right: 1rem; }
.top__nav a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.top__nav a:hover { color: var(--text); }
.theme__sun { display: none; }
:root[data-theme="dark"] .theme__sun { display: block; }
:root[data-theme="dark"] .theme__moon { display: none; }
@media (min-width: 640px) { .top__nav { display: flex; } }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 7vw, 6rem); display: grid; gap: 3rem; }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.25rem); line-height: 1.04; letter-spacing: -0.02em; }
.lede { font: 400 clamp(1.1875rem, 1.05rem + 0.6vw, 1.375rem)/1.5 var(--serif); color: var(--text-2); max-width: 34ch; margin-top: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin: 2rem 0 1rem; }
.quiet-link { color: var(--text-2); }
.small { font-size: 0.875rem; color: var(--text-3); }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: 4rem; align-items: start; }
  .hero__copy { padding-top: 1.5rem; }
  .hero h1 { max-width: 11ch; }
}

/* Specimen: a line as it looks in the app */
.specimen { margin: 0; border-top: 2px solid var(--text); padding-top: 0.75rem; }
.cue-meta { display: flex; justify-content: space-between; font: 400 0.75rem/1 var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; margin: 0 0 1.25rem; }
.line {
  font: 400 clamp(1.5rem, 1.2rem + 1.4vw, 1.875rem)/2.3 var(--serif);
  margin: 0; padding-top: 0.25rem;
  line-break: strict; overflow-wrap: anywhere;
}
.line rt { font: 400 0.42em/1 var(--sans); color: var(--text-2); letter-spacing: 0.02em; }
.w { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; line-height: inherit; }
.w .b { background-repeat: no-repeat; background-position: left bottom; padding-inline: 0.04em; }
.w--new .b { background-image: linear-gradient(transparent 58%, var(--mark) 58%); background-size: 100% 100%; }
.w--saved .b { text-decoration: underline dotted 2px var(--ink); text-underline-offset: 0.32em; }
.w[aria-pressed="true"] .b { background-image: linear-gradient(var(--mark-strong), var(--mark-strong)); box-shadow: inset 0 -2px 0 var(--ink); }
.w:hover .b { box-shadow: inset 0 -2px 0 var(--line-strong); }
.w[aria-pressed="true"]:hover .b { box-shadow: inset 0 -2px 0 var(--ink); }
.idx {
  font: 500 11px/0 var(--mono); color: var(--ink-strong);
  position: relative; top: -1.15em; margin-left: 1px;
}
:root[data-theme="dark"] .idx { color: var(--ink); }
.gloss { font: italic 400 1.0625rem/1.5 var(--serif); color: var(--text-2); margin: 0.5rem 0 1.5rem; }

.readout { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 1.25rem 4.5rem 6rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: baseline;
  width: 100%; padding: 0.625rem 0.5rem; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); font: 400 0.9375rem/1.4 var(--sans); text-align: left; cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
.row:hover { background: var(--surface-2); }
.row[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink); }
.n { font: 500 11px/1 var(--mono); color: var(--ink-strong); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .n { color: var(--ink); }
.wd { font: 400 1.0625rem/1.3 var(--serif); }
.rd { color: var(--text-2); font-size: 0.8125rem; }
.mn { color: var(--text-2); }
.st { font-size: 0.8125rem; color: var(--text-3); }
.row .st { padding-inline: 0.1em; }
.row .st { justify-self: end; }
li:nth-child(1) .st { text-decoration: underline dotted 1.5px var(--ink); text-underline-offset: 0.3em; }
li:nth-child(n+2) .st { background: linear-gradient(transparent 55%, var(--mark) 55%); }
@media (max-width: 420px) {
  .row { grid-template-columns: 1.25rem 4.25rem minmax(0, 1fr) auto; }
  .rd { display: none; }
}

.entry { border-top: 2px solid var(--text); margin-top: 2rem; padding-top: 1rem; }
.entry__head { display: flex; align-items: baseline; gap: 0.75rem; margin: 0; }
.entry__word { font: 400 2.25rem/1.2 var(--serif); }
.entry__read { color: var(--text-2); font-size: 1rem; }
.entry__pos { font: italic 400 0.9375rem/1.4 var(--serif); color: var(--text-3); margin: 0.25rem 0 0.75rem; }
.entry__means { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.entry__means li { padding-left: 0.25rem; margin-bottom: 0.25rem; }
.entry__means li::marker { font: 500 0.75rem var(--mono); color: var(--text-3); }
.entry__kanji { margin: 0; border-top: 1px solid var(--line); }
.entry__kanji div { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.75rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }
.entry__kanji dt { font: 400 1.5rem/1.2 var(--serif); }
.entry__kanji dd { margin: 0; font-size: 0.9375rem; }
.entry__kanji dd span { color: var(--text-3); margin-left: 0.5rem; font-size: 0.875rem; }
.hint { font-size: 0.8125rem; color: var(--text-3); margin-top: 1.25rem; }

/* Feature sections */
.feature { margin-top: clamp(4rem, 9vw, 8rem); }
.feature__text { border-top: 2px solid var(--text); padding-top: 1.25rem; }
.feature h2, .facts h2, .close h2 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 1.25rem; }
.feature__text p { max-width: 62ch; color: var(--text-2); font-size: 1.0625rem; }
.feature__text p:not(.note) { color: var(--text); }
.note {
  font: italic 400 1.1875rem/1.5 var(--serif); color: var(--link);
  padding-left: 1rem; border-left: 1px solid var(--ink); margin-top: 1.5rem;
}
.shot { border: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.shot--phone { width: min(100%, 300px); }
:root[data-theme="dark"] .shot { border-color: var(--line-strong); filter: brightness(.82); }
@media (min-width: 900px) {
  .feature--split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 5rem; align-items: start; }
  .feature--split .shot { margin-top: 0; width: 320px; }
  .feature--flip { grid-template-columns: 320px minmax(0, 1fr); }
  .feature--flip .shot { grid-row: 1; grid-column: 1; }
  .feature--wide .feature__text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 0 4rem; }
  .feature--wide h2 { grid-column: 1 / -1; }
  .feature--wide .note { margin-top: 0; align-self: start; }
}

/* Fine print */
.facts { margin-top: clamp(5rem, 10vw, 9rem); }
.facts h2 { border-top: 2px solid var(--text); padding-top: 1.25rem; }
.facts dl { margin: 0; }
.facts dl div { border-top: 1px solid var(--line); padding: 1.25rem 0; }
.facts dt { font: 500 1.25rem/1.3 var(--serif); margin-bottom: 0.375rem; }
.facts dd { margin: 0; color: var(--text-2); max-width: 62ch; }
@media (min-width: 768px) {
  .facts dl div { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; }
  .facts dt { margin: 0; }
}

.close { margin-block: clamp(5rem, 10vw, 9rem) clamp(4rem, 8vw, 7rem); }
.close h2 { border-top: 2px solid var(--text); padding-top: 1.25rem; }
.nb { white-space: nowrap; }
.close p { color: var(--text-2); font-size: 1.0625rem; margin-bottom: 1.75rem; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 2rem 3rem; font-size: 0.875rem; color: var(--text-3); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
.foot__nav a { color: var(--text-2); }
.credit { max-width: 62ch; margin: 0; }
.credit a { color: inherit; }

/* Text pages (privacy, support) */
.doc { max-width: 44rem; padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem); }
.doc h1 { font-size: clamp(2.25rem, 1.7rem + 2.5vw, 3.25rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 1rem; }
.doc h2 { font-size: 1.625rem; line-height: 1.2; border-top: 2px solid var(--text); padding-top: 1rem; margin: 3rem 0 1rem; }
.doc h3 { font: 500 1.0625rem/1.4 var(--sans); margin: 1.75rem 0 0.5rem; }
.doc p, .doc li { max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.25rem; margin: 0 0 1em; }
.doc li { margin-bottom: 0.4rem; }
.doc ol li::marker { font: 500 0.8125rem var(--mono); color: var(--text-3); }
.doc .lede { margin-top: 0; }
.doc .updated { font: 400 0.8125rem/1 var(--mono); color: var(--text-3); }

/* One authored motion moment: the new-word marks draw in */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .w--new .b { animation: draw 0.9s var(--ease) both; }
  .w[data-i="1"] .b { animation-delay: 0.35s; }
  .w[data-i="2"] .b { animation-delay: 0.55s; }
  @keyframes draw { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
}
