/* Teca blog: /blog and /blog/<slug>.
   Loaded after /style.css, which gives the page shell (dark glow background,
   grain, topbar lockup, footer). This file adds the landing page's voice on
   top: Instrument Serif headlines set tight, blue uppercase kickers, the white
   "Download for iPhone" pill, glass cards. Dark only, like the app. */

/* body.legal is a one-column grid. A grid column is never narrower than its widest
   content, so the data tables (which scroll sideways inside .table-wrap) would widen
   the whole page past a phone screen. minmax(0, 1fr) keeps the column to the screen. */
body.legal.blog-page { grid-template-columns: minmax(0, 1fr); }

/* Same root as the landing page: 17px, and on iPhone and iPad the Dynamic Type body size.
   Text sizes below are rem, so a reader's larger text setting reaches the article. */
html:has(body.blog-page) { font-size: 17px; }
@media (pointer: coarse) and (hover: none) {
  @supports (font: -apple-system-body) { html:has(body.blog-page) { font: -apple-system-body; } }
}
.blog-page main { min-width: 0; }

.blog-page {
  --text: #E8E6E1;
  --muted: rgba(232,230,225,0.72);
  --faint: rgba(232,230,225,0.56);
  --rule: rgba(255,255,255,0.10);
  --read: 680px;
  color: var(--text);
}

/* Topbar: the landing page's header, a wordmark and one white pill. */
.blog-page .topbar { gap: 8px 16px; }
.blog-nav { display: flex; align-items: center; gap: 4px 14px; }
.blog-nav .back-link { font-size: 0.8235rem; color: var(--muted); }
.blog-nav .back-link[aria-current="page"] { color: var(--text); }
.pill-download {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: #fff; color: #0E0E10; text-decoration: none;
  font: 600 0.8235rem/1 Geist, ui-sans-serif, system-ui, sans-serif;
  transition: transform 140ms ease;
}
.pill-download:hover { transform: translateY(-1px); }
.pill-download:focus-visible, .blog-page a:focus-visible, .blog-page button:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 3px;
}
/* Phones: one row. The breadcrumb already links the blog, so the nav keeps only the pill. */
@media (max-width: 480px) {
  .blog-nav .back-link { display: none; }
  .pill-download { padding: 0 14px; font-size: 0.7647rem; }
}

/* Thin reading bar under the topbar. Decorative; the page reads the same without it. */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30;
  background: var(--blue); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

