/* Unflagged: clean, calm, motion with purpose. Light theme, one accent. */
:root {
  --bg: #fafaf9; --surface: #ffffff; --ink: #0b0b0c; --ink-2: #3d3d40; --muted: #74747a; --line: #ebebe8; --line-2: #dcdcd7;
  --accent: #ff3b2f; --accent-ink: #fff; --accent-soft: #fff1ef;
  --low: #12a150; --mid: #d98a00; --high: #e5342a;
  --low-soft: #e5f6ec; --mid-soft: #fdf2dc; --high-soft: #fde7e5;
  --radius: 20px; --radius-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 30px rgb(0 0 0 / .05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.55; overflow-x: hidden; }
a { color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; background: #f1f1ee; padding: 2px 6px; border-radius: 6px; }
.wrap { width: min(100% - 40px, 1080px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: rgb(250 250 249 / .72); border-bottom: 1px solid transparent; transition: border-color .3s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 2.4s var(--ease) infinite; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 500; transition: color .2s; }
.topbar nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 12vh, 128px) 0 40px; text-align: center; }
.eyebrow { display: inline-block; margin: 0; color: var(--accent); font-weight: 600; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.headline { font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: .98; letter-spacing: -.045em; font-weight: 750; margin: 18px auto 22px; max-width: 15ch; text-wrap: balance; }
.headline .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; }
.headline .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease-out); transition-delay: calc(var(--i) * 70ms + .05s); }
.headline.in .w > span { transform: none; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--muted); max-width: 40rem; margin: 0 auto; }

