/* =========================================================================
   TO388 — Design System
   Visual DNA: Bucks Sauce (editorial, typography-first, massive whitespace)
   Palette: blue digital. No gold, no casino dark theme.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --primary: #0066ff;
  --primary-strong: #0052cc;
  --secondary: #0a2342;
  --accent: #4da3ff;
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #111827;

  --muted: #51607a;
  --muted-soft: #6b7790;
  --line: #e4ebf3;
  --line-strong: #cdd9e8;
  --soft-blue: #eef4ff;
  --soft-blue-2: #e2ecff;

  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10, 35, 66, 0.06);
  --shadow: 0 18px 40px -24px rgba(10, 35, 66, 0.28);
  --shadow-lg: 0 40px 80px -40px rgba(10, 35, 66, 0.35);

  --maxw: 1160px;
  --maxw-narrow: 760px;

  --space-section: 64px;       /* mobile */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (min-width: 768px) {
  :root { --space-section: 96px; }
}
@media (min-width: 1024px) {
  :root { --space-section: 140px; }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; color: var(--secondary); }
h1 { font-size: clamp(2.625rem, 7vw, 4.5rem); }      /* 42 -> 72px */
h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; letter-spacing: -0.01em; }
p { color: var(--muted); }
strong { color: var(--text); font-weight: 700; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }

.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.narrow { max-width: var(--maxw-narrow); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section--tight { padding-block: calc(var(--space-section) * 0.62); }
.section--surface { background: var(--surface); }
.section--soft { background: var(--soft-blue); }
.center { text-align: center; }
.stack > * + * { margin-top: 1.1rem; }

.skip-link {
  position: absolute; left: 14px; top: -60px; z-index: 200;
  background: var(--secondary); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 14px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 1rem; line-height: 1; text-align: center;
  padding: 16px 28px; border-radius: var(--pill); border: 2px solid transparent;
  cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 16px 30px -16px rgba(0, 102, 255, 0.7); }
.btn--primary:hover { background: var(--primary-strong); transform: translateY(-2px); }
.btn--secondary { background: var(--surface); color: var(--primary); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--primary); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--secondary); padding-inline: 4px; }
.btn--ghost:hover { color: var(--primary); }
.btn--block { width: 100%; }
.btn--lg { padding: 18px 34px; font-size: 1.05rem; }

.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--primary); }
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 250, 252, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.32rem; letter-spacing: -0.03em; color: var(--secondary); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 0.82rem; font-weight: 800; letter-spacing: 0; box-shadow: 0 8px 18px -8px rgba(0, 102, 255, 0.8);
}
.brand b { color: var(--primary); }

.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 14px; border-radius: var(--pill); font-weight: 600; font-size: 0.97rem; color: var(--muted);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-links a:hover { color: var(--secondary); background: var(--soft-blue); }
.nav-links a[aria-current="page"] { color: var(--primary); background: var(--soft-blue); }

.nav-cta { display: none; align-items: center; gap: 10px; }
.nav-cta .btn { padding: 11px 20px; }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px; padding: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); border-radius: 12px; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--secondary); border-radius: 2px; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows 0.24s var(--ease);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.mobile-menu[data-open="true"] { grid-template-rows: 1fr; }
.mobile-menu-inner { min-height: 0; padding: 8px 22px 22px; }
.mobile-menu a { display: block; padding: 13px 6px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--secondary); }
.mobile-menu a[aria-current="page"] { color: var(--primary); }
.mobile-menu .btn { margin-top: 16px; }
.mobile-menu .menu-ctas { display: grid; gap: 10px; margin-top: 18px; }

@media (min-width: 980px) {
  .nav-links, .nav-cta { display: flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 120px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 85% -10%, rgba(77, 163, 255, 0.22), transparent 60%),
    radial-gradient(50% 50% at 0% 110%, rgba(0, 102, 255, 0.12), transparent 60%);
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { margin-top: 18px; }
.hero .lead { margin-top: 22px; max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px 40px; margin-top: 48px; }
.hero-meta .stat strong { display: block; font-size: 2rem; color: var(--secondary); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.hero-meta .stat span { font-size: 0.92rem; color: var(--muted-soft); }

.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 920px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 64px; } }

.hero-visual {
  position: relative; border-radius: var(--radius-xl); padding: 30px; min-height: 320px;
  background: linear-gradient(150deg, var(--secondary), #123b6e 55%, var(--primary));
  color: #fff; box-shadow: var(--shadow-lg); overflow: hidden;
}
.hero-visual::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 163, 255, 0.55), transparent 70%);
}
.hero-visual .vtag { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.hero-visual h3 { color: #fff; margin-top: 14px; font-size: 1.5rem; }
.hero-visual p { color: rgba(255, 255, 255, 0.82); margin-top: 10px; }
.hero-visual .vlist { margin-top: 22px; display: grid; gap: 12px; position: relative; z-index: 1; }
.hero-visual .vlist li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, 0.92); font-size: 0.97rem; }
.hero-visual .vlist svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 680px) { .grid--2 { grid-template-columns: 1fr 1fr; } .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow-sm); transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.98rem; }
.card-icon {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--soft-blue); color: var(--primary);
}
.card-icon svg { width: 24px; height: 24px; }
.card .index { font-size: 0.85rem; font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }

/* feature highlight (editorial alternating) */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 70px; } .split.reverse .split-media { order: -1; } }
.split-media {
  border-radius: var(--radius-xl); padding: 34px; min-height: 280px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--soft-blue), #fff);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.split-media.dark { background: linear-gradient(160deg, var(--secondary), var(--primary)); border: none; color: #fff; }
