/* ════════════════════════════════════════════════
   NationCraft website — follows design.md ("Brief")
   An extension of the app's design language.
   ════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0E0F13;
  --card:      #16181E;
  --card-2:    #1B1E25;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.04);
  --line-solid:#252934;
  --ink:       #ECEEF2;
  --ink-2:     #B2B7C2;
  --ink-3:     #787E8B;
  --ink-4:     #565C68;
  --accent:    #7C83F8;
  --accent-dim:rgba(124,131,248,0.14);
  --accent-line:rgba(124,131,248,0.25);
  --good:      #41B98A;
  --caution:   #D7A23F;
  --danger:    #E55C72;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --maxw: 960px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 46px;   /* clearance for the fixed intel bar */
}

/* A single quiet glow up top; otherwise flat near-black. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(110% 60% at 50% -8%, rgba(124,131,248,0.07), transparent 55%);
}

a { color: var(--accent); text-decoration: none; transition: color 0.18s; }
a:hover { color: #9aa0ff; }
img, svg { display: block; max-width: 100%; }

.good   { color: var(--good); }
.caution{ color: var(--caution); }
.danger { color: var(--danger); }

/* mono numerics everywhere they appear */
.vital-val, .hero-meta { font-variant-numeric: tabular-nums; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14,15,19,0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.topbar-nav {
  display: flex; align-items: center; gap: 18px;
}
.topbar-link {
  font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none;
  transition: color 0.18s ease;
}
.topbar-link:hover { color: var(--ink); }
.topbar-link.is-active { color: var(--accent); }
.topbar-mark {
  width: 8px; height: 26px; border-radius: 3px; flex: 0 0 auto;
  background: linear-gradient(var(--accent), var(--caution));
}
.topbar-id { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.topbar-sub  { font-size: 11px; color: var(--ink-3); }

/* ── Page shell ── */
.page {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px 22px 56px;
  display: flex; flex-direction: column; gap: 28px;
}

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 28px; align-items: center;
  padding: 20px 0 8px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  font-weight: 700; line-height: 1.12; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.02rem; color: var(--ink-2); max-width: 440px;
  margin-bottom: 24px;
}
/* Store badges sizing rule:
   - When side to side: vertically of the same size (--badge-h, auto width).
   - When top and bottom: horizontally of the same size (--badge-w, auto height). */
.cta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  --badge-h: 48px;
  --badge-w: 180px;
}
.badge-link {
  display: inline-block; border-radius: 8px;
  transition: transform 0.18s ease; line-height: 0;
}
.badge-link:hover { transform: translateY(-2px); }
/* Side by side: vertically matched height */
.badge-link img { display: block; height: var(--badge-h); width: auto; }

