/* lumatan.app inner pages (articles, hub, legal, 404) — palette B "warm paper" on the V2.5 homepage system.
   Header, hero band, footer and widgets are always dark; the reading surface is light paper. */
@font-face { font-family: Bricolage; src: url('/assets/fonts/BricolageGrotesque-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Bricolage; src: url('/assets/fonts/BricolageGrotesque-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: Bricolage; src: url('/assets/fonts/BricolageGrotesque-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  /* Chrome — homepage V2.2 / app session palette (UVOnboardingDesign.swift) */
  --bg: #2e1e11; --bg-deep: #20170f; --bg-warm: #5e3413;
  --surface: rgba(255, 236, 210, .045); --surface-hi: rgba(255, 236, 210, .08);
  --line: rgba(255, 236, 210, .13); --line-strong: rgba(255, 214, 160, .24);
  --text: #fff4e5; --text-2: #ead5be; --text-3: #d9bfa3;
  --gold: #ffc93c; --amber: #f2a100; --gold-soft: #ffd66b; --ink: #2a1806;
  /* UV — app scale (diagrams) and the light tones for dark backgrounds (widgets, tiles) */
  --uv-low: #1fb8a6; --uv-mod: #f2b33d; --uv-high: #fb8023; --uv-vhigh: #f1582e; --uv-ext: #c42a4d;
  --tone-low: #9ccead; --tone-mod: #ffce60; --tone-high: #ffac65; --tone-vhigh: #ff8e7d; --tone-ext: #e7ade3;
  --accent2: var(--gold);
  --skin-2: #e8b486; --skin-4: #a96b3c;

  --font-display: Bricolage, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --fs-h1: clamp(40px, 2.6vw + 28px, 68px);
  --fs-h2: clamp(27px, .9vw + 22px, 36px);
  --fs-lead: clamp(18px, .4vw + 16px, 21px);
  --fs-prose: clamp(18px, .2vw + 17px, 19.5px);
  --fs-small: 16px; --fs-caption: 14px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --radius-sm: 12px; --radius: 20px; --radius-lg: 28px;
  --header-h: 72px; --measure: 700px; --rail: 248px;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-dark: inset 0 1px 0 rgba(255, 240, 215, .09), 0 1px 2px rgba(0, 0, 0, .22), 0 10px 22px -10px rgba(0, 0, 0, .45), 0 30px 60px -30px rgba(0, 0, 0, .55);
  --hairline-gold: linear-gradient(90deg, transparent, rgba(255, 201, 60, .32) 30%, rgba(255, 226, 180, .4) 50%, rgba(255, 201, 60, .32) 70%, transparent);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .92 0 0 0 0 .8 0 0 0 .32 -.13'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--r-page); scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; color: var(--r-ink); background: var(--r-page); font: 400 var(--fs-prose)/1.7 var(--font-text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
main { display: block; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 800; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { max-width: 100%; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--r-focus, #ffe3a3); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1200px, 100% - 80px); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; padding: 10px 18px; border-radius: 10px; background: var(--gold); color: var(--ink); font: 600 16px var(--font-ui); transform: translateY(-160%); transition: transform .2s; }
.skip-link:focus { transform: none; }

/* ───────── Header (fixed, so compaction never shifts the page) ───────── */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; color: var(--text); color-scheme: dark; background: rgba(36, 24, 13, .5); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); border-bottom: 1px solid transparent; transition: background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.site-header.is-scrolled { background: rgba(30, 20, 11, .9); border-bottom-color: var(--line); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .7); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s6); transition: height .35s var(--ease); }
.is-scrolled .header-inner { height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 24px/1 var(--font-display); letter-spacing: -.035em; color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 14px -4px rgba(242, 161, 0, .5); transition: transform .35s var(--ease); }
.is-scrolled .brand img { transform: scale(.9); }
.site-nav { margin-left: auto; display: flex; gap: var(--s2); }
.site-nav a { padding: 8px 14px; border-radius: 999px; font: 500 16px/1.2 var(--font-ui); color: var(--text-2); transition: color .2s, background-color .2s; }
.site-nav a:hover { color: var(--text); background: var(--surface-hi); }
.site-nav a[aria-current] { color: var(--text); background: var(--surface-hi); box-shadow: inset 0 0 0 1px var(--line-strong); }
.menu-toggle { display: none; }

/* ───────── App Store button (homepage) ───────── */
.store-btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-height: 42px; padding: 0 18px 0 14px; border-radius: 999px; color: var(--ink); background: linear-gradient(180deg, var(--gold-soft) 0%, var(--gold) 38%, var(--amber) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 -2px 0 rgba(150, 80, 0, .28) inset, 0 10px 24px -10px rgba(242, 161, 0, .75), 0 0 36px -8px rgba(255, 201, 60, .5); font: 650 15px/1 var(--font-ui); letter-spacing: -.005em; white-space: nowrap; transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s; }
.store-btn::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .6) 48%, rgba(255, 255, 255, .15) 56%, transparent 70%); transform: translateX(-130%); }
.store-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.store-btn:hover::after { animation: shimmer-once 1.1s var(--ease) both; }
.store-btn:active { transform: translateY(1px) scale(.98); transition-duration: .08s; }
.store-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; border-radius: 999px; }
.store-btn__logo { width: 19px; height: 19px; margin-top: -2px; fill: currentColor; flex: none; }
@keyframes shimmer-once { from { transform: translateX(-130%); } to { transform: translateX(130%); } }

