/* 8play.dev, "Build Log": cool paper with a faint dot grid, ink, one orange marker. Light by default, dark by system setting. */

@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/BeVietnamPro-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/BeVietnamPro-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url("/fonts/BeVietnamPro-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #f2f4f7;
  --ink: #12151b;
  --mute: #4d5766;       /* 6.6:1 on bg */
  --rule: #aab3c0;
  --wash: #e5e9ef;
  --mark: #ff5a2b;       /* the only accent, as a fill */
  --accent: #b9300a;     /* same hue, dark enough for text and underlines (5.4:1) */
  --mark-ink: #12151b;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --rail: 12.5rem;
  --r: 6px;
  color-scheme: light;
}
/* dark only when the visitor chooses it (see src/theme.js); the default is always light */
:root[data-theme="dark"] { --bg: #0f1218; --ink: #e9ecf1; --mute: #9aa3b2; --rule: #465060; --wash: #171c25; --mark: #ff6b3d; --accent: #ff8a63; color-scheme: dark; }
[data-theme="dark"] .logo { filter: invert(1) hue-rotate(180deg); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--rule) var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  /* the dot grid of a notebook page, barely there */
  background-image: radial-gradient(color-mix(in oklab, var(--ink) 16%, transparent) 1px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--mark); color: var(--mark-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
.mono { font-family: var(--mono); font-size: 0.9em; }

.skip { position: absolute; left: var(--gutter); top: -5rem; z-index: 10; background: var(--ink); color: var(--bg); padding: 0.5rem 0.9rem; font: 500 0.9375rem/1.2 var(--mono); }
.skip:focus { top: 0.75rem; }
.skip:hover { color: var(--bg); }

/* shell: a sticky rail on the left, the page on the right */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 0 clamp(2rem, 5vw, 4.5rem); max-width: calc(78rem + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.rail { position: sticky; top: 0; align-self: start; display: grid; gap: 2rem; padding-block: 2rem; }
.col { min-width: 0; padding-top: 2rem; display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1; }

.mark-link { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; font: 500 1.375rem/1 var(--mono); letter-spacing: -0.02em; }
.mark-link:hover { color: var(--ink); }
.logo { width: 3rem; height: 2rem; image-rendering: pixelated; flex: none; }
.rail nav { display: grid; gap: 0.25rem; font: 400 0.9375rem/1.4 var(--mono); }
.rail nav a { text-decoration: none; padding: 0.35rem 0.5rem; margin-left: -0.5rem; border-radius: var(--r); color: var(--mute); }
.rail nav a:hover, .rail nav a[aria-current] { color: var(--ink); background: var(--wash); }
.theme { justify-self: start; margin-left: -0.5rem; padding: 0.35rem 0.5rem; border: 0; border-radius: var(--r); background: none; color: var(--mute); font: 400 0.9375rem/1.4 var(--mono); cursor: pointer; }
.theme:hover { color: var(--ink); background: var(--wash); }
.rail .onpage { padding-top: 1.25rem; border-top: 2px dotted var(--rule); }

/* type */
h1, h2 { font-family: var(--mono); font-weight: 500; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.6vw, 4.5rem); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; }
mark { background: linear-gradient(transparent 14%, var(--mark) 14%, var(--mark) 90%, transparent 90%); color: var(--mark-ink); padding: 0 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lede { font-size: clamp(1.1875rem, 2.1vw, 1.375rem); line-height: 1.55; max-width: 33em; margin-top: 1.5rem; text-wrap: pretty; }
.note { color: var(--mute); max-width: 34em; margin-top: 0.75rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin-top: 1.75rem; font: 500 1rem/1.4 var(--mono); }
.links a { display: inline-flex; align-items: center; gap: 0.5rem; padding-block: 0.25rem; }
.go { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
.links a:hover .go { transform: translateX(0.25rem); }

/* sections */
.hero { padding-block: clamp(1.5rem, 5vw, 3.5rem) 0; }
.hero h1 { max-width: 12em; }
.sec { margin-top: clamp(3rem, 7vw, 5rem); border-top: 2px dotted var(--rule); padding-top: 1.25rem; }
.sec > h2 { margin-bottom: 1.25rem; }
.sec :target, .prose :target { scroll-margin-top: 1.5rem; }

/* the index: name ........ status */
.apps li + li { border-top: 1px dotted var(--rule); }
.app { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0 1.25rem; align-items: start; padding: 1.25rem 0.75rem; margin-inline: -0.75rem; border-radius: var(--r); text-decoration: none; }
.app:hover { background: var(--wash); color: var(--ink); }
.app-icon { width: 3.5rem; height: 3.5rem; border-radius: 12px; object-fit: cover; }
.app-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.75rem; }
.app-name { font: 500 clamp(1.375rem, 2.6vw, 1.875rem)/1.15 var(--mono); letter-spacing: -0.03em; }
.app:hover .app-name { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.lead { flex: 1; min-width: 1rem; height: 0; border-bottom: 2px dotted var(--rule); }
.app:hover .lead { border-bottom-color: var(--accent); }
.app-sub { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.15rem 1rem; margin-top: 0.3rem; color: var(--mute); }
.plat { font: 400 0.8125rem/1.4 var(--mono); }

.st { font: 500 0.875rem/1.2 var(--mono); white-space: nowrap; text-transform: lowercase; }
.st::before { content: "["; }
.st::after { content: "]"; }
.st-live { color: var(--ink); }
.st-review { color: var(--accent); }
.st-development { color: var(--mute); }

/* about + contact */
.statement { font: 500 clamp(1.5rem, 3.2vw, 2.25rem)/1.2 var(--mono); letter-spacing: -0.03em; max-width: 18em; text-wrap: balance; margin-top: 1.5rem; }
.story { display: grid; gap: 1rem; max-width: 38em; margin-top: 1.5rem; }
.story p { text-wrap: pretty; }
.github-link { display: inline-flex; align-items: center; gap: 0.5rem; }
.github-icon { width: 1.1rem; height: 1.1rem; flex: none; }
.big { font: 500 clamp(1.5rem, 5.2vw, 3.25rem)/1.1 var(--mono); letter-spacing: -0.035em; overflow-wrap: anywhere; margin-top: 1.5rem; }
.big a { text-decoration-color: var(--mark); text-decoration-thickness: 0.14em; text-underline-offset: 0.12em; text-decoration-skip-ink: none; }
.big a:hover { color: inherit; text-decoration-color: var(--accent); }

/* footer */
.foot { margin-top: clamp(3.5rem, 8vw, 6rem); padding-block: 1.75rem 2.5rem; border-top: 2px dotted var(--rule); color: var(--mute); font: 400 0.875rem/1.6 var(--mono); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; }
.foot p { margin: 0; }
.foot a { color: var(--ink); }
.foot a:hover { color: var(--accent); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.75rem; }
.foot .footer-name { color: var(--ink); font-weight: 500; }
.copyright { width: 100%; font-size: 0.8125rem; }

/* app page */
.crumb { font: 400 0.875rem/1.4 var(--mono); color: var(--mute); }
.crumb a { text-decoration: none; color: var(--ink); }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.app-hero { display: flex; align-items: center; gap: 1.5rem; margin-top: 1.5rem; }
.app-hero .app-icon { width: 6rem; height: 6rem; border-radius: 22px; flex: none; }
.app-hero h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); }
.status-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin-top: 1.75rem; max-width: 40em; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.5rem; }
.badge { display: block; line-height: 0; }
.badge img { height: 2.75rem; width: auto; }
.badge:hover img { opacity: 0.85; }
.app-banner { margin-top: 2.5rem; }
.app-banner img, .screens img { width: 100%; border-radius: var(--r); box-shadow: 0 0 0 1px var(--rule); }
.note + .screens { margin-top: 1.5rem; }
.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; max-width: 52rem; }
.screens figure { margin: 0; min-width: 0; }
.screens a { display: block; line-height: 0; }
.screens figcaption { margin-top: 0.5rem; color: var(--mute); font-size: 0.875rem; line-height: 1.4; }
.diff li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); padding-block: 0.7rem; }
.diff li + li, .steps li + li, .facts > div + div { border-top: 1px dotted var(--rule); }
.diff li::before { content: "+"; font: 500 1.0625rem/1.65 var(--mono); color: var(--accent); }
.steps { counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); padding-block: 0.7rem; }
.steps li::before { content: counter(s) "."; font: 500 1.0625rem/1.65 var(--mono); color: var(--accent); }
.facts > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding-block: 0.8rem; }
.facts dt { font: 400 0.9375rem/1.75 var(--mono); color: var(--mute); }
.facts dd { max-width: 42em; text-wrap: pretty; }

