/* Thermometer Puzzle — thermometerpuzzle.com */
:root {
  --bg: #f7f4ef;
  --bg-2: #efe9e0;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --ink: #171b2b;
  --ink-2: #3a4157;
  --muted: #687089;
  --line: #e4ddd2;
  --line-2: #d6cec1;
  --accent: #2c55e8;
  --accent-ink: #ffffff;
  --mercury: #e2323c;
  --mercury-hi: #ff6a5c;
  --mercury-glow: rgba(226, 50, 60, .35);
  --glass: #edf2f8;
  --glass-edge: #9aaac0;
  --cell: #ffffff;
  --cell-alt: #fbfaf7;
  --grid: #e3e6ee;
  --given: #f1eee8;
  --air: #8a93a8;
  --ok: #18915f;
  --bad: #d9363e;
  --warn: #c77700;
  --hl: rgba(44, 85, 232, .06);
  --shadow: 0 1px 2px rgba(23, 27, 43, .05), 0 8px 30px -8px rgba(23, 27, 43, .14);
  --shadow-lg: 0 30px 80px -20px rgba(23, 27, 43, .28);
  --radius: 18px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1020; --bg-2: #11162a; --surface: #151a2e; --surface-2: #191f36;
    --ink: #eceff7; --ink-2: #c7cce0; --muted: #959db6; --line: #252c46; --line-2: #313a5a;
    --accent: #6d8cff; --accent-ink: #0c1020; --mercury: #ff4652; --mercury-hi: #ff8a7a; --mercury-glow: rgba(255, 70, 82, .45);
    --glass: #222a45; --glass-edge: #4a5781; --cell: #161c31; --cell-alt: #181e35; --grid: #262e4b; --given: #1f2742;
    --air: #7c86a3; --ok: #3ccf8e; --bad: #ff5a64; --warn: #ffb347; --hl: rgba(109, 140, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px -8px rgba(0, 0, 0, .5); --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1020; --bg-2: #11162a; --surface: #151a2e; --surface-2: #191f36;
  --ink: #eceff7; --ink-2: #c7cce0; --muted: #959db6; --line: #252c46; --line-2: #313a5a;
  --accent: #6d8cff; --accent-ink: #0c1020; --mercury: #ff4652; --mercury-hi: #ff8a7a; --mercury-glow: rgba(255, 70, 82, .45);
  --glass: #222a45; --glass-edge: #4a5781; --cell: #161c31; --cell-alt: #181e35; --grid: #262e4b; --given: #1f2742;
  --air: #7c86a3; --ok: #3ccf8e; --bad: #ff5a64; --warn: #ffb347; --hl: rgba(109, 140, 255, .08);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px -8px rgba(0, 0, 0, .5); --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin-top: 0; }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; }
.brand span b { color: var(--mercury); }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .94rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-tools { display: flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 11px; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--line-2); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .nav-links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-tools { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: 22px 0 10px; overflow: hidden; }
.hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 640px; background: radial-gradient(closest-side, var(--mercury-glow), transparent 70%) 20% 40% / 55% 70% no-repeat, radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%) 85% 30% / 50% 60% no-repeat; opacity: .55; pointer-events: none; z-index: -1; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { margin: 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--mercury), var(--mercury-hi)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { max-width: 700px; color: var(--ink-2); font-size: 1.02rem; margin: 8px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mercury); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mercury); box-shadow: 0 0 0 4px var(--mercury-glow); }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .93rem var(--font); cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .2s, border-color .2s, background .2s; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--mercury)); }
.btn-mercury { background: linear-gradient(180deg, var(--mercury-hi), var(--mercury)); color: #fff; border-color: transparent; box-shadow: 0 8px 22px -8px var(--mercury-glow); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font: 500 .88rem var(--font); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.link-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- game ---------- */
.tp { position: relative; }
.tp-top { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tp-sizes { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; color: var(--ink); font: inherit; line-height: 1.15; transition: all .18s; }
.chip b { font-family: var(--display); font-size: .98rem; }
.chip span { font-size: .72rem; color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--line-2); transform: translateY(-1px); }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-checked="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.seg { display: inline-flex; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: 600 .9rem var(--font); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .18s; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-lg { display: flex; }
.seg-lg button { flex: 1; justify-content: center; padding: 11px 14px; font-size: .96rem; }
.dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 14px; line-height: 1; }
.dot.merc { background: radial-gradient(circle at 35% 35%, var(--mercury-hi), var(--mercury)); box-shadow: 0 0 0 3px var(--glass), 0 0 0 4px var(--glass-edge); }
.dot.air { color: var(--air); background: var(--glass); box-shadow: 0 0 0 1px var(--glass-edge); font-weight: 700; }