.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 17px/1.2 var(--font-ui); color: var(--r-ink); transition: color .2s; }
.text-link span { transition: transform .25s var(--ease); }
.text-link:hover { color: var(--r-link); }
.text-link:hover span { transform: translateX(3px); }

/* ───────── Hero band (dark in both palettes) ───────── */
.page-hero { position: relative; isolation: isolate; color: var(--text); color-scheme: dark; padding: calc(var(--header-h) + clamp(32px, 4vw, 64px)) 0 clamp(40px, 4vw, 64px); background: var(--grain), radial-gradient(ellipse 55% 80% at 82% 20%, rgba(156, 86, 28, .5), transparent 70%), radial-gradient(ellipse 40% 60% at 10% 0%, rgba(242, 161, 0, .12), transparent 70%), linear-gradient(160deg, #2e1e11 0%, #3a2312 55%, #4b2a12 100%); }
.page-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--hairline-gold); }
.hero-inner { max-width: 900px; }
.page-hero--hub .hero-inner { max-width: none; }
.page-hero--article .hero-inner, .page-hero--text .hero-inner { max-width: var(--measure); }
.page-hero--article .hero-inner, .page-hero--text .hero-inner { margin-left: max(0px, calc((100% - var(--measure) - var(--rail) - 72px) / 2 + var(--rail) + 72px)); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--s5); padding: 0; list-style: none; font: 500 15px/1.4 var(--font-ui); color: var(--text-3); }
.breadcrumb li + li::before { content: '›'; margin-right: 6px; color: rgba(217, 191, 163, .7); }
.breadcrumb a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(234, 213, 190, .35); text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.breadcrumb a:hover { color: var(--gold); text-decoration-color: currentColor; }
.breadcrumb [aria-current] { color: var(--text-3); }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: var(--s4); font: 600 13px/1.3 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: #f4d3a3; }
.kicker-sun { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 201, 60, .15), 0 0 16px rgba(255, 201, 60, .7); }
.page-hero h1 { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -.036em; }
.page-hero h1 span { color: var(--gold); }
.hero-lede { max-width: 40em; margin-top: var(--s5); font-size: var(--fs-lead); line-height: 1.6; color: var(--text-2); }
.hero-lede a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.article-meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); font: 500 15px/1.4 var(--font-ui); color: var(--text-3); }
.article-meta span + span::before { content: '·'; margin-right: var(--s5); margin-left: calc(-1 * var(--s5) + 8px); color: rgba(217, 191, 163, .6); }
.page-hero > .wrap > * { animation: rise .8s var(--ease-out) both; }
.page-hero > .wrap > :nth-child(2) { animation-delay: .05s; } .page-hero > .wrap > :nth-child(3) { animation-delay: .1s; }
.page-hero > .wrap > :nth-child(4) { animation-delay: .15s; } .page-hero > .wrap > :nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ───────── Reading surface + layout ───────── */
.surface { position: relative; background: var(--r-bg); color: var(--r-ink); padding-bottom: var(--s9); }
.article-layout { display: grid; grid-template-columns: var(--rail) minmax(0, var(--measure)); justify-content: center; column-gap: 72px; padding-top: clamp(40px, 4vw, 64px); }
.toc-rail { grid-column: 1; grid-row: 1; }
.prose { grid-column: 2; grid-row: 1; min-width: 0; color: var(--r-ink); }

/* Table of contents */
.toc { position: sticky; top: calc(60px + 28px); max-height: calc(100vh - 120px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.toc summary { list-style: none; margin-bottom: var(--s3); font: 600 13px/1.3 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--r-ink-3); }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--r-rule); }
.toc a { position: relative; display: block; margin-left: -1px; padding: 7px 0 7px 16px; border-left: 2px solid transparent; font: 500 15px/1.4 var(--font-ui); color: var(--r-ink-2); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--r-ink); }
.toc a.is-active { color: var(--r-ink); border-left-color: var(--r-mark); font-weight: 600; }