/* long-form pages: Privacy, Terms, Contact, About, Delete data, 404 */
.doc main { padding-top: clamp(0.5rem, 2.5vw, 2rem); }
.prose { max-width: 44rem; }
.prose h1 { margin-bottom: 0.75rem; }
.prose .meta { color: var(--mute); margin: 0 0 2rem; }
.prose .lede { margin-bottom: 0.5rem; }
.prose h2 { margin: 3rem 0 0.75rem; padding-top: 1.25rem; border-top: 2px dotted var(--rule); }
.prose h3 { font: 600 1.0625rem/1.4 var(--text); margin: 1.75rem 0 0.25rem; }
.prose p, .prose li { text-wrap: pretty; }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol { margin-top: 0.9rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-top: 0.75rem; list-style: revert; }
.prose li { margin-block: 0.5rem; }
.prose li::marker { color: var(--accent); }

@media (max-width: 52rem) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1.25rem 0; }
  .rail nav { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
  .rail nav a, .theme { margin-left: 0; }
  .rail .onpage { display: none; }
  .col { padding-top: 0.5rem; min-height: 0; }
  .screens { max-width: none; }
}
@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .app { grid-template-columns: 3rem minmax(0, 1fr); gap: 0 1rem; }
  .app-icon { width: 3rem; height: 3rem; border-radius: 10px; }
  .app-hero { flex-direction: column; align-items: flex-start; }
  .app-hero .app-icon { width: 5rem; height: 5rem; border-radius: 18px; }
  .screens { display: flex; overflow-x: auto; gap: 1rem; padding-bottom: 0.75rem; scroll-snap-type: x proximity; }
  .screens figure { flex: 0 0 68%; scroll-snap-align: start; }
  .facts > div { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .go { transition: none; }
}
