/* Limitguard homepage-only styles (apps/landing/home.css).
   Loaded after styles.css; only additive rules that cannot affect other
   pages. Tokens (--emerald, --bg-primary, fonts, etc.) come from
   styles.css :root. */

/* ---- Nav: logo + links + sign-in/CTA row ------------------------------- */
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links ul { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-signin { color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; }
.nav-signin:hover { color: var(--text-primary); }
.nav-cta-btn { padding: 0.5rem 1.125rem; font-size: 0.875rem; }

/* ---- Hero: two-column grid --------------------------------------------- */
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; text-align: left; }
.hero-copy h1 { max-width: 640px; margin: 0 0 1.25rem; }
.hero-sub { max-width: 560px; margin: 0 0 1.5rem; font-size: 1.0625rem; color: var(--text-secondary); line-height: 1.7; }
.hero-microproof { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 2rem; padding: 0; font-size: 0.875rem; color: var(--text-secondary); }
.hero-microproof li { position: relative; padding-left: 1.1rem; }
.hero-microproof li::before { content: ''; position: absolute; left: 0; top: 0.4em; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
.hero .hero-actions { justify-content: flex-start; margin-bottom: 0; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--emerald); border: 1px solid transparent; padding: 0.75rem 1rem; }
.btn-ghost:hover { color: var(--emerald-dark); text-decoration: underline; }
.hero-v2-link { margin: 1.25rem 0 0; font-size: 0.9375rem; }
.hero-v2-link a { color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
.hero-v2-link a:hover { color: var(--emerald); border-bottom-color: var(--emerald); }

.hero-terminal-wrap { min-width: 0; }
/* #hero-terminal-body: the free_sandbox string is one very long unbroken
   JSON value. A bare <pre> (white-space:pre) never wraps it, and on a real
   mobile browser that alone widens the whole layout viewport past 390px
   (not only a scrollbar) even with overflow-x:auto containing the visual
   overflow. Wrapping this one block is the fix, not a container tweak. */
#hero-terminal-body { white-space: pre-wrap; word-break: break-word; overflow-x: visible; }
.terminal-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.terminal-caption { font-size: 0.75rem; color: var(--text-muted); }
.btn-run-live { background: var(--emerald); color: var(--bg-primary); border: none; border-radius: 6px; padding: 0.4rem 0.875rem; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-run-live:hover { background: var(--emerald-dark); }
.btn-run-live:disabled { opacity: 0.6; cursor: default; }
.terminal-live-note { padding: 0 1.25rem 1rem; font-size: 0.75rem; color: var(--text-muted); }
.terminal-live-note.is-error { color: var(--red); }
.terminal-live-note.is-live { color: var(--emerald); }

/* ---- Watch it work ------------------------------------------------------ */
.demo-section { text-align: center; }
.demo-section h2 { max-width: 720px; margin-left: auto; margin-right: auto; }
.video-frame { max-width: 860px; margin: 2.5rem auto 1.25rem; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: linear-gradient(160deg, var(--bg-code), var(--bg-secondary)); aspect-ratio: 16 / 9; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-code); }
.video-caption { max-width: 640px; margin: 0 auto; color: var(--text-muted); font-size: 0.8125rem; text-align: left; }
.video-caption code { color: var(--emerald); }

/* ---- Live wallet screen -------------------------------------------------- */
.wallet-section .section-sub { margin-bottom: 0.5rem; }
.wallet-widget { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; margin-top: 2rem; align-items: start; }
.wallet-form { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.wallet-form label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.5rem; }
.wallet-form input, .wallet-form select { padding: 0.625rem 0.75rem; background: var(--bg-code); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); font-family: var(--font-mono); font-size: 0.8125rem; }
.wallet-form input:focus, .wallet-form select:focus, .wallet-form button:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }
.wallet-form button { margin-top: 1rem; width: 100%; justify-content: center; }
.wallet-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.wallet-results { min-height: 180px; padding: 1.5rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; }
.wallet-placeholder { color: var(--text-muted); font-size: 0.9375rem; }
.wallet-error { color: var(--red); font-size: 0.9375rem; }
.wallet-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.wallet-result-block h3 { font-size: 0.9375rem; margin-bottom: 0.5rem; }
.wallet-result-block p, .wallet-result-block li { color: var(--text-secondary); font-size: 0.875rem; }
.wallet-result-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.wallet-badge { display: inline-block; padding: 0.2rem 0.625rem; border-radius: 100px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.wallet-badge.proceed { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.wallet-badge.review, .wallet-badge.manual { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.wallet-badge.block { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.wallet-raw-toggle { grid-column: 1 / -1; margin-top: 0.5rem; }
.wallet-raw-toggle summary { cursor: pointer; font-size: 0.8125rem; color: var(--emerald); font-weight: 600; }
/* white-space:pre-wrap, not overflow-x:auto alone: an unbroken JSON value
   here is the same mobile layout-viewport-blowout class of bug fixed above
   on #hero-terminal-body and the two tables. */
.wallet-raw-toggle pre { margin-top: 0.75rem; padding: 1rem; background: var(--bg-code); border: 1px solid var(--border); border-radius: 8px; font-size: 0.75rem; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto; }

/* ---- Coverage table + pricing snapshot ---------------------------------- */
/* No min-width on the table: on a real mobile browser a table (or any
   element) with an intrinsic width past the viewport widens the whole
   layout viewport, not only its own row (the #hero-terminal-body fix
   above is the same class of bug). The table instead compresses its own
   columns and wraps cell text at narrow widths; table-scroll's
   overflow-x:auto remains as a safety net on wide desktop cells only. */
.table-scroll { overflow-x: auto; margin-top: 2rem; }
.coverage-table, .price-table-home { width: 100%; border-collapse: collapse; font-size: 0.875rem; table-layout: fixed; }
.coverage-table th, .price-table-home th { text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid var(--border); color: var(--text-primary); font-weight: 600; }
.coverage-table td, .price-table-home td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); overflow-wrap: break-word; }
.coverage-table th:nth-child(1), .coverage-table td:nth-child(1) { width: 30%; }
.coverage-table th:nth-child(2), .coverage-table td:nth-child(2) { width: 18%; }
.coverage-table th:nth-child(3), .coverage-table td:nth-child(3) { width: 52%; }
.price-table-home { max-width: 640px; margin: 2rem auto 0; font-family: var(--font-mono); }
.price-table-home th:first-child, .price-table-home td:first-child { width: 72%; }
.price-table-home th:last-child, .price-table-home td:last-child { text-align: right; }
.price-table-home code { color: var(--emerald); }
.price-table-wrap { max-width: 640px; margin: 0 auto; }
.price-table-note { text-align: center; margin: 1rem 0 0; color: var(--text-muted); font-size: 0.875rem; }
.value-stack-label { text-align: center; margin: 3rem 0 0.5rem; font-weight: 600; color: var(--text-primary); }
.value-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.value-card { padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: transform 0.2s, border-color 0.2s; }
.value-card:hover { transform: translateY(-2px); border-color: var(--emerald); }
.value-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.value-card p { color: var(--text-secondary); font-size: 0.875rem; }
.value-card code { color: var(--emerald); }

/* ---- Compare section ----------------------------------------------------- */
#compare p { max-width: 760px; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.7; }
#compare code { color: var(--emerald); }

/* ---- Proof section -------------------------------------------------------- */
.proof-section { text-align: center; }
.proof-section .section-sub { max-width: 640px; margin: 0 auto 0.5rem; font-style: italic; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3rem; text-align: left; }
.proof-card { padding: 1.75rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.2s, transform 0.2s; }
.proof-card:hover { border-color: var(--emerald); transform: translateY(-2px); }
.proof-card h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.proof-card p { color: var(--text-secondary); font-size: 0.875rem; }
.proof-card-live { grid-column: span 2; }
.proof-links { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.proof-links a { font-size: 0.8125rem; font-weight: 600; }
.proof-footer { margin-top: 2rem; color: var(--text-muted); font-size: 0.8125rem; }

.self-verify-card { margin-top: 1.25rem; padding: 1.25rem; background: var(--bg-code); border: 1px solid var(--border); border-radius: 10px; }
.self-verify-loading, .self-verify-fallback { color: var(--text-muted); font-size: 0.875rem; }
.self-verify-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }
.self-verify-gauge { flex-shrink: 0; }
.self-verify-gauge circle.track { stroke: var(--border); }
.self-verify-gauge circle.fill { stroke: var(--emerald); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1s ease-out; }
.self-verify-gauge text { fill: var(--text-primary); font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-size: 1.25rem; font-weight: 700; }
.self-verify-level { font-size: 0.8125rem; color: var(--emerald); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.self-verify-signals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 1rem; text-align: left; }
.self-verify-signals li { font-size: 0.8125rem; color: var(--text-secondary); }
.self-verify-signals a { font-weight: 600; }

/* ---- Key facts panel ------------------------------------------------------- */
.facts-panel { max-width: 820px; margin: 2rem auto 0; padding: 2rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; text-align: left; }
.facts-panel .hero-definition { max-width: none; margin: 0 0 1rem; text-align: left; }
.facts-panel .hero-facts { max-width: none; margin: 0; }

/* ---- FAQ -------------------------------------------------------------------- */
.faq-list { max-width: 780px; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: 1.5rem; }
.faq-item { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.faq-a p { color: var(--text-secondary); font-size: 0.9375rem; margin: 0; }
.faq-a code { color: var(--emerald); }

/* ---- Copy buttons on code blocks -------------------------------------------- */
.hero-code { position: relative; }
.copy-btn { position: absolute; top: 0.6rem; right: 0.85rem; padding: 0.25rem 0.625rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; color: var(--text-secondary); font-size: 0.6875rem; cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.hero-code:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn.copied { color: var(--emerald); border-color: var(--emerald); opacity: 1; }

/* ---- Scroll reveals (progressive enhancement) ------------------------------- */
.js-reveal-ready .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.js-reveal-ready .reveal.in-view { opacity: 1; transform: none; }

/* ---- Accessibility: focus-visible everywhere on this page ------------------- */
.hero a:focus-visible, .btn:focus-visible, .nav-links a:focus-visible, .footer-list a:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

/* ---- Responsive ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy h1, .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-microproof { justify-content: center; }
  .hero .hero-actions { justify-content: center; }
  .value-stack { grid-template-columns: repeat(2, 1fr); }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-card-live { grid-column: span 2; }
  .wallet-widget { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 1.5rem; gap: 1rem; display: none; }
  .nav-links.open { display: flex; }
  .nav-links ul { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .nav-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .value-stack { grid-template-columns: 1fr; }
  .proof-grid { grid-template-columns: 1fr; }
  .proof-card-live { grid-column: auto; }
  .self-verify-signals { grid-template-columns: 1fr; }
  .wallet-result-grid { grid-template-columns: 1fr; }
  .terminal-footer { flex-direction: column; align-items: flex-start; }
}

/* Three text columns do not fit a phone: the 18% column broke "Netherlands" mid-word.
   Below 640px each row becomes a small card with its own labels. */
@media (max-width: 640px) {
  .coverage-table thead { display: none; }
  .coverage-table, .coverage-table tbody, .coverage-table tr, .coverage-table td { display: block; width: 100%; }
  .coverage-table tr { padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
  .coverage-table td,
  .coverage-table td:nth-child(1),
  .coverage-table td:nth-child(2),
  .coverage-table td:nth-child(3) { width: auto; padding: 0.125rem 0; border-bottom: 0; }
  .coverage-table td:nth-child(1) { color: var(--text-primary); font-weight: 600; padding-bottom: 0.25rem; }
  .coverage-table td:nth-child(2)::before { content: "Coverage: "; color: var(--text-muted); }
  .coverage-table td:nth-child(3)::before { content: "Runs when: "; color: var(--text-muted); }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  .self-verify-gauge circle.fill { transition: none; }
  .value-card, .proof-card { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* The nav-link colour rule outranks .btn-primary inside the header. */
.nav-cta-btn, .nav-cta-btn:hover { color: var(--bg-primary) !important; }

/* Live API values include long unbroken strings (CAIP-10 ids, addresses, URLs):
   let them wrap, and let grid children shrink, so no card widens the page. */
.proof-card, .wallet-results, .wallet-result-grid > *, .self-verify-card { min-width: 0; }
.self-verify-signals li, .wallet-result-block, .wallet-results p { overflow-wrap: anywhere; }
.wallet-raw-toggle pre { max-width: 100%; overflow-x: auto; }

/* Sales home: the hero panel lists what one check answers, and the free-check box. */
.lead-checklist { list-style: none; margin: 0; padding: 1.25rem 1.5rem; display: grid; gap: 0.75rem; }
.lead-checklist li { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.5; padding-left: 1.5rem; position: relative; overflow-wrap: anywhere; }
.lead-checklist li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--emerald); }
.lead-checklist strong { color: var(--text-primary); }
.free-check-box { max-width: 680px; margin: 1.5rem auto 0; padding: 1.25rem 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow-wrap: anywhere; }
.free-check-box p { margin: 0 0 0.5rem; }
.free-check-hint { color: var(--text-muted); font-size: 0.875rem; }