/* Prose */
.prose > * + *, .prose section:not(.faq) > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: var(--fs-h2); line-height: 1.14; letter-spacing: -.028em; color: var(--r-ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose > h2:first-child { margin-top: 0; }
.prose h2 + * { margin-top: .75em; }
.prose h3 { margin-top: 1.8em; font: 700 21px/1.3 var(--font-ui); letter-spacing: -.012em; }
.prose strong { font-weight: 650; color: var(--r-strong); }
.prose a:not(.store-btn), .faq a { color: var(--r-link); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--r-link-line); text-underline-offset: .2em; transition: color .2s, text-decoration-color .2s; }
.prose a:not(.store-btn):hover { color: var(--r-link-hover); text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.prose ul:not([class]) { padding-left: 1.2em; }
.prose ul:not([class]) li + li { margin-top: .45em; }
.prose ul:not([class]) li::marker { color: var(--r-mark); }
.prose ol:not([class]) { counter-reset: step; margin-block: 1.4em; padding: 0; list-style: none; display: grid; gap: var(--s3); }
.prose ol:not([class]) > li { counter-increment: step; position: relative; padding: 18px 20px 18px 66px; border-radius: 16px; background: var(--r-card); box-shadow: var(--r-card-shadow); }
.prose ol:not([class]) > li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font: 800 16px/1 var(--font-display); color: var(--ink); background: linear-gradient(180deg, var(--gold-soft), var(--amber)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); }
.prose ol:not([class]) > li strong { display: block; margin-bottom: 2px; }

/* Tables */
.table-wrap { margin-block: 1.8em; overflow-x: auto; border-radius: 18px; background: var(--r-card); box-shadow: var(--r-card-shadow); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font: 400 16px/1.5 var(--font-text); }
caption { caption-side: top; padding: 18px 20px 12px; text-align: left; font: 600 15px/1.45 var(--font-ui); color: var(--r-ink-2); }
th, td { padding: 13px 20px; text-align: left; vertical-align: top; border-top: 1px solid var(--r-rule); }
thead th { padding-block: 10px; font: 600 12.5px/1.35 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--r-ink-3); background: var(--r-table-head); }
tbody th { font: 700 16px/1.5 var(--font-ui); color: var(--r-strong); white-space: nowrap; }
tbody td { color: var(--r-ink); }
tbody td:last-child { color: var(--r-ink-2); }
tbody tr:hover > * { background: var(--r-row-hover); }

