/* Tanki public site — v3 design language (matches the app's theme.jsx).
   Flat, no glows, Geist type, hairlines that feather out at their ends.
   Pages are generated by site/build.mjs. */

:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --surface-hi: #1c1c1f;
  --inset: rgba(255,255,255,.04);
  --line: rgba(255,255,255,.07);
  --line-hi: rgba(255,255,255,.12);
  --text: #fafafa;
  --text2: #a1a1aa;
  --text3: #71717a;
  --text4: #52525b;
  --green: #34d399;
  --e10: #22c55e;
  --b7: #0ea5e9;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  --gutter: 20px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.tnum { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
::selection { background: rgba(255,255,255,.18); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: 1120px; }

/* Feathered hairline: fades out at both ends instead of stopping dead. */
.fline, .foot-grid::before, .foot-base::before, .top::after {
  content: ""; display: block; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 18%, var(--line-hi) 82%, transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--text); color: var(--bg); font: 600 15px/1 var(--sans); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; border: 0; cursor: pointer;
  transition: transform .2s var(--ease), background .2s;
}
.btn:hover { background: #e4e4e7; }
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi); }
.btn-ghost:hover { background: var(--inset); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stores { display: flex; gap: 10px; align-items: center; }
.stores img { height: 40px; width: auto; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 50; transition: background .3s, backdrop-filter .3s; }
.top::after { opacity: 0; transition: opacity .3s; }
.top.scrolled { background: rgba(10,10,11,.72); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
.top.scrolled::after { opacity: 1; }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; padding: 6px 0; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a { color: var(--text2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); background: var(--inset); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; width: 40px; height: 40px; display: grid; place-content: center; gap: 6px; cursor: pointer; border-radius: 999px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease); }
.menu[open] summary span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu[open] summary span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.menu nav { position: fixed; left: 12px; right: 12px; top: 68px; display: grid; padding: 8px; border-radius: 20px; background: rgba(20,20,22,.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 16px 40px rgba(0,0,0,.5), inset 0 0 0 1px var(--line); animation: drop .25s var(--ease); }
.menu nav a { padding: 14px 16px; border-radius: 12px; text-decoration: none; font-size: 17px; font-weight: 500; color: var(--text2); }
.menu nav a[aria-current], .menu nav a:hover { color: var(--text); background: var(--inset); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 760px) {
  .nav { display: none; }
  .menu { display: block; }
  .top-in { gap: 10px; }
  .top-in .btn-sm { margin-left: auto; }
}

/* ---------- Hero ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--text3)); }
.hero { position: relative; padding-top: clamp(40px, 9vw, 96px); padding-bottom: clamp(8px, 2vw, 24px); }
.hero::before {
  /* faint engineering grid, fading out — texture, not a glow */
  content: ""; position: absolute; inset: -64px 0 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero h1 { margin: 18px 0 18px; font-size: clamp(40px, 7.4vw, 76px); line-height: 1.0; letter-spacing: -0.045em; font-weight: 600; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--c, var(--green)); }
.lede { font-size: clamp(17px, 2.1vw, 20px); line-height: 1.55; color: var(--text2); max-width: 54ch; }
.hero .row { margin-top: 30px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Live prices (server-rendered) ---------- */
.live { background: var(--surface); border-radius: 24px; box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.35); padding: 22px; }
.live-top { display: flex; align-items: center; gap: 10px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text2); }
.live-time { margin-left: auto; color: var(--text3); letter-spacing: .02em; text-transform: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .3; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 20px; }
.stat { background: var(--inset); border-radius: 16px; padding: 14px 16px; }
.stat-k { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.stat-v { margin-top: 10px; font-size: clamp(32px, 4.4vw, 42px); font-weight: 500; line-height: 1; }
.stat-v small { font-size: .5em; color: var(--text3); margin-left: 2px; }
.stat-s { margin-top: 8px; font: 12px/1 var(--mono); color: var(--text3); }
.grade { display: inline-grid; place-items: center; min-width: 30px; height: 20px; padding: 0 6px; border-radius: 6px; font: 700 10.5px/1 var(--mono); letter-spacing: .02em; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.live-sub { font-size: 13px; font-weight: 500; color: var(--text3); margin-bottom: 4px; }
.cheap-list { list-style: none; margin: 0; padding: 0; }
.cheap-list li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; }
.cheap-list li + li::before { content: ""; position: absolute; top: 0; left: 38px; right: 0; height: 1px; background: linear-gradient(90deg, var(--line), var(--line) 70%, transparent); }
.rank { font-size: 13px; color: var(--text4); }
.who { min-width: 0; display: grid; }
.who b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 13px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt { display: grid; justify-items: end; }
.amt b { font-size: 17px; font-weight: 600; }
.amt span { font-size: 11.5px; color: var(--text3); }
.live-note { margin-top: 14px; font-size: 12.5px; color: var(--text3); }
@media (max-width: 420px) { .live { padding: 16px; border-radius: 20px; } .stats { gap: 8px; } .stat { padding: 12px 13px; } }
@media (max-width: 330px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.sec { padding-top: clamp(56px, 9vw, 104px); }
.sec-title { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; letter-spacing: -0.04em; max-width: 20ch; }
.sec-lede { margin-top: 14px; color: var(--text2); font-size: 17px; max-width: 58ch; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.tile { grid-column: span 2; background: var(--surface); border-radius: 22px; padding: 24px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.tile.w3 { grid-column: span 3; }
.tile.w4 { grid-column: span 4; }
.tile .k { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.tile h3 { font-size: 21px; line-height: 1.2; letter-spacing: -0.025em; }
.tile p { color: var(--text2); font-size: 15px; }
.tile .big { margin-top: auto; font: 500 clamp(40px, 5vw, 56px)/1 var(--mono); letter-spacing: -0.04em; }
.tile .big small { font-size: .42em; color: var(--text3); letter-spacing: 0; margin-left: 4px; }
@media (max-width: 900px) { .tile, .tile.w3, .tile.w4 { grid-column: span 3; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .tile, .tile.w3, .tile.w4 { grid-column: auto; min-height: 0; } }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; padding: 22px; border-radius: 20px; background: var(--inset); }
.steps li::before { content: "0" counter(s); display: block; font: 500 13px/1 var(--mono); color: var(--text3); margin-bottom: 18px; }
.steps b { display: block; font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.02em; }
.steps span { color: var(--text2); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin-top: 28px; }
.tip { position: relative; padding: 22px 0; }
.tip::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--line-hi), var(--line) 60%, transparent); }
.tip b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.tip p { color: var(--text2); font-size: 15px; }
@media (max-width: 700px) { .tips { grid-template-columns: 1fr; } }

.grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 28px; }
.grades div { padding: 20px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.grades b { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 8px; }
.grades p { color: var(--text2); font-size: 14.5px; }

/* ---------- Article cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 28px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: background .25s, transform .25s var(--ease), box-shadow .25s; min-height: 210px; }
.card:hover { background: var(--surface-hi); transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-hi); }
.card-k { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.card-t { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.card-d { font-size: 14.5px; color: var(--text2); }
.card-go { margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--text3); transition: color .2s, transform .25s var(--ease); }
.card:hover .card-go { color: var(--text); transform: translateX(3px); }

/* ---------- Articles & legal ---------- */
.art-head, .legal-head { padding: clamp(40px, 7vw, 72px) 0 12px; }
.crumb { display: block; width: fit-content; margin-bottom: 28px; font-size: 14px; color: var(--text3); text-decoration: none; }
.crumb:hover { color: var(--text); }
.art-head h1, .legal-head h1 { margin: 16px 0 16px; font-size: clamp(34px, 5.6vw, 54px); line-height: 1.04; letter-spacing: -0.045em; }
.dek { font-size: clamp(18px, 2.2vw, 21px); color: var(--text2); line-height: 1.5; }
.byline { margin-top: 20px; font: 12.5px/1 var(--mono); color: var(--text3); }

.prose { padding: 20px 0 8px; font-size: 17px; line-height: 1.75; color: var(--text2); }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 52px; color: var(--text); font-size: 25px; line-height: 1.2; letter-spacing: -0.03em; }
.prose h3 { margin-top: 32px; color: var(--text); font-size: 19px; line-height: 1.3; letter-spacing: -0.02em; }
.prose h2 + *, .prose h3 + * { margin-top: 10px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text4); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--text); }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 24px; }
.prose li + li { margin-top: 8px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .78em; width: 8px; height: 1.5px; background: var(--text3); border-radius: 2px; }
.prose ol { counter-reset: n; }
.prose ol > li { counter-increment: n; }
.prose ol > li::before { content: counter(n); position: absolute; left: 0; top: 0; font: 500 13px/1.75rem var(--mono); color: var(--text3); }
.keypoints, .callout { padding: 22px 24px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.prose .keypoints h2 { margin: 0 0 10px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.keypoints li { color: var(--text); }
.callout { background: var(--inset); box-shadow: none; }
.callout p { color: var(--text); }
.callout > * + * { margin-top: 10px; }
.table { overflow-x: auto; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter); -webkit-overflow-scrolling: touch; }
.table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.table th { text-align: left; font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text3); padding: 0 16px 10px 0; white-space: nowrap; }
.table td { padding: 13px 16px 13px 0; vertical-align: top; color: var(--text2); background: linear-gradient(90deg, var(--line), var(--line)) bottom / 100% 1px no-repeat; }
.table tr:last-child td { background: none; }
.table td:first-child { color: var(--text); font-weight: 500; }
.table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }

.art-cta { display: flex; align-items: center; gap: 20px; justify-content: space-between; margin-top: 48px; padding: 22px 24px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.art-cta b { display: block; font-size: 17px; letter-spacing: -0.02em; }
.art-cta span { font-size: 14.5px; color: var(--text2); }
@media (max-width: 560px) { .art-cta { flex-direction: column; align-items: stretch; } }

.faq { margin-top: 56px; max-width: 760px; }
.faq h2 { font-size: 25px; letter-spacing: -0.03em; margin-bottom: 8px; }
.faq details { position: relative; }
.faq details::before { content: ""; display: block; height: 1px; background: linear-gradient(90deg, var(--line-hi), var(--line) 65%, transparent); }
.faq summary { list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 300 22px/1 var(--sans); color: var(--text3); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 20px; color: var(--text2); font-size: 16px; max-width: 62ch; }

.related { padding-top: 72px; }

.k-legal .prose { font-size: 16px; line-height: 1.7; }
.k-legal .prose h2 { margin-top: 40px; font-size: 20px; }

/* ---------- Footer ---------- */
.foot { margin-top: clamp(80px, 12vw, 140px); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.foot-cta { padding: clamp(32px, 6vw, 56px); border-radius: 28px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.foot-cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: linear-gradient(115deg, transparent 45%, #000); mask-image: linear-gradient(115deg, transparent 45%, #000); opacity: .5; }
.foot-cta > * { position: relative; }
.foot-cta h2 { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.05; letter-spacing: -0.045em; max-width: 17ch; }
.foot-cta p { margin-top: 12px; color: var(--text2); font-size: 17px; }
.foot-cta .row { margin-top: 26px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; margin-top: 56px; }
.foot-grid::before { grid-column: 1 / -1; margin-bottom: 8px; }
.foot-grid h3 { font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text3); margin-bottom: 14px; }
.foot-grid a { display: block; width: fit-content; color: var(--text2); text-decoration: none; font-size: 14.5px; padding: 4px 0; transition: color .2s; }
.foot-grid a:hover { color: var(--text); }
.foot-brand svg { color: var(--text); }
.foot-brand p { margin-top: 14px; font-size: 14px; color: var(--text3); max-width: 30ch; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; font: 12px/1.5 var(--mono); color: var(--text4); }
.foot-base::before { flex-basis: 100%; margin-bottom: 18px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* ---------- Motion ---------- */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }
.js .cards .rv:nth-child(3n+2), .js .bento .rv:nth-child(3n+2), .js .steps .rv:nth-child(2) { transition-delay: .07s; }
.js .cards .rv:nth-child(3n), .js .bento .rv:nth-child(3n), .js .steps .rv:nth-child(3) { transition-delay: .14s; }
.hero .rv:nth-child(2) { transition-delay: .06s; }
.hero .rv:nth-child(3) { transition-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}

/* Inline links inside tiles, tips and grade cards */
.tile a, .tip a, .grades a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text4); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tile a:hover, .tip a:hover, .grades a:hover { text-decoration-color: var(--text); }
.mt { margin-top: 24px; }