.mini-list { display: grid; gap: 14px; margin-top: 8px; }
.mini-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.mini-list svg { width: 22px; height: 22px; flex: none; color: var(--primary); margin-top: 3px; }
.split-media.dark .mini-list li { color: rgba(255,255,255,0.9); }
.split-media.dark .mini-list svg { color: var(--accent); }
.split-media h3 { margin-bottom: 6px; }
.split-media.dark h3 { color: #fff; }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; }
.section-head h2 { margin-top: 14px; }
.section-head p { margin-top: 16px; }

/* ---------- Banner / CTA strip ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--secondary), #123b6e 50%, var(--primary));
  border-radius: var(--radius-xl); padding: clamp(40px, 6vw, 72px); color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cta-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(77,163,255,0.45), transparent 70%); }
.cta-band h2 { color: #fff; position: relative; }
.cta-band p { color: rgba(255,255,255,0.85); margin-top: 16px; max-width: 52ch; position: relative; }
.cta-band .hero-actions { position: relative; }
.cta-band .btn--secondary { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.4); }
.cta-band .btn--secondary:hover { background: rgba(255,255,255,0.18); border-color: #fff; }

/* ---------- Prose (legal / article) ---------- */
.prose { max-width: var(--maxw-narrow); margin-inline: auto; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 52px; }
.prose h3 { margin-top: 34px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 1.1rem; }
.prose ul, .prose ol { margin-top: 1rem; display: grid; gap: 10px; }
.prose ul li { padding-left: 28px; position: relative; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.prose ol { counter-reset: s; }
.prose ol li { padding-left: 36px; position: relative; }
.prose ol li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 8px; background: var(--soft-blue); color: var(--primary); font-size: 0.82rem; font-weight: 800; display: grid; place-items: center; }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose strong { color: var(--text); }
.last-updated { font-size: 0.9rem; color: var(--muted-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data caption { text-align: left; padding: 18px 20px 0; font-weight: 700; color: var(--secondary); }
table.data th, table.data td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.96rem; }
table.data thead th { background: var(--soft-blue); color: var(--secondary); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; text-transform: uppercase; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafcff; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: var(--pill); font-size: 0.8rem; font-weight: 700; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.badge--on { background: #e7f7ee; color: #137a45; } .badge--on::before { background: #1aa05a; }
.badge--off { background: #fdeaea; color: #b42318; } .badge--off::before { background: #d92d20; }
.badge--warn { background: #fff3e0; color: #b25a00; } .badge--warn::before { background: #e08800; }

/* ---------- Accordion / FAQ ---------- */
.faq { display: grid; gap: 14px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.faq-item:hover { border-color: var(--line-strong); }
.faq-item[open] { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.faq-item summary { list-style: none; cursor: pointer; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-weight: 700; color: var(--secondary); font-size: 1.05rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft-blue); color: var(--primary); transition: transform 0.22s var(--ease); }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 24px 24px; }
.faq-item .faq-body p { color: var(--muted); }
.faq-item .faq-body p + p { margin-top: 0.9rem; }

/* ---------- Forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 44px); box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--secondary); }
.field input, .field select {
  padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); font-size: 1rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,102,255,0.12); }
.field .hint { font-size: 0.84rem; color: var(--muted-soft); }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--muted); margin-bottom: 20px; }
.checkbox-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.form-aside { display: grid; gap: 18px; align-content: start; }
.note { background: var(--soft-blue); border: 1px solid var(--soft-blue-2); border-radius: var(--radius); padding: 22px 24px; }
.note h4 { color: var(--secondary); margin-bottom: 6px; }
.note p { font-size: 0.95rem; }

/* tags / pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; color: var(--secondary); }
.pill svg { width: 16px; height: 16px; color: var(--primary); }

.breadcrumb { font-size: 0.88rem; color: var(--muted-soft); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span[aria-current] { color: var(--secondary); font-weight: 600; }

/* contextual inline link group */
.related { display: grid; gap: 14px; margin-top: 22px; }
.related a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 700; color: var(--secondary); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.related a:hover { border-color: var(--primary); transform: translateX(4px); }
.related a svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.related a span small { display: block; font-weight: 500; font-size: 0.85rem; color: var(--muted-soft); margin-top: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--secondary); color: rgba(255,255,255,0.74); padding-block: 70px 30px; margin-top: var(--space-section); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer .brand { color: #fff; }
.footer-about p { color: rgba(255,255,255,0.66); margin-top: 16px; font-size: 0.96rem; max-width: 38ch; }
.footer-col h4 { color: #fff; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a { display: block; padding: 7px 0; color: rgba(255,255,255,0.72); font-size: 0.96rem; transition: color 0.16s var(--ease); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 50px; padding-top: 26px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.footer-bottom .age { display: inline-flex; align-items: center; gap: 9px; }
.footer-bottom .age b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.45); color: #fff; font-size: 0.78rem; }

/* ---------- Misc utilities ---------- */
.tag-line { color: var(--primary); font-weight: 700; }
.hr { height: 1px; background: var(--line); border: 0; margin-block: var(--space-section); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fade-up { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.fade-up.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .fade-up { opacity: 1; transform: none; } }

.callout { background: var(--soft-blue); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); padding: 20px 24px; }
.callout p { color: var(--secondary); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 40px; }
.toc h4 { margin-bottom: 12px; color: var(--secondary); }
.toc a { color: var(--primary); font-weight: 600; padding: 5px 0; display: inline-block; }