/* Diagram */
figure.diagram { margin-block: 2em; padding: clamp(16px, 2.5vw, 28px); border-radius: var(--radius); background: var(--dg-bg); box-shadow: var(--r-card-shadow); color: var(--dg-line); }
figure.diagram svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); }
figure.diagram figcaption { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--r-rule); font-size: 15px; line-height: 1.55; color: var(--r-ink-2); }
.dg-label { fill: var(--dg-ink); font-weight: 650; letter-spacing: -.01em; }
.dg-muted { fill: var(--dg-muted); stroke: var(--dg-muted); }
text.dg-muted { stroke: none; font-weight: 500; }
.dg-line { stroke: var(--dg-line); fill: none; }
.dg-axis { stroke: var(--r-rule-strong); stroke-width: 2; fill: none; }
.dg-accent { fill: var(--dg-accent); stroke: var(--dg-accent); }
text.dg-accent { stroke: none; fill: var(--dg-accent-text); font-weight: 700; }
.dg-sun { fill: var(--gold); stroke: var(--amber); stroke-width: 2; }
.dg-sky { fill: var(--dg-sky); stroke: none; }
.dg-ground { fill: var(--dg-ground); stroke: var(--dg-ground-line); color: var(--dg-ground-line); }
.dg-skin { fill: var(--skin-2); stroke: var(--skin-4); color: var(--skin-2); }
.dg-uv-low { fill: var(--uv-low); stroke: var(--uv-low); } .dg-uv-moderate { fill: var(--uv-mod); stroke: var(--uv-mod); }
.dg-uv-high { fill: var(--uv-high); stroke: var(--uv-high); } .dg-uv-veryhigh { fill: var(--uv-vhigh); stroke: var(--uv-vhigh); }
.dg-uv-extreme { fill: var(--uv-ext); stroke: var(--uv-ext); }
text[class*="dg-uv"] { stroke: none; }
.js figure.diagram .dg-line { stroke-dashoffset: 0; }
.js figure.diagram:not(.in-view) svg > * { opacity: 0; }
.js figure.diagram svg > * { transition: opacity .7s var(--ease-out); }
.js figure.diagram.in-view svg > :nth-child(n + 4) { transition-delay: .12s; }
.js figure.diagram.in-view svg > :nth-child(n + 7) { transition-delay: .3s; }
.js figure.diagram.in-view svg > :nth-child(n + 10) { transition-delay: .45s; }
.in-view .dg-anim-rise { animation: rise .9s var(--ease-out) both; }
.in-view .dg-sun { animation: dg-glow 3.5s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes dg-glow { from { filter: drop-shadow(0 0 0 rgba(255, 180, 40, 0)); } to { filter: drop-shadow(0 0 12px rgba(255, 170, 30, .75)); } }

/* ───────── Widget: dark "session" card in both palettes ───────── */
.widget { --uv-low: var(--tone-low); --uv-mod: var(--tone-mod); --uv-high: var(--tone-high); --uv-vhigh: var(--tone-vhigh); --uv-ext: var(--tone-ext);
  position: relative; isolation: isolate; margin-block: 2em; padding: clamp(20px, 3vw, 30px); border-radius: 24px; color: var(--text); color-scheme: dark; font: 400 16px/1.55 var(--font-text);
  background: var(--grain), radial-gradient(120% 120% at 0% 0%, #6a3a12 0%, #45290f 45%, #2e1e11 100%); box-shadow: var(--shadow-dark), var(--widget-glow, 0 0 0 0 transparent); }
.widget::after { content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255, 226, 180, .38), rgba(255, 226, 180, .07) 38%, rgba(255, 226, 180, .05) 70%, rgba(255, 201, 60, .22)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.widget > * + * { margin-top: 0; }
.widget .widget-fallback { margin: 0; color: var(--text-2); }
.widget.ready .widget-fallback { display: none; }
.widget h3 { margin: 0 0 4px; font: 800 clamp(21px, .6vw + 18px, 25px)/1.2 var(--font-display); letter-spacing: -.022em; color: var(--text); }
.widget h3::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 10px; vertical-align: .12em; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 201, 60, .15), 0 0 14px rgba(255, 201, 60, .7); }
.widget .w-sub { margin: 0 0 var(--s4); font-size: 15px; color: var(--text-2); }
.widget label { display: block; margin: var(--s4) 0 var(--s2); font: 600 14px/1.3 var(--font-ui); color: #f1d9bb; }
.widget label b { color: var(--gold); font-variant-numeric: tabular-nums; }
.widget select, .widget input[type="date"], .widget input[type="time"] { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid rgba(255, 236, 210, .18); border-radius: var(--radius-sm); background: rgba(20, 12, 6, .35); color: var(--text); font: 400 16px var(--font-text); }
.widget select option { color: #2b1d10; }
.widget input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--gold); }
.w-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); }
.w-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.w-chip { min-height: 40px; min-width: 44px; padding: 8px 14px; border: 1px solid rgba(255, 236, 210, .2); border-radius: 999px; background: rgba(255, 236, 210, .06); color: var(--text); font: 600 15px/1.2 var(--font-ui); transition: background-color .2s, border-color .2s, transform .2s var(--ease); }
.w-chip:hover { background: rgba(255, 236, 210, .12); border-color: rgba(255, 214, 160, .4); }
.w-chip[aria-pressed="true"] { color: var(--ink); border-color: transparent; background: linear-gradient(180deg, var(--gold-soft), var(--amber)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 14px -8px rgba(242, 161, 0, .9); }
.w-out { margin-top: var(--s5); padding: 18px 20px; border: 1px solid rgba(255, 236, 210, .1); border-radius: 18px; background: rgba(20, 12, 6, .32); }
.w-out p { margin: 0; color: var(--text-2); }
.w-out p + p { margin-top: var(--s2); }
.w-big { font: 800 clamp(34px, 2vw + 24px, 46px)/1.05 var(--font-display); letter-spacing: -.035em; color: var(--gold); font-variant-numeric: tabular-nums; }
.widget .w-note { margin: var(--s2) 0 0; font-size: 14px; line-height: 1.55; color: var(--text-3); }
.widget .w-note a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.w-band { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 13px/1.3 var(--font-ui); color: #2b1600; }
.w-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-top: var(--s3); }
.w-bar { position: relative; flex: 1; min-height: 3px; border-radius: 6px 6px 2px 2px; transition: height .5s ease; }
.w-bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-3); white-space: nowrap; }
.w-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.w-steps li { display: grid; grid-template-columns: 74px 1fr; gap: var(--s3); color: var(--text); }
.w-steps b { color: var(--gold); font-family: var(--font-display); }
.w-meter { height: 12px; margin-top: var(--s2); overflow: hidden; border-radius: 999px; background: rgba(255, 236, 210, .12); }
.w-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--uv-low), var(--uv-mod), var(--uv-high), var(--uv-vhigh), var(--uv-ext)); transition: width .4s ease; }
.w-stages { margin-top: var(--s3); }
.w-list { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--text); }