/* Top and bottom layout: horizontally matched width */
.badges-stacked,
.badges {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  --badge-w: 180px;
}
.badges-stacked .badge-link,
.badges .badge-link {
  display: block; width: var(--badge-w); max-width: 100%;
}
.badges-stacked .badge-link img,
.badges .badge-link img {
  display: block; width: 100%; height: auto;
}
.hero-meta {
  display: flex; align-items: center; gap: 9px; margin-top: 18px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.hero-meta i { color: var(--ink-4); font-style: normal; }

/* ── Radar card ── */
.hero-radar { display: flex; flex-direction: column; align-items: center; }
.radar { width: 100%; max-width: 300px; height: auto; margin: 8px auto 2px; overflow: visible; }
.radar-grid polygon { fill: none; stroke: var(--line); stroke-width: 1; opacity: 0.55; }
.radar-grid polygon.ring-out { opacity: 1; }
.radar-grid line { stroke: var(--line-2); stroke-width: 1; }
.radar-area {
  fill: rgba(124,131,248,0.18); stroke: var(--accent);
  stroke-width: 2; stroke-linejoin: round;
}
.radar-pts circle { stroke: var(--bg); stroke-width: 1.2; }
.radar-pts circle.good    { fill: var(--good); }
.radar-pts circle.caution { fill: var(--caution); }
.radar-pts circle.danger  { fill: var(--danger); }
.rk { font-family: var(--sans); font-size: 9px; fill: var(--ink-2); }
.rv { font-family: var(--mono); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rv.good    { fill: var(--good); }
.rv.caution { fill: var(--caution); }
.rv.danger  { fill: var(--danger); }

/* ── Card primitive ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.card-title {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.01em; margin-bottom: 14px;
}
.section { padding: 20px; }

.section-head { margin-bottom: 4px; }
.section-head h2 {
  font-size: 1.05rem; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.01em;
}

/* ── Vitals strip ── */
.vitals {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.vital {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.vital-label { font-size: 10.5px; color: var(--ink-3); }
.vital-val {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 600;
  color: var(--ink); line-height: 1; letter-spacing: -0.01em;
}
.dot {
  position: absolute; top: 14px; right: 14px;
  width: 8px; height: 8px; border-radius: 50%;
}
.dot.danger { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.dot.good   { background: var(--good);   box-shadow: 0 0 8px var(--good); }

/* ── Prose ── */
.prose p { color: var(--ink-2); font-size: 1rem; line-height: 1.7; }
.prose p + p { margin-top: 12px; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ── Pillars ── */
.pillars {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 12px;
}
.pillar { transition: border-color 0.18s ease, background 0.18s ease; }
.pillar:hover { border-color: var(--accent-line); background: var(--card-2); }
.pillar h3 {
  font-size: 1rem; font-weight: 600; color: var(--ink);
  margin-bottom: 6px;
}
.pillar p { font-size: 0.92rem; color: var(--ink-3); line-height: 1.55; }

/* ── FAQ ── */
.faq-row { padding: 14px 0; border-top: 1px solid var(--line); }
.faq-row:first-child { padding-top: 0; border-top: 0; }
.faq dt { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.faq dd { font-size: 0.95rem; color: var(--ink-3); line-height: 1.6; }
.faq dd p + p { margin-top: 10px; }
.faq dd strong { color: var(--ink-2); font-weight: 600; }

/* ── Final CTA ── */
.command {
  text-align: center; padding: 40px 24px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(124,131,248,0.08), transparent 60%),
    var(--card);
}
.command h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem); font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em; margin-bottom: 10px;
}
.command p { color: var(--ink-2); margin: 0 auto 22px; max-width: 420px; }
.command .cta { justify-content: center; }

/* ── Support ── */
/* Presented the way a payment gateway presents itself: choose a method, then
   see that one method in full. Bitcoin, Ethereum and UPI only -- the app's own
   X and Website rows point back at things already on this page. See
   scripts/build_pages.py's render_support_section for the source of truth
   (web/support.json) that fills this in at build time. */
.support-lead { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 18px; }

/* The chooser. A grid rather than a flex row so the three methods are exactly
   equal width at every size: a gateway whose options are different widths
   reads as one of them being the recommendation. */
.support-methods {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.support-method {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink-2); font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.support-method:hover { border-color: var(--accent-line); color: var(--ink); }
.support-method.is-on {
  border-color: var(--accent); color: var(--ink); background: var(--accent-dim);
}
.support-mark { width: 26px; height: 26px; flex: 0 0 auto; }

/* The panel. Its height changes with the method, which is allowed: this is the
   consequence of the visitor's own tap, and there is nothing below it on the
   page but the footer. */
.support-panel {
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card-2);
}
.support-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
/* Addresses stay fully visible and wrap rather than truncate: a shortened
   address is not one anyone can safely paste back. */
.support-address {
  display: block;
  font-family: var(--mono); font-size: 0.85rem; color: var(--ink);
  line-height: 1.6;
  /* Both, deliberately. `overflow-wrap: anywhere` is the modern spelling and
     is what lets the string contribute a small min-content width, but a
     42-character address still refused to break on a 390px phone with it
     alone, so `word-break` does the actual breaking. An address must wrap
     rather than overflow: it can never be truncated, since a shortened
     address is not one anyone can safely paste. */
  overflow-wrap: anywhere; word-break: break-all;
  user-select: all;
}
/* Address row with integrated copy icon button */
.support-address-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-top: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.support-address-row:hover {
  border-color: var(--accent-line);
  background: rgba(255,255,255,0.02);
}
.support-copy-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: 0 0 auto;
  padding: 6px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--ink-3); cursor: pointer;
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.support-copy-btn:hover {
  border-color: var(--accent-line); color: var(--ink); background: var(--card-2);
}
.support-copy-btn svg { flex-shrink: 0; }
.support-copy-btn .icon-check { display: none; }
.support-copy-btn .copy-toast { display: none; }
.support-copy-btn.is-copied {
  border-color: var(--good); color: var(--good); background: var(--good-dim);
}
.support-copy-btn.is-copied .icon-copy { display: none; }
.support-copy-btn.is-copied .icon-check { display: inline-block; }
.support-copy-btn.is-copied .copy-toast { display: inline-block; }

@media (max-width: 420px) {
  .support-method { font-size: 0.75rem; padding: 10px 4px; }
}

/* ── Action Buttons & Support Page Components ── */
.action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.action-btn-primary {
  background: var(--accent-dim); border: 1px solid var(--accent); color: var(--ink);
}
.action-btn-primary:hover {
  background: var(--accent); color: #0E0F13; transform: translateY(-1px);
}
.action-btn-secondary {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink-2);
}
.action-btn-secondary:hover {
  border-color: var(--accent-line); color: var(--ink); background: var(--card-2); transform: translateY(-1px);
}
.action-btn svg { flex-shrink: 0; }
.action-btn .icon-check { display: none; }
.action-btn .copy-toast { display: none; }
.action-btn.is-copied {
  border-color: var(--good); color: var(--good); background: var(--good-dim);
}
.action-btn.is-copied .icon-copy { display: none; }
.action-btn.is-copied .icon-check { display: inline-block; }
.action-btn.is-copied .btn-text { display: none; }
.action-btn.is-copied .copy-toast { display: inline-block; }

.support-title {
  color: var(--ink); font-size: 1.65rem; margin: 6px 0 12px; font-weight: 700; letter-spacing: -0.02em;
}
.support-badges-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.support-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 9999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
}
.support-pill-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
}

