:root {
  --bg: #0a0d14;
  --surface: #131824;
  --surface-2: #1b2233;
  --surface-3: #252f45;
  --ink: #e9edf3;
  --muted: #9da8bc;
  --accent: #5a9bfc;
  --accent-hover: #7bb2ff;
  --accent-ink: #0a0d14;
  --link: #73aeff;
  --ok-bg: #13332a;
  --ok-ink: #ccf7e5;
  --warn-bg: #3b1c24;
  --warn-ink: #ffdbe2;
  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --step-small: clamp(0.85rem, 0.83rem + 0.1vw, 0.92rem);
  --step-body: clamp(1.04rem, 1rem + 0.2vw, 1.125rem);
  --step-lead: clamp(1.15rem, 1.1rem + 0.22vw, 1.25rem);
  --step-h2: clamp(1.62rem, 1.26rem + 1.65vw, 2.38rem);
  --step-head: clamp(2.35rem, 1.55rem + 3.6vw, 4.35rem);
  --gap: 8px;
  --pad: 24px;
  --max-w: 1392px;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-body);
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  transition: color 150ms ease-out, background-color 150ms ease-out, opacity 150ms ease-out;
}

a:hover {
  color: #a6cbff;
}

.tile-accent a:not(.btn-dark) {
  color: var(--accent-ink);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile-accent a:focus-visible,
.tile-accent button:focus-visible {
  outline: 2px solid var(--accent-ink);
}

h1, h2, h3, h4 {
  margin: 0 0 0.46em;
  font-family: var(--font-sans);
  font-weight: 500;
  color: inherit;
}

h1 {
  font-size: var(--step-head);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

h2 {
  font-size: var(--step-h2);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h3, h4 {
  font-size: var(--step-lead);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p, ul, ol, dl, table, pre, blockquote {
  margin: 0 0 1rem;
}

p, li {
  max-width: 62ch;
  overflow-wrap: anywhere;
}

p:last-child, ul:last-child, ol:last-child {
  margin-bottom: 0;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--step-small);
}

p code, li code, td code, summary code {
  background: var(--surface-2);
  color: var(--ink);
  padding: 0.12em 0.38em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tile-accent p code,
.tile-accent li code {
  background: rgba(10, 13, 20, 0.16);
  color: var(--accent-ink);
}

pre {
  max-width: 100%;
  background: var(--surface);
  color: var(--ink);
  padding: 1rem 1.15rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.48;
}

pre code {
  background: transparent;
  padding: 0;
}

/* Outer Shell & Top Navigation */
.board-shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad);
}

.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.brand-tile {
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: var(--step-body);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-tile:hover {
  background: var(--surface-3);
  color: #ffffff;
}

.nav-tile {
  background: var(--surface);
  padding: 8px 18px;
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.nav-tile a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
}

.nav-tile a:hover,
.nav-tile a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.cta-tile {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.cta-tile:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.cta-tile:active,
.btn-primary:active,
.btn-ghost:active,
.btn-dark:active {
  transform: scale(0.98);
}

/* Section Rhythm (120-168px on desktop, 80-104px on mobile) */
.board-section {
  margin-top: clamp(88px, 10vw, 156px);
}

.board-section--first {
  margin-top: 0;
}

.section-head {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gap);
  align-items: end;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  text-align: end;
  justify-self: end;
}

/* 12-Column Asymmetric Board */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.tile {
  background: var(--surface);
  color: var(--ink);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.tile--top {
  justify-content: flex-start;
}

.tile-elev {
  background: var(--surface-2);
  color: var(--ink);
}

.tile-deep {
  background: #0e131d;
  color: var(--ink);
}

.tile-accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.tile-ink {
  background: var(--ink);
  color: var(--bg);
}

.tile-ink a {
  color: #0b4da8;
}

.tile-photo {
  padding: 0;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  min-height: 268px;
}

.tile-photo img,
.tile-photo video {
  width: 100%;
  height: 100%;
  min-height: 268px;
  object-fit: cover;
  display: block;
}

.photo-strip {
  background: var(--surface-2);
  color: var(--ink);
  padding: 8px 14px;
  font-size: var(--step-small);
  line-height: 1.35;
}

.photo-strip--accent {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}

/* Column Spans */
.c-12 { grid-column: span 12; }
.c-8  { grid-column: span 8; }
.c-7  { grid-column: span 7; }
.c-6  { grid-column: span 6; }
.c-5  { grid-column: span 5; }
.c-4  { grid-column: span 4; }
.c-3  { grid-column: span 3; }
.c-2  { grid-column: span 2; }

/* Hero & Signature Masked Headline Motion */
.hero-lead {
  font-size: var(--step-lead);
  line-height: 1.48;
  color: var(--ink);
  margin: 0.85rem 0 1.45rem;
  max-width: 60ch;
}

.mask-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.mask-line > span {
  display: block;
}

.js-ready .mask-line > span {
  transform: translate3d(0, 105%, 0);
  transition: transform 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js-ready .mask-line:nth-child(2) > span {
  transition-delay: 95ms;
}

.js-ready.is-loaded .mask-line > span {
  transform: translate3d(0, 0, 0);
}

.hero-drift img {
  transform: scale(1.03);
  animation: lunarDrift 20s ease-in-out infinite alternate;
}

@keyframes lunarDrift {
  0%   { transform: scale(1.03) translate3d(0, 0, 0); }
  100% { transform: scale(1.08) translate3d(-1.4%, -1%, 0); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 13px 22px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  padding: 13px 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color 150ms ease-out, transform 120ms ease-out;
}

.btn-ghost:hover {
  background: var(--surface-3);
  color: #ffffff;
}

.btn-dark {
  background: var(--bg);
  color: var(--ink);
  padding: 13px 20px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--step-small);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.stat-big {
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}

.stat-note {
  font-size: var(--step-small);
  color: var(--muted);
  margin: 0;
}

.tile-accent .stat-note {
  color: rgba(10, 13, 20, 0.84);
}

/* Interactive Product Fragments ([data-ui]) */
[data-ui].ui-panel {
  background: var(--surface);
  color: var(--ink);
  padding: 24px;
  border: 1px solid rgba(233, 237, 243, 0.14);
}

[data-ui].ui-split {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid rgba(233, 237, 243, 0.14);
}

[data-ui] .ui-controls {
  padding: 24px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-ui] .ui-output {
  padding: 26px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

[data-ui] .ctrl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-ui] .ctrl-field label {
  font-size: var(--step-small);
  font-weight: 500;
  color: var(--ink);
}

[data-ui] select,
[data-ui] input[type="number"],
[data-ui] input[type="text"],
[data-ui] input[type="range"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid rgba(233, 237, 243, 0.24);
  font-family: var(--font-sans);
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

[data-ui] .ui-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

[data-ui] .ui-kpi {
  background: var(--surface-2);
  padding: 14px 16px;
}

[data-ui] .ui-kpi span {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 4px;
}

[data-ui] .ui-kpi strong {
  display: block;
  font-size: var(--step-lead);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

[data-ui] .ui-verdict {
  background: var(--surface-2);
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
}

[data-ui] .ui-verdict.is-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-left-color: #ff7a93;
}

[data-ui] .ui-verdict.is-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-left-color: #4be3a8;
}

[data-ui] .ui-verdict strong {
  display: block;
  font-size: var(--step-body);
  margin-bottom: 4px;
}

[data-ui] .ui-verdict p {
  font-size: var(--step-small);
  margin: 0;
  max-width: none;
}

[data-ui] .ui-blueprint {
  background: var(--bg);
  padding: 12px 14px;
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

/* Shards & Badge Checklist inside [data-ui] */
[data-ui] .ui-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

[data-ui] .ui-spin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

[data-ui] .ui-spin-controls input[type="number"] {
  width: 128px;
}

[data-ui] .check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

[data-ui] .check-btn {
  width: 100%;
  text-align: start;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid rgba(233, 237, 243, 0.14);
  padding: 12px 14px;
  min-height: 54px;
  font-family: var(--font-sans);
  font-size: var(--step-small);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

[data-ui] .check-btn:hover {
  background: var(--surface-3);
}

[data-ui] .check-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

[data-ui] .check-meta {
  font-size: var(--step-small);
  opacity: 0.86;
  text-align: end;
  flex-shrink: 0;
}

/* Proportional Rate Bars ([data-ui]) */
[data-ui].rate-bars {
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-ui] .rate-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 108px;
  gap: 12px;
  align-items: center;
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

[data-ui] .rate-track {
  background: var(--bg);
  height: 22px;
  position: relative;
  overflow: hidden;
}

[data-ui] .rate-fill {
  display: block;
  height: 100%;
  background: var(--surface-3);
}

[data-ui] .rate-fill--accent {
  background: var(--accent);
}

[data-ui] .rate-val {
  text-align: end;
  color: var(--ink);
  font-weight: 500;
}

/* Two-Ended Rows List (Section Blueprint 5) */
.two-end-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.two-end-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--surface);
  min-height: 44px;
}

.two-end-row:nth-child(even) {
  background: var(--surface-2);
}

.two-end-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.two-end-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  flex-shrink: 0;
  display: inline-block;
}

.two-end-right {
  font-size: var(--step-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
  flex-shrink: 0;
}

/* Data Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

th, td {
  text-align: start;
  padding: 13px 15px;
  border-bottom: 1px solid var(--surface-2);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
}

td.num, th.num {
  text-align: end;
}

/* Sticky-Left Accordion of Filled Tiles (Section Blueprint 6) */
.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--gap);
  align-items: start;
}

.faq-sticky {
  position: sticky;
  top: 28px;
  padding-right: 12px;
}

.faq-sticky p {
  color: var(--muted);
  margin-top: 10px;
}

.faq-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.faq-tile {
  background: var(--surface);
  color: var(--ink);
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.faq-tile summary {
  list-style: none;
  padding: 20px 24px;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--step-body);
  font-weight: 500;
  cursor: pointer;
}

.faq-tile summary::-webkit-details-marker {
  display: none;
}

.faq-plus {
  width: 16px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}

.faq-plus::before,
.faq-plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 160ms ease-out;
}

.faq-plus::before {
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
}

.faq-plus::after {
  top: 0;
  left: 7px;
  width: 2px;
  height: 16px;
}

.faq-tile[open] {
  background: var(--accent);
  color: var(--accent-ink);
}

.faq-tile[open] .faq-plus::after {
  transform: rotate(90deg);
}

.faq-ans {
  padding: 0 24px 22px;
}

.faq-ans p {
  max-width: 56ch;
  margin: 0;
}

/* Asymmetric Amazon Gear Mosaic (5/7 + 7/5, zero uniform card grid) */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.gear-tile {
  background: var(--surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  grid-column: span 5;
}

.gear-tile:nth-child(2),
.gear-tile:nth-child(3) {
  grid-column: span 7;
  background: var(--surface-2);
}

.disclosure-note {
  margin-top: 12px;
  font-size: var(--step-small);
  color: var(--muted);
  max-width: 78ch;
}

/* Adsterra Static Slots (zero popunders, zero adult, zero ads on legal/404) */
.ad-slot {
  margin: 24px 0;
  background: var(--surface);
  padding: 10px 12px;
  overflow: hidden;
}

.ad-leader,
.ad-300 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
}

.ad-n,
.ad-native {
  display: block;
  width: 100%;
}

.ad-slot-label {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-bottom: 6px;
}

.ad-slot-pending {
  display: none;
}

/* Footer of Tiles (Section Blueprint 7) */
.footer-board {
  margin-top: clamp(80px, 9vw, 144px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.footer-wordmark {
  background: var(--ink);
  color: var(--bg);
  padding: 28px 24px;
  display: flex;
  align-items: flex-end;
  min-height: 208px;
}

.footer-wordmark span {
  font-size: clamp(2.1rem, 5.4vw, 4.9rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.footer-cta-tile {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 24px;
  min-height: 208px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-cta-tile:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.footer-cta-tile strong {
  font-size: var(--step-lead);
  line-height: 1.18;
}

.footer-cta-arrow {
  align-self: flex-end;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--step-small);
}

.footer-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.credits {
  font-size: var(--step-small);
  color: var(--muted);
  max-width: none;
  margin: 0;
}

/* Staggered Section Reveal (>16 moving elements, safe fallback) */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 480ms cubic-bezier(0.22, 1, 0.36, 1), transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js-ready [data-reveal],
  .js-ready .mask-line > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-drift img {
    animation: none !important;
    transform: none !important;
  }
}

/* Tablet & Phone Responsive Layouts */
@media (max-width: 980px) {
  .top-bar {
    grid-template-columns: 1fr auto;
  }
  .nav-tile {
    grid-column: 1 / -1;
    order: 3;
  }
  .c-3, .c-2 {
    grid-column: span 6;
  }
  .c-12 {
    grid-column: span 12;
  }
  .section-head,
  [data-ui].ui-split,
  .faq-layout {
    grid-template-columns: 1fr;
  }
  .section-head p {
    text-align: start;
    justify-self: start;
  }
  .faq-sticky {
    position: static;
  }
}

@media (max-width: 680px) {
  :root {
    --pad: 18px;
    --gap: 6px;
  }
  .tile-grid,
  .footer-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .c-12, .c-8, .c-7, .c-6, .c-5, .c-4 {
    grid-column: span 2;
  }
  .c-3, .c-2 {
    grid-column: span 1;
  }
  .tile {
    padding: 18px;
  }
  [data-ui] .ui-kpi-grid,
  [data-ui] .check-grid {
    grid-template-columns: 1fr;
  }
  [data-ui] .rate-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  [data-ui] .rate-val {
    text-align: start;
  }
  .two-end-row {
    flex-direction: column;
    gap: 4px;
  }
  .two-end-right {
    text-align: start;
  }
  .gear-grid {
    grid-template-columns: 1fr;
  }
  .gear-tile,
  .gear-tile:nth-child(2),
  .gear-tile:nth-child(3) {
    grid-column: span 1;
  }
  .footer-wordmark,
  .footer-cta-tile {
    min-height: 140px;
  }
}