/* ───────── In-article App Store card ───────── */
.app-card { position: relative; margin-block: 2.2em; padding: 22px 24px; border-radius: 22px; color: var(--app-ink); background: var(--app-bg); box-shadow: var(--app-shadow); }
.app-card::before { content: ''; position: absolute; inset: -1px -1px auto; height: 2px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, transparent, rgba(255, 201, 60, .7), transparent); }
.app-card__head { display: flex; align-items: center; gap: var(--s4); }
.app-card__head img { width: 52px; height: 52px; flex: none; border-radius: 13px; box-shadow: 0 6px 16px -6px rgba(242, 161, 0, .6); }
.app-card .app-card__eyebrow { margin: 0; font: 600 12.5px/1.3 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--app-ink-3); }
.app-card .app-card__title { margin: 2px 0 0; font: 800 clamp(20px, .5vw + 17px, 23px)/1.2 var(--font-display); letter-spacing: -.022em; color: var(--app-ink); }
.app-card .app-card__text { margin-top: var(--s3); font-size: 16px; line-height: 1.6; color: var(--app-ink-2); }
.app-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s4); }
.app-card .app-card__foot p { margin: 0; font: 500 14px/1.4 var(--font-ui); color: var(--app-ink-3); }
.app-card--wide { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s6); margin: 0; padding: 28px 32px; }
.app-card--wide .app-card__head, .app-card--wide .app-card__text { grid-column: 1; }
.app-card--wide .app-card__foot { grid-column: 2; grid-row: 1 / 3; flex-direction: column; margin: 0; }

/* ───────── FAQ, notice, sources ───────── */
.faq { margin-top: 2.6em; }
.faq h2 { margin-bottom: .6em; }
.faq details { border-top: 1px solid var(--r-rule); }
.faq details:last-child { border-bottom: 1px solid var(--r-rule); }
.faq summary { position: relative; display: block; padding: 18px 48px 18px 0; list-style: none; cursor: pointer; font: 650 18px/1.4 var(--font-ui); letter-spacing: -.01em; color: var(--r-ink); transition: color .2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 4px; top: 50%; width: 30px; height: 30px; margin-top: -15px; border: 1px solid var(--r-rule-strong); border-radius: 50%; background: linear-gradient(var(--r-mark), var(--r-mark)) center / 12px 2px no-repeat, linear-gradient(var(--r-mark), var(--r-mark)) center / 2px 12px no-repeat; transition: transform .3s var(--ease), background-color .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--r-link-hover); }
.faq details p { margin: 0 0 20px; padding-right: 48px; color: var(--r-ink-2); }
.faq details[open] p { animation: rise .45s var(--ease-out) both; }
.notice { margin-top: 2.2em; padding: 18px 22px 18px 54px; position: relative; border-radius: 16px; background: var(--r-notice-bg); border: 1px solid var(--r-notice-line); }
.notice::before { content: '!'; position: absolute; left: 18px; top: 19px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font: 800 13px/1 var(--font-ui); color: var(--ink); background: var(--gold); }
.notice p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--r-notice-ink); }
.notice strong { color: var(--r-notice-ink); }
.sources { margin: 0; padding: 0; list-style: none; counter-reset: src; font-size: 15px; line-height: 1.55; color: var(--r-ink-2); }
.sources li { counter-increment: src; position: relative; padding: 10px 0 10px 36px; border-top: 1px solid var(--r-rule); overflow-wrap: anywhere; }
.sources li::before { content: counter(src); position: absolute; left: 0; top: 11px; min-width: 24px; font: 600 13px/1.5 var(--font-ui); color: var(--r-ink-3); font-variant-numeric: tabular-nums; }
.prose .sources li { color: var(--r-ink-2); }