.kicker {
  margin: 0 0 14px;
  color: var(--blue);
  font: 600 0.7647rem/1.2 Geist, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- /blog home ---------- */
.blog-home {
  position: relative; z-index: 5;
  width: 100%; max-width: 1040px; margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--gutter) clamp(48px, 8vw, 96px);
}
.blog-home-title {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: clamp(46px, 7vw, 84px); line-height: 0.95; letter-spacing: -0.035em;
  margin: 0; max-width: 14ch; text-wrap: balance;
}
.blog-home-sub {
  margin: 18px 0 0; max-width: 46ch;
  color: var(--muted); font-size: 1.0588rem; line-height: 1.5; text-wrap: pretty;
}
.post-list { list-style: none; margin: clamp(32px, 5vw, 56px) 0 0; padding: 0; display: grid; gap: 16px; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0;
  border-radius: 28px; overflow: hidden;
  background: rgba(255,255,255,0.035);
  /* A border, not an inset shadow: the art panel's background would paint over an inset shadow. */
  border: 1px solid rgba(137,180,250,0.18);
  color: inherit; text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.post-card:hover { background: rgba(137,180,250,0.05); border-color: rgba(137,180,250,0.38); }
.post-card-art { border-bottom: 1px solid var(--rule); padding: clamp(12px, 2vw, 20px); }
.post-card-art svg { display: block; width: 100%; height: auto; }
.post-card-body { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; }
.post-card-title {
  margin: 0; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: clamp(32px, 4vw, 48px); line-height: 1; letter-spacing: -0.02em; text-wrap: balance;
}
.post-card-dek { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; max-width: 52ch; }
.post-card-meta { margin: 4px 0 0; color: var(--faint); font-size: 0.8235rem; }
.post-card-cta { margin-top: 6px; color: var(--blue); font-weight: 600; font-size: 0.8824rem; }
@media (min-width: 860px) {
  .post-card { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .post-card-art { border-bottom: 0; border-right: 1px solid var(--rule); display: grid; place-items: center; }
  .post-card-body { justify-content: center; }
}

/* ---------- Article ---------- */
.article {
  position: relative; z-index: 5;
  width: 100%; max-width: calc(var(--read) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) var(--gutter) clamp(40px, 6vw, 72px);
}
.crumbs { margin: 0 0 22px; font-size: 0.8235rem; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.article-title {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400;
  font-size: clamp(44px, 8vw, 80px); line-height: 0.95; letter-spacing: -0.035em;
  margin: 0; text-wrap: balance;
}
.article-dek {
  margin: 20px 0 0; color: var(--muted);
  font-size: clamp(1.1176rem, 2.4vw, 1.2941rem); line-height: 1.45; text-wrap: pretty;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 22px 0 0; padding: 0; list-style: none;
  color: var(--faint); font-size: 0.8235rem;
}
.article-meta a { color: inherit; display: inline-flex; align-items: center; min-height: 32px; margin: -6px 0; }
.article-meta li + li::before { content: "·"; margin-right: 14px; color: rgba(232,230,225,0.3); }

/* Prose defaults sit inside :where() so they carry no class weight: any component class
   (.pill-download, .soon-row, .article-end…) wins over them without !important. */
/* Body text follows Dynamic Type but stops at 28px, like the landing page's min(rem, px)
   caps; headings grow with it (max() below) so they never end up smaller than the body. */
.article-body { margin-top: clamp(28px, 5vw, 44px); font-size: min(1.0588rem, 28px); line-height: 1.68; color: rgba(232,230,225,0.88); }
:where(.article-body) p { margin: 0 0 20px; text-wrap: pretty; }
:where(.article-body) h2 {
  font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; color: var(--text);
  font-size: max(clamp(32px, 4.4vw, 42px), 1.7rem); line-height: 1.05; letter-spacing: -0.02em;
  margin: clamp(48px, 7vw, 64px) 0 16px; text-wrap: balance; scroll-margin-top: 24px;
}
:where(.article-body) h3 { color: var(--text); font-size: 1.1176rem; font-weight: 600; margin: 28px 0 8px; }
:where(.article-body) a { color: var(--blue); text-decoration: underline; text-decoration-color: rgba(137,180,250,0.4); text-underline-offset: 3px; }
:where(.article-body) a:hover { text-decoration-color: var(--blue); }
:where(.article-body) strong { color: var(--text); font-weight: 600; }
:where(.article-body) :is(ul, ol) { margin: 0 0 20px; padding-left: 22px; }
:where(.article-body) li { margin: 0 0 10px; padding-left: 4px; }
:where(.article-body) li::marker { color: var(--blue); }
/* Glossary terms: dotted underline, same colour as the text around them. The card is
   placed by the page script under the term; it holds one line and a Wikipedia link. */
:where(.article-body) a.term { color: inherit; text-decoration: underline dotted rgba(137,180,250,0.75); text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: help; }
:where(.article-body) a.term:hover { color: var(--text); text-decoration-color: var(--blue); }
.term-pop {
  position: absolute; z-index: 35; width: min(300px, calc(100vw - 24px));
  padding: 14px 16px; border-radius: 16px;
  background: #1B1B22; color: #E8E6E1;
  box-shadow: inset 0 0 0 1px rgba(137,180,250,0.28), 0 18px 50px rgba(0,0,0,0.55);
  font-size: 0.8824rem; line-height: 1.45;
}
.term-pop[hidden] { display: none; }
.term-pop p { margin: 0; }
.term-pop a { display: inline-flex; align-items: center; min-height: 36px; margin-top: 4px; color: var(--blue); font-weight: 600; text-decoration: none; }
.term-pop a:hover { text-decoration: underline; }
sup.cite { font-size: 0.7059rem; line-height: 0; margin-left: 1px; }
sup.cite a { text-decoration: none; font-variant-numeric: tabular-nums; padding: 2px; }

/* The short answer: first thing under the title, for readers and answer engines. */
.short-answer {
  margin: 0 0 8px; padding: clamp(20px, 3vw, 28px);
  border-radius: 24px; background: rgba(137,180,250,0.06);
  box-shadow: inset 0 0 0 1px rgba(137,180,250,0.24);
}
.short-answer .kicker { margin-bottom: 12px; }
.short-answer :is(ul, ol) { margin: 0; padding-left: 22px; }
.short-answer a { color: inherit; text-decoration: none; }
.short-answer a:hover strong { color: var(--blue); }
.short-answer li { margin: 0 0 8px; color: var(--text); }
.short-answer li:last-child { margin-bottom: 0; }

.toc { margin: 28px 0 32px; padding: 18px 0 0; border-top: 1px solid var(--rule); }
.toc-title { margin: 0 0 8px; color: var(--faint); font-size: 0.7647rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.toc ol { margin: 0; padding-left: 22px; columns: 2 220px; column-gap: 28px; font-size: 0.9412rem; }
.toc li { margin: 0 0 6px; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--text); }

/* Figures: drawn in the site's palette, captions say what to look at. */
.figure { margin: 28px 0; }
/* A real app capture, shown at phone scale inside the dark glass frame. */
.app-shot img { display: block; width: 100%; max-width: 402px; height: auto; margin: 0 auto; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--rule), 0 20px 60px rgba(0,0,0,0.45); }
.app-shot figcaption { text-align: center; }
/* Each figure ships twice: drawn wide for desktop and tall for phones, so labels stay
   at 13 px or more instead of shrinking with a 640-wide drawing. The swap sits at 740 px:
   below that the wide drawing would scale its labels under 12 px. */
.fig-narrow { display: none; }
@media (max-width: 740px) {
  .fig-wide { display: none; }
  .fig-narrow { display: block; }
}
/* Between phone and 740px the tall drawing would outgrow the body text; hold it at 420px. */
.fig-narrow svg { max-width: 420px; margin-inline: auto; }
.figure-art {
  border-radius: 24px; background: #111116; box-shadow: inset 0 0 0 1px var(--rule);
  padding: clamp(12px, 2.5vw, 20px);
}
.figure-art svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin: 12px 4px 0; color: var(--faint); font-size: 0.8824rem; line-height: 1.5; }

/* Data tables scroll sideways on narrow phones instead of squeezing. */
.table-note { margin: 24px 0 10px; color: var(--faint); font-size: 0.8824rem; line-height: 1.45; }
/* Short headers and cells keep three columns inside a 335 px phone column; the wrapper
   still scrolls sideways if a longer table ever needs it. */
.table-wrap { margin: 0 0 24px; overflow-x: auto; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--rule); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9412rem; line-height: 1.4; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th { color: var(--faint); font-weight: 600; font-size: 0.7647rem; letter-spacing: 0.06em; text-transform: uppercase; }
.data-table td { color: rgba(232,230,225,0.88); }
.data-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td:first-child { color: var(--text); }
.table-foot { margin: -12px 0 24px; color: var(--faint); font-size: 0.8235rem; line-height: 1.45; }

/* Sticker anatomy: the one format we suggest, drawn as a sticker. */
.sticker {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin: 8px 0 12px; padding: 12px 18px; border-radius: 12px;
  background: #F4EFE3; color: #1B1B22;
  font: 600 1.1765rem/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.sticker span { white-space: nowrap; }
.sticker .dim { color: #6B5E4A; font-weight: 500; }

.checklist { list-style: none; padding: 0; counter-reset: step; }
.checklist li { position: relative; padding: 0 0 0 44px; margin: 0 0 16px; min-height: 28px; }
.checklist li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(137,180,250,0.14); color: var(--blue);
  font: 600 0.8235rem/1 Geist, ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}

/* The labelled crate (blog/sticker-crate.js on /crate-viz.js). Its poster, shown until
   WebGL paints and kept without it, is one sleeve with its label. */
.sticker-crate { margin: 0; }
.sticker-poster { display: grid; place-items: center; background: #111116; }
.sticker-poster img { width: min(62%, 300px); height: auto; border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.sticker-poster .sticker { position: absolute; top: 14%; right: 18%; margin: 0; font-size: 0.9412rem; }

/* Gear: four plain links, no prices (they change). */
.gear { margin: clamp(40px, 6vw, 56px) 0 0; }
.gear-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .gear-list { grid-template-columns: 1fr 1fr; } }
.gear-list li { margin: 0; padding: 0; }
.gear-list a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 52px;
  padding: 14px 16px; border-radius: 18px; text-decoration: none; color: inherit;
  background: rgba(255,255,255,0.035); border: 1px solid var(--glass-border);
  transition: border-color 140ms ease, background 140ms ease;
}
.gear-list a:hover { border-color: var(--glass-border-strong); background: rgba(137,180,250,0.05); }
.gear-list strong { color: var(--text); font-size: 1rem; line-height: 1.3; }
.gear-list span { color: var(--muted); font-size: 0.8824rem; line-height: 1.4; }
.gear-list strong::after { content: " ↗"; color: var(--blue); font-weight: 400; }

/* Coming soon: the one product moment in the article. */
.coming-soon {
  margin: clamp(48px, 7vw, 64px) 0 0; padding: clamp(22px, 4vw, 36px);
  border-radius: 28px;
  background: radial-gradient(520px 260px at 90% -20%, rgba(137,180,250,0.20), transparent 70%), rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(137,180,250,0.30), 0 30px 80px rgba(137,180,250,0.08);
}
.soon-badge {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;
  padding: 6px 12px; border-radius: 999px; background: rgba(127,217,165,0.10);
  color: #9FE3BE; font: 600 0.7059rem/1 Geist, ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase;
}
.soon-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(127,217,165,0.8); }
.coming-soon h2 {
  margin: 0; font-size: clamp(32px, 4.6vw, 44px); max-width: 18ch;
}
.coming-soon > p:not([class]) { margin: 14px 0 0; color: var(--muted); max-width: 46ch; }
.soon-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none;
}
.soon-row li {
  margin: 0; padding: 8px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  font-size: 0.8824rem; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums;
}
.soon-row li b { display: block; margin-bottom: 4px; color: var(--faint); font-size: 0.7059rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.soon-row .fit { color: #9FE3BE; }
@media (max-width: 480px) {
  .soon-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.soon-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 26px 0 0; }
.soon-actions .pill-download { min-height: 52px; padding: 0 24px; font-size: 0.9412rem; }
.soon-fine { margin: 0; color: var(--faint); font-size: 0.8235rem; }

/* FAQ uses <details> so it works with no script. */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none;
  color: var(--text); font-weight: 600; font-size: 1.0588rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--blue); font-size: 1.4118rem; font-weight: 400; transition: transform 160ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { margin: 0 0 18px; }

.sources { font-size: 0.9412rem; line-height: 1.5; }
.sources ol { padding-left: 26px; }
.sources li { margin: 0 0 12px; scroll-margin-top: 24px; }
.sources li:target { background: rgba(137,180,250,0.08); border-radius: 8px; }
.sources .src-note { display: block; color: var(--faint); font-size: 0.8824rem; }

.article-end { margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 0.8824rem; }
.article-end a { color: var(--blue); }

@media (max-width: 480px) {
  .article-body { font-size: min(1rem, 27px); }
  :where(.article-body) h2 { margin-top: 44px; }
  .sticker { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .pill-download, .faq summary::after { transition: none; }
}