.support-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.contact-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.18s ease;
}
.contact-card:hover { border-color: var(--accent-line); }
.contact-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.contact-card-icon { color: var(--accent); flex-shrink: 0; }
.contact-card-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.contact-card-sub { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.contact-card-desc { font-size: 0.82rem; color: var(--ink-2); line-height: 1.5; margin-bottom: 14px; flex-grow: 1; }
.contact-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.support-pay-row {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.support-hint { font-size: 0.78rem; color: var(--ink-3); }

.support-faq-list {
  display: flex; flex-direction: column; gap: 12px; margin-top: 16px;
}
.support-faq-item {
  padding: 14px 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px;
}
.support-faq-item h3 {
  font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.support-faq-item p {
  font-size: 0.85rem; color: var(--ink-2); line-height: 1.6;
}
.support-faq-item a { color: var(--accent); text-decoration: none; }
.support-faq-item a:hover { text-decoration: underline; }

/* ── Footer ── */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 24px 22px 36px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  font-size: 12px; color: var(--ink-4);
}
.footer-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-3); text-decoration: none;
  transition: color 0.18s ease;
}
.footer-link:hover { color: var(--ink); }
.footer-icon { flex-shrink: 0; }
.footer-sep { color: var(--line-solid); }

/* ── Bottom intel bar (app-style, fixed ticker) ── */
.intelbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(14,15,19,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--line);
}
.intelbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 22px;
}
.intel-tag {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink-4);
}
.intel-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.7); } }
.intel-line {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12px; color: var(--ink-2);
}
.intel-cat { color: var(--ink-4); }
.intel-count { font-family: var(--mono); font-size: 9.5px; color: var(--ink-4); flex-shrink: 0; }
.intel-line.swap { animation: intelFade 0.45s ease; }
@keyframes intelFade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ── Sticky store bar (mobile only) ──
   Hidden on desktop, where the hero CTA stays reachable and the intel bar owns
   the bottom edge. Below 720px it stacks directly above the intel bar. */
.storebar { display: none; }

/* ── Strikethrough gag on "Congratulations." ── */
.struck { position: relative; white-space: nowrap; }
.struck::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 0.55em;
  height: 2px; background: currentColor; border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  animation: strike 0.5s 1.15s cubic-bezier(.6,0,.2,1) forwards;
}
@keyframes strike { to { transform: scaleX(1); } }

/* "Condolences." appears only after the strike completes; its space is
   reserved via opacity so the line never reflows. */
.after-strike { opacity: 0; animation: condShow 0.45s 1.7s ease forwards; }
@keyframes condShow { to { opacity: 1; } }

/* ── Typewriter caret ── */
.caret {
  display: inline-block; width: 6px; height: 0.95em; margin-left: 2px;
  vertical-align: -2px; background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Motion (restrained) ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.fade { animation: fadeUp 0.7s cubic-bezier(.2,.7,.2,1) both; }
.hero-radar.fade { animation-delay: 0.12s; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .struck::after { transform: scaleX(1); }
  .after-strike { opacity: 1; }
  .caret { display: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .hero-radar { order: -1; max-width: 320px; margin: 0 auto; }
  .vitals { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }

  /* 38px intel bar + 76px store bar. Reserved from first paint so revealing
     the store bar never reflows the page. */
  body { padding-bottom: 114px; }
  .storebar {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 38px; z-index: 19;
    background: rgba(14,15,19,0.92);
    backdrop-filter: saturate(140%) blur(10px);
    border-top: 1px solid var(--line);
  }
  .storebar-inner {
    --badge-h: 40px;
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 6px 14px;
  }
  .badge-link:hover { transform: none; }
  /* The store bar's own border is the boundary against page content. The intel
     bar's would read as a divider between two bars that are one unit. */
  .intelbar { border-top: none; }
  /* The sticky bar puts the same two badges in the same fold, so the hero pair
     is redundant on mobile. hero-meta stays: it carries the platform and
     no-ads copy, which the badges do not. */
  .hero .cta { display: none; }
}

@media (max-width: 480px) {
  /* When store badges are stacked top-and-bottom on mobile, they match horizontally */
  .command .cta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    --badge-w: 180px;
  }
  .command .cta .badge-link {
    display: block;
    width: var(--badge-w);
    max-width: 100%;
  }
  .command .cta .badge-link img {
    display: block;
    width: 100%;
    height: auto;
  }
}

@media (max-width: 420px) {
  body { font-size: 14px; }
  .page { padding-top: 26px; }
}

@media (max-width: 360px) {
  .storebar-inner {
    --badge-h: 36px;
    gap: 8px;
    padding: 6px 8px;
  }
}