/* ───────── Keep reading + hub cards ───────── */
.keep-reading { padding-top: var(--s9); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s5); }
.section-head h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -.028em; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.guide-grid > li { display: flex; }
.guide-card { position: relative; display: flex; flex-direction: column; width: 100%; padding: 24px 24px 64px; border-radius: var(--radius); color: var(--r-ink); background: var(--r-card); box-shadow: var(--r-card-shadow); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.guide-card::before { content: ''; position: absolute; inset: -1px -1px auto; height: 2px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, transparent, rgba(255, 201, 60, .55), transparent); opacity: 0; transition: opacity .3s; }
.guide-card__kicker { margin-bottom: var(--s2); font: 600 12.5px/1.3 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--r-ink-3); }
.guide-card h3 { font: 700 19px/1.35 var(--font-ui); letter-spacing: -.014em; text-wrap: pretty; transition: color .2s; }
.guide-card p { margin-top: var(--s2); font-size: 15px; line-height: 1.55; color: var(--r-ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.guide-card i { position: absolute; left: 24px; bottom: 20px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--r-rule-strong); border-radius: 50%; font-style: normal; font-size: 15px; color: var(--r-ink-2); transition: transform .3s var(--ease), color .2s, background-color .2s, border-color .2s; }
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--r-card-shadow-hover); }
.guide-card:hover::before { opacity: 1; }
.guide-card:hover h3 { color: var(--r-link-hover); }
.guide-card:hover i { transform: translateX(4px); color: var(--ink); background: var(--gold); border-color: var(--gold); }

/* Hub */
.chip-nav ul { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s6) 0 0; padding: 0; list-style: none; }
.chip-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 8px 7px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 500 15px/1.2 var(--font-ui); color: var(--text); transition: background-color .2s, border-color .2s; }
.chip-nav a span { min-width: 26px; padding: 3px 7px; border-radius: 999px; background: rgba(255, 201, 60, .14); font: 600 12.5px/1.2 var(--font-ui); color: var(--gold); text-align: center; font-variant-numeric: tabular-nums; }
.chip-nav a:hover { background: var(--surface-hi); border-color: var(--line-strong); }
.featured { margin-top: var(--s8); }
.featured-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s6); margin-bottom: var(--s5); }
.featured-head h2 { font-size: clamp(26px, .8vw + 21px, 32px); line-height: 1.1; letter-spacing: -.026em; }
.featured-head p { max-width: 30em; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.level-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin: 0; padding: 0; list-style: none; }
.level-grid > li { display: flex; }
.level-tile { --tone: var(--gold); position: relative; display: flex; flex-direction: column; width: 100%; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(165deg, rgba(255, 236, 210, .07), rgba(255, 236, 210, .02)); transition: transform .3s var(--ease), border-color .3s, background-color .3s; }
.level-tile small { font: 600 12px/1.2 var(--font-ui); letter-spacing: .1em; color: var(--text-3); }
.level-tile strong { font: 800 36px/1.1 var(--font-display); letter-spacing: -.035em; color: var(--tone); }
.level-tile__band { font: 600 12.5px/1.3 var(--font-ui); letter-spacing: .04em; color: var(--tone); }
.level-tile__title { margin-top: var(--s2); font: 500 14.5px/1.4 var(--font-ui); color: var(--text-2); }
.level-tile::after { content: '→'; position: absolute; right: 14px; top: 14px; font: 500 15px var(--font-ui); color: var(--text-3); transition: transform .25s var(--ease), color .2s; }
.level-tile:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tone) 55%, transparent); background: color-mix(in srgb, var(--tone) 10%, transparent); }
.level-tile:hover::after { transform: translateX(3px); color: var(--tone); }
.level-low { --tone: var(--tone-low); } .level-mod { --tone: var(--tone-mod); } .level-high { --tone: var(--tone-high); }
.level-vhigh { --tone: var(--tone-vhigh); } .level-ext { --tone: var(--tone-ext); }
.surface--hub { padding-top: var(--s4); }
.guide-group { padding-top: var(--s8); scroll-margin-top: calc(var(--header-h) + 8px); }
.group-head { display: flex; align-items: baseline; gap: var(--s4); margin-bottom: var(--s5); padding-bottom: var(--s3); border-bottom: 1px solid var(--r-rule); }
.group-head h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -.028em; }
.group-count { font: 500 15px var(--font-ui); color: var(--r-ink-3); }
.group-note { margin: calc(-1 * var(--s3)) 0 var(--s4); font: 500 15px/1.4 var(--font-ui); color: var(--r-ink-2); }
.hub-cta { padding-top: var(--s9); }

/* Legal */
.prose--legal h2 { font-size: clamp(25px, .7vw + 21px, 31px); }
.prose--legal > p:first-child { font-size: 1.05em; }

/* ───────── Footer (dark in both) ───────── */
.site-footer { position: relative; color: var(--text); color-scheme: dark; background: var(--grain), #20170f; padding-block: var(--s7) var(--s6); }
.site-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--hairline-gold); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); }
.footer-brand p { margin-top: var(--s3); max-width: 30ch; font-size: 15px; line-height: 1.5; color: var(--text-3); }
.footer-top nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-left: auto; }
.footer-top nav a { padding-block: 6px; font: 500 16px var(--font-ui); color: var(--text-2); transition: color .2s; }
.footer-top nav a:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: var(--fs-caption); color: var(--text-3); }