/* ---------- check ---------- */
.check { max-width: 720px; margin: 44px auto 0; }
.field { position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 8px 8px 8px 52px; box-shadow: var(--shadow); transition: border-color .25s, box-shadow .35s var(--ease), transform .35s var(--ease); }
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 6px rgb(11 11 12 / .06), var(--shadow); transform: translateY(-1px); }
.field-icon { position: absolute; left: 20px; width: 22px; height: 22px; color: var(--muted); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.08rem; padding: 12px 4px; color: var(--ink); }
.field input::placeholder { color: #a8a8ad; }
button { font: inherit; }
.primary { border: 0; cursor: pointer; background: var(--ink); color: #fff; font-weight: 600; border-radius: 999px; padding: 14px 22px;
  display: inline-flex; align-items: center; gap: 10px; transition: transform .25s var(--ease), background .25s, opacity .25s; white-space: nowrap; }
.primary:hover { background: #222; transform: translateY(-1px); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .55; cursor: progress; transform: none; }
.go-arrow { display: inline-block; transition: transform .3s var(--ease); }
.go:hover .go-arrow { transform: translateX(4px); }
.trust { display: flex; justify-content: center; gap: 18px; margin: 16px 0 0; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.trust span::before { content: "✓"; color: var(--low); margin-right: 6px; font-weight: 700; }

.tabs { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 22px; font-size: .9rem; }
.tab { border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.tab:hover { color: var(--ink); background: #f0f0ec; }
.tab.active { color: var(--ink); background: #ececE8; font-weight: 600; }
.tabs-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 8px; }
.examples { color: var(--muted); }
button.link { background: none; border: 0; padding: 0 2px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; cursor: pointer; transition: text-decoration-color .2s; }
button.link:hover { text-decoration-color: var(--accent); }

.panel[hidden] { display: none; }
.panel:not([hidden]) { animation: rise .45s var(--ease-out); }
.drop { position: relative; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); padding: 34px 24px; text-align: center; transition: border-color .2s, background .2s, transform .2s; }
.drop:hover, .drop.over { border-color: var(--ink); background: #fdfdfc; }
.drop.over { transform: scale(1.01); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-title { font-weight: 600; margin: 0 0 6px; font-size: 1.05rem; }
.drop-title span { color: var(--muted); font-weight: 400; }
details { margin-top: 14px; color: var(--muted); font-size: .92rem; text-align: left; }
summary { cursor: pointer; color: var(--ink-2); }
.hint { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }

.loading { margin: 26px auto 0; max-width: 420px; text-align: center; color: var(--muted); font-size: .92rem; }
.scan { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.scan i { display: block; width: 40%; height: 100%; background: var(--ink); border-radius: 3px; animation: scan 1.1s var(--ease) infinite; }
.loading p { margin: 12px 0 0; animation: fade .4s; }
.error { color: var(--high); font-weight: 600; margin: 16px 0 0; animation: shake .4s; }
.ok { color: var(--low); font-weight: 600; margin: 14px 0 0; }
.saved { margin: 18px auto 0; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; width: fit-content; max-width: 100%; }

/* ---------- result ---------- */
.result { padding: 8px 0 24px; scroll-margin-top: 80px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); animation: rise .7s var(--ease-out); }
.score { display: flex; gap: clamp(20px, 4vw, 40px); align-items: center; flex-wrap: wrap; }
.dial { --c: var(--low); --p: 0; width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #efefeb 0); transition: --p 1.2s var(--ease-out); }
.dial > div { width: 136px; height: 136px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.dial b { font-size: 3.2rem; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dial small { color: var(--muted); }
.band-LOW { --c: var(--low); --soft: var(--low-soft); }
.band-MEDIUM { --c: var(--mid); --soft: var(--mid-soft); }
.band-HIGH { --c: var(--high); --soft: var(--high-soft); }
.verdict { flex: 1; min-width: 240px; }
.verdict h2 { margin: 10px 0 6px; font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.03em; line-height: 1.1; word-break: break-word; }
.verdict p { margin: 0 0 4px; color: var(--muted); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; color: var(--c); background: var(--soft); }
.note { background: #fafaf7; border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--radius-sm); margin: 18px 0 0; font-size: .93rem; color: var(--ink-2); }

.signals { margin-top: 30px; display: grid; gap: 4px; }
.signal { display: grid; grid-template-columns: minmax(130px, 200px) 1fr 52px; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.signal .name { font-weight: 600; }
.signal .meter { height: 8px; background: #efefeb; border-radius: 99px; overflow: hidden; }
.signal .meter i { display: block; height: 100%; border-radius: 99px; width: 0; transition: width 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + .25s); }
.signal .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.signal .detail { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }
.signal.na .name, .signal.na .val { color: #b0b0b4; }
.scope { margin-top: 16px; }

.add-subs { margin-top: 18px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 16px 18px; background: #fdfdfc; }
.add-subs p { margin: 0 0 12px; color: var(--ink-2); }
.file-btn { position: relative; display: inline-flex; align-items: center; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.block { margin-top: 34px; }
.block h3, .locked h3 { margin: 0 0 12px; font-size: 1.2rem; letter-spacing: -.02em; }
.block ol, .block ul { margin: 0; padding-left: 20px; }
.block li { margin-bottom: 6px; }
.pair { color: var(--muted); }

.locked { margin-top: 34px; border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); background: linear-gradient(180deg, #fff7f5, #fff 70%); border: 1px solid #f6dcd8; }
.locked p { margin: 0 0 12px; }
.locked ul { margin: 0 0 18px; padding-left: 20px; }
.locked li { margin-bottom: 4px; }
.unlock { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.buy { display: inline-flex; justify-content: center; align-items: center; text-align: center; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700;
  padding: 14px 20px; border-radius: 999px; transition: transform .25s var(--ease), box-shadow .25s; }
.buy:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgb(255 59 47 / .25); }
.buy.disabled { background: #efefeb; color: var(--muted); box-shadow: none; transform: none; }
.buy.small { padding: 10px 16px; font-size: .92rem; }
#key-input, .pre-form input, .pre-form textarea, .share-controls select, .share-controls textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; width: 100%; resize: vertical; transition: border-color .2s, box-shadow .2s; }
#key-input { flex: 1; min-width: 200px; width: auto; }
#key-input:focus, .pre-form input:focus, .pre-form textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(11 11 12 / .06); }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.chip.high { background: var(--high-soft); color: #a3211a; }
.chip.mid { background: var(--mid-soft); color: #8a5800; }
.chip.low { background: var(--low-soft); color: #0d6b37; }
.plan-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.fix { border-left: 2px solid var(--ink); padding: 2px 0 2px 16px; margin-bottom: 18px; }
.fix h4 { margin: 0 0 4px; }
.fix p { margin: 0 0 6px; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.videos { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.videos th { text-align: left; color: var(--muted); font-weight: 600; background: #fafaf7; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.videos td { border-bottom: 1px solid var(--line); padding: 10px 12px; vertical-align: top; }
.videos tr:last-child td { border-bottom: 0; }
.videos td:last-child { color: var(--muted); }

.progress-grid { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 22px; align-items: start; }
.spark { width: 100%; height: auto; background: #fafaf7; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.spark-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.4s .3s var(--ease-out) forwards; }
.spark-band { stroke: var(--line); stroke-dasharray: 3 4; }
.spark text { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.spark .spark-val { font-size: 12px; font-weight: 700; fill: var(--ink); }
.progress-head { margin: 0 0 6px; font-size: 1.05rem; }
.better { color: var(--low); } .worse { color: var(--high); }
.changes { list-style: none; padding: 0; margin: 8px 0 0; }
.changes li { margin-bottom: 4px; }
.changes span { display: inline-block; width: 18px; font-weight: 700; }

.precheck, .share { border-top: 1px solid var(--line); padding-top: 30px; }
.pre-form { display: grid; gap: 6px; margin-top: 12px; }
.pre-form label, .pre-form .lbl { margin: 10px 0 0; font-size: .88rem; font-weight: 600; }
.pre-form .lbl > label:first-child { display: inline; margin: 0; }
.pre-form .row { margin-top: 10px; align-items: center; }
.pre-form .row input { flex: 1; min-width: 200px; width: auto; }
.pre-form button.primary { justify-self: start; margin-top: 12px; }
.muted { color: var(--muted); font-weight: 400; }
.inline-file { position: relative; display: inline; margin: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 400; }
.inline-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pre-result { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcfcfa; animation: rise .5s var(--ease-out); }
.pre-result ul { list-style: none; padding: 0; margin: 10px 0; }
.pre-result li { margin-bottom: 6px; }
.pre-result h4 { margin: 16px 0 0; }

.share-grid { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 22px; align-items: start; }
#share-preview { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #f3f3f0; }
.share-controls { display: grid; gap: 8px; }
.share-controls label { margin: 6px 0 0; font-size: .88rem; font-weight: 600; }
.share-controls label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.share-controls button, .actions button { background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 600; cursor: pointer; justify-self: start; transition: transform .2s var(--ease), background .2s; }
.share-controls button:hover, .actions button:hover { transform: translateY(-1px); background: #222; }
.share-controls button.ghost, .actions button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- sections ---------- */
.steps { padding: 70px 0 10px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step-n { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; font-size: .85rem; letter-spacing: .06em; }
.step h3 { margin: 10px 0 6px; font-size: 1.2rem; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); }
.how { padding: 70px 0 40px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.035em; margin: 0 0 28px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tile, .grid > div, .guide-list a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.tile:hover, .guide-list a:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.grid h3 { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -.01em; }
.grid p { margin: 0; color: var(--muted); font-size: .94rem; }

.footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 34px 0 calc(34px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; gap: 8px 22px; flex-wrap: wrap; margin: 0 0 10px; }
.footer-links a, .footer a { text-decoration: none; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- guides & 404 ---------- */
.guide-nav { padding-top: 28px; font-weight: 600; max-width: 760px; }
.guide-nav a { color: var(--accent); text-decoration: none; }
.article { max-width: 760px; padding-bottom: 72px; }
.article h1 { margin-top: 14px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; line-height: 1.05; }
.article h2 { margin: 40px 0 12px; font-size: 1.4rem; letter-spacing: -.02em; }
.article p, .article li { font-size: 1.05rem; }
.article li { margin-bottom: 8px; }
.cta-box { margin: 44px 0; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cta-box h2 { margin-top: 0; }
.guide-list a { display: block; text-decoration: none; color: inherit; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 7px rgb(255 59 47 / .08); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal, .headline .w > span { opacity: 1; transform: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .wrap { width: min(100% - 28px, 1080px); }
  .hero { padding-top: 40px; }
  .field { flex-direction: column; align-items: stretch; border-radius: 22px; padding: 6px; gap: 6px; }
  .field-icon { top: 21px; left: 18px; }
  .field input { padding: 14px 12px 14px 42px; font-size: 1rem; }
  .primary.go { justify-content: center; padding: 15px; border-radius: 16px; }
  .tabs-sep { display: none; }
  .examples { width: 100%; text-align: center; margin-top: 6px; }
  .dial { width: 140px; height: 140px; }
  .dial > div { width: 112px; height: 112px; }
  .dial b { font-size: 2.6rem; }
  .score { justify-content: center; text-align: center; }
  .signal { grid-template-columns: 1fr 48px; }
  .signal .meter { grid-column: 1 / -1; grid-row: 2; }
  .steps-grid { grid-template-columns: 1fr; gap: 22px; }
  .progress-grid, .share-grid { grid-template-columns: 1fr; }
  .actions button, .share-buttons button { flex: 1; }
  .card { border-radius: 22px; }
}

.card.still { animation: none; }
.article .lead { margin: 0; max-width: none; }