.tp-stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.tp-boardwrap { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; box-shadow: var(--shadow-lg); }
.tp-meta { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.tp-id { font-weight: 700; color: var(--ink); font-family: var(--display); }
.tp-diff { padding: 3px 10px; border-radius: 999px; background: var(--bg-2); font-weight: 600; font-size: .8rem; }
.tp-timer { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); font-size: 1rem; }
.tp-timer svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tp-pause { width: 34px; height: 34px; }
.tp-progress { height: 4px; background: var(--bg-2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.tp-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mercury), var(--mercury-hi)); border-radius: 4px; transition: width .35s ease; }
.tp-board { position: relative; outline: none; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.tp-board:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.tp-board svg.board { display: block; width: 100%; height: auto; max-height: max(340px, calc(100vh - 210px)); margin: 0 auto; overflow: visible; cursor: pointer; }
.tp-board.loading svg.board { opacity: .25; filter: blur(2px); }
.tp-loading, .tp-paused { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 12px; text-align: center; color: var(--muted); font-weight: 600; z-index: 3; }
.tp-board.loading .tp-loading { display: grid; }
.tp-board.loading:not(:has(svg)) { min-height: 360px; }
.tp-board.is-paused .tp-paused { display: grid; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 14px; }
.tp-loader { width: 22px; height: 92px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 2px var(--glass-edge); position: relative; overflow: hidden; }
.tp-loader span { position: absolute; left: 5px; right: 5px; bottom: 5px; border-radius: 8px; background: linear-gradient(0deg, var(--mercury), var(--mercury-hi)); animation: rise 1.1s ease-in-out infinite alternate; }
@keyframes rise { from { height: 12%; } to { height: 88%; } }

/* svg board parts */
.board .cell { fill: var(--cell); stroke: var(--grid); stroke-width: .025; transition: fill .2s; }
.board .cell.given { fill: var(--given); }
.board .frame { fill: none; stroke: var(--line-2); stroke-width: .05; }
.board .hl { fill: var(--hl); opacity: 0; pointer-events: none; transition: opacity .15s; }
.board.hover .hl { opacity: 1; }
.board .tube-o { fill: none; stroke: var(--glass-edge); stroke-width: .56; stroke-linecap: round; stroke-linejoin: round; }
.board .tube { fill: none; stroke: var(--glass); stroke-width: .48; stroke-linecap: round; stroke-linejoin: round; }
.board .bulb-o { fill: var(--glass-edge); }
.board .bulb { fill: var(--glass); }
.board .shine { fill: #fff; opacity: .55; pointer-events: none; }
.board .g-shine { pointer-events: none; }
.board .m-seg { stroke: var(--mercury); stroke-width: .28; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .26s cubic-bezier(.3, .7, .3, 1), opacity .12s; }
.board .m-seg.on { stroke-dashoffset: 0; opacity: 1; }
.board .m-bulb { fill: var(--mercury); transform: scale(0); transform-box: fill-box; transform-origin: center; transition: transform .32s cubic-bezier(.34, 1.56, .64, 1); }
.board .m-bulb.on { transform: scale(1); }
.board .air path { stroke: var(--air); stroke-width: .07; stroke-linecap: round; fill: none; }
.board .air { opacity: 0; transition: opacity .18s; }
.board .air.on { opacity: 1; }
.board .air.on path { animation: pop .25s cubic-bezier(.34, 1.56, .64, 1); transform-box: fill-box; transform-origin: center; }
@keyframes pop { from { transform: scale(.2); } to { transform: scale(1); } }
.board.instant * { transition: none !important; animation: none !important; }
.board .err { fill: none; stroke: var(--bad); stroke-width: .06; opacity: 0; transition: opacity .2s; pointer-events: none; stroke-dasharray: .12 .08; }
.board .err.on { opacity: 1; }
.board .cursor { fill: none; stroke: var(--accent); stroke-width: .07; opacity: 0; pointer-events: none; transition: x .12s, y .12s; }
.tp-board.kbd .board .cursor { opacity: 1; }
.board .clue rect { fill: transparent; transition: fill .2s; }
.board .clue text { font: 700 .46px var(--display); fill: var(--ink); text-anchor: middle; dominant-baseline: central; transition: fill .2s; }
.board .clue.done text { fill: var(--ok); }
.board .clue.complete text { fill: var(--muted); opacity: .55; }
.board .clue.over rect { fill: color-mix(in srgb, var(--bad) 14%, transparent); }
.board .clue.over text { fill: var(--bad); }
.board .clue { cursor: pointer; }
.board .cell.flash-hint { animation: flashHint 1.6s ease; }
.board .cell.flash-fix { animation: flashFix 1.6s ease; }
.board .cell.flash-bad { animation: flashBad 1.6s ease; }
@keyframes flashHint { 0%, 100% { fill: var(--cell); } 20%, 60% { fill: color-mix(in srgb, var(--accent) 30%, var(--cell)); } }
@keyframes flashFix { 0%, 100% { fill: var(--cell); } 20%, 60% { fill: color-mix(in srgb, var(--warn) 35%, var(--cell)); } }
@keyframes flashBad { 0%, 100% { fill: var(--cell); } 15%, 45%, 75% { fill: color-mix(in srgb, var(--bad) 40%, var(--cell)); } }
.tp-board.celebrate .m-seg.on, .tp-board.celebrate .m-bulb.on { animation: glow 1s ease var(--d, 0ms) 2; }
@keyframes glow { 50% { stroke: var(--mercury-hi); fill: var(--mercury-hi); filter: drop-shadow(0 0 .12px var(--mercury-hi)); } }
.tp-board.solved .board .cell { fill: color-mix(in srgb, var(--ok) 5%, var(--cell)); }
.tp-board.solved .board { cursor: default; }

.tp-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.tp-tip { font-size: .88rem; color: var(--muted); margin: 0; }
.tp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-actions .btn-primary { grid-column: 1 / -1; }
.tp-sub { display: flex; flex-wrap: wrap; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.tp-settings { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px; }
.switch { display: flex; gap: 12px; align-items: center; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; width: 38px; height: 22px; border-radius: 22px; background: var(--line-2); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + .track { background: var(--mercury); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch b { display: block; font-size: .9rem; }
.switch small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.tp-kbd { font-size: .78rem; color: var(--muted); line-height: 2; }
kbd { font: 600 .74rem var(--font); background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--ink-2); }
.tp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 500; font-size: .92rem; max-width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); transition: all .3s cubic-bezier(.3, 1.4, .5, 1); pointer-events: none; z-index: 60; text-align: center; }
.tp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tp-toast.good { background: var(--ok); color: #fff; }
.tp-toast.bad { background: var(--bad); color: #fff; }
.tp-toast.warn { background: var(--warn); color: #fff; }
.tp-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }

.tp-modal { border: 0; padding: 30px 28px 26px; border-radius: 26px; background: var(--surface); color: var(--ink); width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); text-align: center; }
.tp-modal::backdrop { background: rgba(10, 12, 24, .5); backdrop-filter: blur(4px); }
.tp-modal[open] { animation: modalIn .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes modalIn { from { transform: translateY(20px) scale(.95); opacity: 0; } }
.tp-modal h2 { font-size: 2rem; margin-bottom: 4px; }
.modal-x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 1.7rem; color: var(--muted); cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.modal-x:hover { background: var(--bg-2); }
.win-sub { color: var(--muted); font-size: .9rem; }
.win-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 18px 0; }
.win-stats div { background: var(--bg-2); border-radius: 14px; padding: 12px 6px; }
.win-stats b { display: block; font: 700 1.35rem var(--display); }
.win-stats span { font-size: .76rem; color: var(--muted); }
.win-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.win-thermo svg { width: 46px; height: 120px; margin: 0 auto 6px; display: block; }
.win-thermo .g { fill: var(--glass); stroke: var(--glass-edge); stroke-width: 2; }
.win-thermo .m { fill: var(--mercury); }
.win-thermo rect.m { transform-origin: 50% 98px; animation: thermoRise 1.2s cubic-bezier(.3, .8, .3, 1) both; }
@keyframes thermoRise { from { transform: scaleY(0); } }
.stats-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 12px; }
.stats-table th, .stats-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.stats-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }

@media (max-width: 960px) {
  .tp-stage { grid-template-columns: 1fr; }
  .tp-side { position: static; }
  .tp-actions { grid-template-columns: repeat(3, 1fr); }
  .tp-kbd { display: none; }
}
@media (max-width: 560px) {
  .tp-boardwrap { padding: 10px; border-radius: 18px; margin-inline: -6px; }
  .chip { min-width: 0; flex: 1 1 calc(33.33% - 6px); }
  .tp-sizes { width: 100%; }
  .tp-style { width: 100%; }
  .tp-style button { flex: 1; justify-content: center; }
  .tp-actions .btn { padding: 0 8px; font-size: .86rem; }
  .tp-actions .btn svg { display: none; }
}

/* ---------- content ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head p { color: var(--ink-2); font-size: 1.06rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.section.alt .card { background: var(--surface-2); }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--mercury) 12%, transparent); color: var(--mercury); font: 700 1rem var(--display); margin-bottom: 12px; }
.card a.more { font-weight: 600; text-decoration: none; }
.answer-box { border-left: 4px solid var(--mercury); background: var(--surface); padding: 18px 22px; border-radius: 0 14px 14px 0; box-shadow: var(--shadow); margin: 0 0 28px; font-size: 1.05rem; }
.answer-box p:last-child { margin: 0; }
.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose figure { margin: 26px 0; }
.prose figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: 8px; }
.prose table, table.data { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: .95rem; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.prose th, .prose td, table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th, table.data th { background: var(--bg-2); font-weight: 700; font-size: .88rem; }
.table-scroll { overflow-x: auto; }
.callout { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 14px; padding: 16px 18px; margin: 22px 0; }
.callout strong:first-child { color: var(--accent); }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin: 24px 0; }
.figs figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.mini { width: 100%; height: auto; display: block; }
.mini .c { fill: var(--cell); stroke: var(--grid); stroke-width: .025; }
.mini .to { fill: none; stroke: var(--glass-edge); stroke-width: .56; stroke-linecap: round; stroke-linejoin: round; }
.mini .ti { fill: none; stroke: var(--glass); stroke-width: .48; stroke-linecap: round; stroke-linejoin: round; }
.mini .bo { fill: var(--glass-edge); }
.mini .bi { fill: var(--glass); }
.mini .ms { stroke: var(--mercury); stroke-width: .28; stroke-linecap: round; fill: none; }
.mini .mb { fill: var(--mercury); }
.mini .x { stroke: var(--air); stroke-width: .07; stroke-linecap: round; }
.mini .k { font: 700 .46px var(--display); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.mini .hlr { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.mini .q { fill: color-mix(in srgb, var(--warn) 25%, transparent); }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
details.faq summary { cursor: pointer; list-style: none; padding: 18px 50px 18px 20px; font-weight: 650; font-family: var(--display); font-size: 1.06rem; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--mercury); transition: transform .2s; }
details.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details.faq .a { padding: 0 20px 18px; color: var(--ink-2); }
details.faq .a p:last-child { margin: 0; }

.compare td:first-child { font-weight: 600; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--muted); }

.crumbs { font-size: .86rem; color: var(--muted); margin-top: 22px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-hero { padding: 6px 0 28px; }
.page-hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 720px; }
.meta-line { font-size: .86rem; color: var(--muted); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 0 0 30px; font-size: .95rem; }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; columns: 2; column-gap: 30px; }
@media (max-width: 600px) { .toc ol { columns: 1; } }
.cta-band { background: linear-gradient(135deg, #1a1f36, #2a1630); color: #fff; border-radius: 26px; padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 80, 90, .55), transparent); }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { margin: 0; color: #c9cde0; }
.cta-band .btn { position: relative; z-index: 1; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.stats-strip div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; }
.stats-strip b { display: block; font: 700 1.8rem var(--display); color: var(--mercury); }
.stats-strip span { font-size: .86rem; color: var(--muted); }
@media (max-width: 700px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }
.term { padding: 18px 0; border-bottom: 1px solid var(--line); }
.term dt { font: 700 1.1rem var(--display); }
.term dd { margin: 4px 0 0; color: var(--ink-2); }

/* printable page */
.print-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 26px; }
.print-controls label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.print-controls select, .print-controls input { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); min-height: 44px; }
.print-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.print-sheet figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; break-inside: avoid; color: #111; }
.print-sheet figcaption { font-weight: 700; font-size: .9rem; margin-bottom: 8px; color: #111; }
.print-sheet .mini { --cell: #fff; --grid: #bbb; --glass: #fff; --glass-edge: #333; --ink: #111; --mercury: #222; --air: #888; }
.print-solutions { margin-top: 30px; }
.print-solutions .print-sheet { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .print-sheet { grid-template-columns: 1fr; } .print-solutions .print-sheet { grid-template-columns: repeat(2, 1fr); } }

/* ---------- footer ---------- */
.site-footer { margin-top: 80px; background: var(--surface); border-top: 1px solid var(--line); padding: 50px 0 30px; font-size: .92rem; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 30px; }
.foot-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 8px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--mercury); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .tp-side, .tp-top, .tp-progress, .tp-pause, .no-print, .section, .tp-toast, .crumbs, .page-hero .lede { display: none !important; }
  body { background: #fff; color: #000; }
  .hero::before { display: none; }
  .tp-boardwrap { box-shadow: none; border: 0; }
  .tp-stage { display: block; }
  .board .m-seg, .board .m-bulb, .board .air { transition: none; }
  .print-page .section, .print-page .print-area { display: block !important; }
  .print-page .print-controls { display: none !important; }
  .print-sheet figure { border: 1px solid #ccc; }
  .print-solutions { break-before: page; }
}