/* ───────── Responsive ───────── */
@media (max-width: 1099px) {
  .article-layout { grid-template-columns: minmax(0, var(--measure)); }
  .toc-rail, .prose { grid-column: 1; }
  .toc-rail { grid-row: 1; margin-bottom: var(--s6); }
  .prose { grid-row: 2; }
  .page-hero--article .hero-inner, .page-hero--text .hero-inner { max-width: var(--measure); margin-inline: auto; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc-box { border-radius: 16px; background: var(--r-card); box-shadow: var(--r-card-shadow); }
  .toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 0; padding: 0 18px; cursor: pointer; }
  .toc summary::after { content: '+'; font: 400 22px/1 var(--font-ui); letter-spacing: 0; color: var(--r-mark); transition: transform .3s var(--ease); }
  .toc-box[open] summary::after { transform: rotate(45deg); }
  .toc ol { margin: 0 18px 16px; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .level-tile__title { display: none; }
}
@media (max-width: 1023px) {
  .wrap { width: min(1200px, 100% - 64px); }
  .featured-head { display: block; }
  .featured-head p { margin-top: var(--s2); }
  .app-card--wide { display: block; }
  .app-card--wide .app-card__foot { flex-direction: row; margin-top: var(--s4); }
}
@media (max-width: 767px) {
  :root { --header-h: 64px; --fs-prose: 18px; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { gap: var(--s3); }
  .is-scrolled .header-inner { height: 56px; }
  .brand { font-size: 21px; gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 9px; }
  .site-header .store-btn { margin-left: auto; min-height: 40px; padding: 0 14px 0 12px; }
  .js .menu-toggle { display: grid; place-content: center; gap: 5px; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 12px; background: transparent; }
  .menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s var(--ease); }
  .menu-open .menu-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-open .menu-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: var(--s2) 16px var(--s4); background: #22170d; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .8); border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s; }
  .menu-open .site-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease), visibility 0s; }
  .site-nav a { padding: 14px 4px; border-radius: 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current] { background: transparent; box-shadow: none; color: var(--gold); }
  .breadcrumb ol { font-size: 14px; margin-bottom: var(--s4); }
  .kicker { font-size: 12px; letter-spacing: .14em; }
  .hero-lede { margin-top: var(--s4); }
  .article-meta { font-size: 14px; }
  .prose h2 { margin-top: 1.9em; }
  .prose ol:not([class]) > li { padding: 16px 16px 16px 58px; }
  .prose ol:not([class]) > li::before { left: 14px; top: 16px; width: 30px; height: 30px; }
  table { font-size: 15px; min-width: 0; }
  thead th { letter-spacing: .04em; }
  tbody th { white-space: normal; }
  th, td { padding: 11px 10px; }
  th:first-child, td:first-child { padding-left: 14px; }
  caption { padding: 14px 14px 10px; }
  .app-card { padding: 20px; }
  .app-card__foot .store-btn { flex: 1 1 100%; }
  .faq summary { font-size: 17px; }
  .faq details p { padding-right: 0; }
  .notice { padding: 16px 18px 16px 50px; }
  .notice::before { left: 16px; top: 17px; }
  .section-head { display: block; }
  .guide-grid { grid-template-columns: 1fr; gap: var(--s3); }
  .guide-card { padding: 20px 20px 20px 20px; padding-right: 64px; }
  .guide-card i { left: auto; right: 18px; bottom: auto; top: 22px; }
  .guide-card p { -webkit-line-clamp: 2; }
  .featured { margin-top: var(--s7); }
  .level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); }
  .level-tile { align-items: center; padding: 10px 0 12px; border-radius: 14px; }
  .level-tile strong { font-size: 26px; }
  .level-tile__band, .level-tile::after { display: none; }
  .chip-nav ul { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .chip-nav ul::-webkit-scrollbar { display: none; }
  .chip-nav li { flex: none; }
  .guide-group { padding-top: var(--s7); }
  .footer-top { flex-direction: column; align-items: flex-start; gap: var(--s5); }
  .footer-top nav { margin-left: 0; }
  .footer-bottom { flex-direction: column; gap: var(--s2); }
}
@media (max-width: 359px) {
  .wrap { width: calc(100% - 24px); }
  .site-header .store-btn span { display: none; }
  .site-header .store-btn { padding: 0 12px; }
}

/* ───────── Reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js figure.diagram:not(.in-view) svg > * { opacity: 1; }
  .store-btn:hover, .guide-card:hover, .level-tile:hover, .guide-card:hover i { transform: none; }
}
@media (min-width: 1100px) { .toc summary { pointer-events: none; } }

/* Palette B — "Warm paper": dark header, hero band and footer (homepage continuity), light reading surface.
   Ink #2B1D10 on #FFF8EE = 15.5:1 · secondary #6B5847 = 6.4:1 (6.0:1 on #FBF1E3) · captions #7D6450 = 5.2:1
   · links #A35A00 = 4.95:1 (5.1:1 on cards), hover #7A4300 = 7.6:1. Widgets and the app card stay dark. */
.palette-b {
  --r-page: #20170f;
  --r-bg: #fff8ee;
  --r-ink: #2b1d10;
  --r-strong: #1e1309;
  --r-ink-2: #6b5847;
  --r-ink-3: #7d6450;
  --r-link: #a35a00;
  --r-link-hover: #7a4300;
  --r-link-line: rgba(163, 90, 0, .4);
  --r-mark: #d98a00;
  --r-focus: #a35a00;
  --r-rule: #efe2ce;
  --r-rule-strong: #e2cfb2;
  --r-card: #fffcf7;
  --r-card-shadow: 0 0 0 1px #f0e3cf, 0 1px 2px rgba(80, 50, 20, .05), 0 14px 30px -20px rgba(94, 52, 19, .28);
  --r-card-shadow-hover: 0 0 0 1px #ecd2a6, 0 2px 4px rgba(80, 50, 20, .06), 0 22px 40px -20px rgba(94, 52, 19, .38);
  --r-table-head: #fbf1e3;
  --r-row-hover: #fff4e4;
  --r-notice-bg: #fff1e4;
  --r-notice-line: #f6d7b7;
  --r-notice-ink: #5a3a1e;
  --dg-bg: #fffcf7;
  --dg-ink: #2b1d10;
  --dg-muted: #6b5847;
  --dg-line: #8a6a4a;
  --dg-sky: #fff3dd;
  --dg-ground: #f3dfc0;
  --dg-ground-line: #b08c64;
  --dg-accent: #f2a100;
  --dg-accent-text: #a35a00;
  --app-bg: var(--grain), radial-gradient(120% 140% at 100% 0%, rgba(242, 161, 0, .22), transparent 60%), linear-gradient(160deg, #4a2d15, #2e1e11);
  --app-shadow: 0 1px 2px rgba(46, 30, 17, .2), 0 20px 40px -18px rgba(94, 52, 19, .55);
  --app-ink: #fff4e5;
  --app-ink-2: #ead5be;
  --app-ink-3: #d9bfa3;
  --widget-glow: 0 24px 50px -24px rgba(94, 52, 19, .6);
}
.palette-b .surface { color-scheme: light; }
.palette-b .surface--hub { background: linear-gradient(#fbf1e3, #fff8ee 420px); }
.palette-b ::selection { background: #ffe29a; color: #2b1d10; }
.palette-b .surface :focus-visible { outline-color: #a35a00; }
.palette-b .surface .store-btn:focus-visible { outline-color: #2b1d10; }
.palette-b .guide-card:hover i, .palette-b .toc a.is-active { border-color: var(--r-mark); }

/* Widget additions for the CSP-safe site.js (no style="" attributes) */
.w-bar.is-now { outline: 2px solid var(--text); outline-offset: 1px; }
.widget .w-note--after-bars { margin-top: 28px; }

/* 404 */
.not-found { padding-top: clamp(40px, 4vw, 64px); }
.not-found .guide-grid { margin-top: var(--s5); }

/* Analytics consent bar (analytics.js shows it to visitors in European time zones) */
.consent { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border-radius: 18px; background: rgba(36, 24, 13, 0.94); border: 1px solid rgba(255, 201, 60, 0.22); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); color: #f4e7d6; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 280px; }
.consent a { color: #ffc93c; }
.consent-actions { display: flex; gap: 8px; }
.consent-button { border: 1px solid rgba(255, 201, 60, 0.45); background: transparent; color: #fff4e4; border-radius: 999px; padding: 8px 16px; font: 600 14px -apple-system, system-ui, sans-serif; cursor: pointer; }
.consent-button[data-consent-choice="granted"] { background: linear-gradient(180deg, #ffd66b, #f2a100); color: #2b1600; border-color: transparent; }
.consent-button:focus-visible { outline: 3px solid #ffc93c; outline-offset: 2px; }
.analytics-control { margin: 12px 0 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(163, 90, 0, 0.25); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.analytics-control[hidden] { display: none; }
.analytics-control button { border: 1px solid rgba(163, 90, 0, 0.45); background: transparent; color: inherit; border-radius: 999px; padding: 6px 14px; font: 600 14px -apple-system, system-ui, sans-serif; cursor: pointer; }
