/* ============================================================
   Xanadu Design System — xanadu.css
   New visual tokens, components, and layout for Phase 1 site.
   Import alongside styles.css; this file OVERRIDES/extends it.
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design Tokens ── */
:root {
  --primary:   #0F4C5C;
  --surface:   #FAF6EE;
  --accent1:   #E36414;
  --accent2:   #5F0F40;
  --critical:  #9A031E;
  --text:      #1A1A1A;
  --border:    #E5DFD3;
  --muted:     #6B6560;
  --white:     #FFFFFF;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --nav-h: 68px;
  --max-w: 1100px;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(15,76,92,0.08);
  --shadow-md: 0 4px 16px rgba(15,76,92,0.12);
  --shadow-lg: 0 8px 32px rgba(15,76,92,0.16);
}

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: underline; }
a:hover { color: var(--accent1); }

/* ── Password Gate Overlay ── */
#xanadu-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}

#xanadu-gate .gate-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

#xanadu-gate .gate-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

#xanadu-gate .gate-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

#xanadu-gate input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

#xanadu-gate input[type="password"]:focus {
  border-color: var(--primary);
}

#xanadu-gate .gate-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent1);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#xanadu-gate .gate-btn:hover { background: #c9540e; }

#xanadu-gate .gate-error {
  color: var(--critical);
  font-size: 0.875rem;
  margin-top: 8px;
  min-height: 1.2em;
}

/* ── Navigation ── */
.xnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  box-shadow: var(--shadow-sm);
}

.xnav .xnav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.xnav-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.xnav-brand:hover { color: var(--primary); }

.xnav-brand img {
  height: 38px;
  width: auto;
}

.xnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.xnav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.xnav-links a:hover {
  background: rgba(15,76,92,0.06);
  color: var(--primary);
}

.xnav-cta {
  background: var(--accent1) !important;
  color: var(--white) !important;
  padding: 8px 18px !important;
  border-radius: var(--radius) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.xnav-cta:hover { background: #c9540e !important; }

/* Mobile nav toggle */
.xnav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}

.xnav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

@media (max-width: 840px) {
  .xnav-toggle { display: flex; }
  .xnav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    gap: 4px;
  }
  .xnav-links.open { display: flex; }
  .xnav-links a { padding: 10px 12px; width: 100%; }
}

/* ── Page Shell ── */
.xpage { min-height: 100vh; display: flex; flex-direction: column; }
.xmain { flex: 1; }

/* ── Section Containers ── */
.xsection {
  padding: 80px 24px;
}

.xsection--alt {
  background: var(--white);
}

.xsection--dark {
  background: var(--primary);
  color: var(--white);
}

.xsection--dark h1,
.xsection--dark h2,
.xsection--dark h3 {
  color: var(--white);
}

.xinner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Typography ── */
.x-display {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--primary);
  margin: 0 0 20px;
  text-wrap: balance;
}

.x-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary);
  margin: 0 0 16px;
  text-wrap: balance;
}

.x-h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 12px;
  text-wrap: balance;
}

.x-lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 32px;
  line-height: 1.7;
  text-wrap: pretty;
}

.x-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent1);
  margin-bottom: 12px;
}

/* ── Buttons ── */
.xbtn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: var(--font-body);
}

.xbtn:active { transform: scale(0.98); }

.xbtn--primary {
  background: var(--accent1);
  color: var(--white);
}

.xbtn--primary:hover { background: #c9540e; color: var(--white); }

.xbtn--outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.xbtn--outline:hover { background: var(--primary); color: var(--white); }

.xbtn--ghost {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.3);
}

.xbtn--ghost:hover { background: rgba(255,255,255,0.22); color: var(--white); }

/* ── Hero ── */
.xhero {
  background: var(--primary);
  color: var(--white);
  padding: 96px 24px 80px;
}

.xhero .xinner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.xhero-text .x-display { color: var(--white); }

.xhero-text .x-lead { color: rgba(255,255,255,0.82); }

.xhero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.xhero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.xhero-mockup {
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  max-width: 420px;
  width: 100%;
}

@media (max-width: 768px) {
  .xhero .xinner { grid-template-columns: 1fr; }
  .xhero-visual { display: none; }
  .xhero { padding: 64px 24px 56px; }
}

/* ── Founder WHY block ── */
.xfounder {
  background: var(--white);
  border-left: 4px solid var(--accent1);
  padding: 32px 36px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0;
}

.xfounder-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 16px;
}

.xfounder-attr {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Cards / Grid ── */
.xgrid {
  display: grid;
  gap: 24px;
}

.xgrid--2 { grid-template-columns: repeat(2, 1fr); }
.xgrid--3 { grid-template-columns: repeat(3, 1fr); }
.xgrid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .xgrid--4 { grid-template-columns: repeat(2, 1fr); }
  .xgrid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .xgrid--4, .xgrid--3, .xgrid--2 { grid-template-columns: 1fr; }
}

.xcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.xcard:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  transition: box-shadow 0.2s, transform 0.2s;
}

.xcard-icon {
  width: 48px;
  height: 48px;
  background: rgba(15,76,92,0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.xcard-icon--accent { background: rgba(227,100,20,0.1); }

/* ── Comparison Strip ── */
.xcompare {
  background: #1a1a1a;
  color: var(--white);
}

.xcompare-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.xcompare-item:last-child { border-bottom: none; }

.xcompare-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.xcompare-badge--bad  { background: var(--critical); color: #fff; }
.xcompare-badge--good { background: #1a6b2f; color: #fff; }

.xcompare-text { line-height: 1.55; }

.xcompare-cite {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.xcompare-cite a { color: rgba(255,255,255,0.55); }

/* ── 80/20 Explainer ── */
.x8020 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.x8020-donut {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.x8020-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}

.x8020-pct {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.x8020-you { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 640px) {
  .x8020 { grid-template-columns: 1fr; }
}

/* ── Waitlist Form ── */
.xform {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 520px;
}

.xform input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.xform input[type="email"]:focus { border-color: var(--primary); }

.xform-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
}

/* ── Footer ── */
.xfooter {
  background: var(--primary);
  color: rgba(255,255,255,0.82);
  padding: 60px 24px 32px;
}

.xfooter .xinner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 860px) { .xfooter .xinner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .xfooter .xinner { grid-template-columns: 1fr; } }

.xfooter-col h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.xfooter-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xfooter-col li { margin-bottom: 8px; }

.xfooter-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.xfooter-col a:hover { color: var(--white); }

.xfooter-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

@media (max-width: 700px) {
  .xfooter .xinner { grid-template-columns: 1fr; gap: 28px; }
  .xfooter-bottom { flex-direction: column; }
}

/* ── Pillar Cards (How It Works) ── */
.xpillar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.xpillar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent1);
}

.xpillar-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.xpillar-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  text-wrap: balance;
}

.xpillar-tm {
  font-size: 0.65em;
  vertical-align: super;
}

.xcompare .xpillar p { color: var(--text); }
.xcompare .xpillar a { color: var(--primary); }

/* ── Score Meter ── */
.xscore-bar {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.xscore-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent1), var(--primary));
  border-radius: 99px;
}

/* ── Manifesto / Long-form text ── */
.xprose {
  max-width: 720px;
}

.xprose h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--primary);
  margin-top: 48px;
}

.xprose h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--primary);
  margin-top: 32px;
}

.xprose p { margin-bottom: 20px; }

.xprose ol, .xprose ul {
  padding-left: 24px;
  margin-bottom: 20px;
}

.xprose li { margin-bottom: 8px; }

.xprose blockquote {
  border-left: 4px solid var(--accent1);
  margin: 32px 0;
  padding: 20px 24px;
  background: rgba(227,100,20,0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* ── Sovereignty Scorecard ── */
.xscorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.xscorecard-table th {
  background: var(--primary);
  color: var(--white);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.xscorecard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.xscorecard-table tr:last-child td { border-bottom: none; }

.xscorecard-table tr:nth-child(even) td { background: rgba(15,76,92,0.03); }

.xverdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
}

.xverdict--certified { background: rgba(26,107,47,0.12); color: #1a6b2f; border: 1px solid #1a6b2f; }
.xverdict--gap       { background: rgba(227,100,20,0.1); color: #c9540e; border: 1px solid #c9540e; }
.xverdict--noncompliant { background: rgba(154,3,30,0.1); color: var(--critical); border: 1px solid var(--critical); }

/* ── Press / Media ── */
.xpress-quote {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 12px;
}

/* ── Skip Link ── */
.xskip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.xskip:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 16px;
  background: var(--accent1);
  color: var(--white);
  z-index: 9999;
}

/* ── Utility ── */
.xtext-center { text-align: center; }
.xtext-muted  { color: var(--muted); }
.xmt-0  { margin-top: 0; }
.xmb-0  { margin-bottom: 0; }
.xmt-8  { margin-top: 8px; }
.xmt-16 { margin-top: 16px; }
.xmt-24 { margin-top: 24px; }
.xmt-32 { margin-top: 32px; }
.xmt-48 { margin-top: 48px; }
.xmb-16 { margin-bottom: 16px; }
.xmb-24 { margin-bottom: 24px; }
.xmb-32 { margin-bottom: 32px; }
.xmb-48 { margin-bottom: 48px; }
.xvisually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Tag / Pill ── */
.xtag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15,76,92,0.08);
  color: var(--primary);
}

/* ── Scroll animations ── */
.xanimate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.xanimate--in {
  opacity: 1;
  transform: translateY(0);
}

/* ── FAQ ── */
.xfaq-item { border-bottom: 1px solid var(--border); }
.xfaq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
}
.xfaq-q::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 300;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.xfaq-item.open .xfaq-q::after { content: '\2212'; }
.xfaq-a {
  display: none;
  padding: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}
.xfaq-item.open .xfaq-a { display: block; }

/* ── Waitlist success ── */
.xform-success {
  display: none;
  background: rgba(134,239,172,0.12);
  border: 1px solid rgba(134,239,172,0.45);
  color: #86efac;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ── Divider ── */
.xdivider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── Page Hero (inner pages) ── */
.xpage-hero {
  background: var(--primary);
  color: var(--white);
  padding: 64px 24px 56px;
}

.xpage-hero .x-display { color: var(--white); margin-bottom: 12px; }
.xpage-hero .x-lead { color: rgba(255,255,255,0.78); margin-bottom: 0; }

/* Mockup carousel */
.xmockup-carousel { position: relative; }
.xmockup-frame { display: block; }
.xmockup-screen {
  width: 220px;
  border-radius: 32px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25), 0 32px 64px rgba(0,0,0,0.45);
  border: 6px solid rgba(255,255,255,0.08);
  display: block;
  margin: 0 auto;
  transition: opacity 0.3s ease;
}
.xdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.xdot--active { background: #E36414; }

/* -- Conviction Band -- */
.xconviction {
  background: linear-gradient(135deg, #0a1628 0%, #0f2240 100%);
  border-top: 1px solid rgba(227,100,20,0.25);
  border-bottom: 1px solid rgba(227,100,20,0.25);
}
.xconviction-text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-style: italic;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
  margin: 0;
  padding: 0 16px;
  position: relative;
}
.xconviction-text::before {
  content: '\201C';
  font-size: 4rem;
  line-height: 0;
  vertical-align: -0.55em;
  color: #E36414;
  margin-right: 4px;
  font-style: normal;
}

/* ── Mobile Responsiveness Overrides ── */
/* Collapse inline 2-column grids to single column on small screens.
   Uses attribute selector + !important to defeat inline style specificity. */
@media (max-width: 720px) {
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:1.1fr 0.9fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .xsection { padding: 56px 20px; }
  .xinner { padding: 0; }

  /* Tighten conviction band on phones */
  .xconviction-text { font-size: 1.05rem; line-height: 1.6; }
  .xconviction-text::before { font-size: 2.8rem; }

  /* Prevent fixed-width tables/images from causing horizontal scroll */
  table, pre, img, video, iframe { max-width: 100%; }
  pre { overflow-x: auto; }
}

@media (max-width: 480px) {
  .xsection { padding: 44px 16px; }
}

/* Prevent any element from forcing horizontal scroll */
html, body { overflow-x: hidden; max-width: 100vw; }

/* -- Dashboard (dashboard.html) -- */
.xdemo-banner {
  background: #FFF6E0;
  color: #5C3A00;
  border-bottom: 1px solid #F0D38A;
  padding: 10px 16px;
  font-size: 0.82rem;
  text-align: center;
}
.xdemo-banner strong { color: #8A4500; letter-spacing: 0.04em; }

.xdash-hero {
  background: linear-gradient(180deg, #F7F4EE 0%, #FFFFFF 100%);
  padding: 32px 20px 40px;
}
.xdash-title {
  font-family: var(--font-display, Inter, sans-serif);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #0F2240;
  margin: 4px 0 24px;
}

.xdash-score-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e1d8;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(15,34,64,0.06);
}
@media (max-width: 560px) {
  .xdash-score-block { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
.xdash-score-ring svg { display: block; }
.xdash-tier {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #0F2240;
  color: #FFC580;
  margin-bottom: 6px;
}
.xdash-tier--platinum { background: linear-gradient(135deg, #0F2240, #2A4A7A); }
.xdash-multiplier {
  font-size: 0.95rem;
  color: #E36414;
  font-weight: 600;
  margin-bottom: 12px;
}
.xdash-score-bar {
  height: 8px;
  background: rgba(15,34,64,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.xdash-score-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #E36414, #FFB347);
  border-radius: 999px;
}
.xdash-score-detail { font-size: 0.82rem; color: #5C8AAE; }

.xdash-projected {
  margin-top: 20px;
  background: #0F2240;
  color: #fff;
  border-radius: 14px;
  padding: 16px 20px;
}
.xdash-projected-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.xdash-projected-row strong { font-size: 1.6rem; color: #FFB347; font-family: var(--font-display, Inter, sans-serif); }
.xdash-projected-sub { font-size: 0.78rem; color: rgba(255,255,255,0.65); margin-top: 4px; }

.xdash-section-head { margin-bottom: 24px; }
.xdash-section-sub { color: #5C8AAE; max-width: 640px; }

.xdash-devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.xdev-card {
  background: #fff;
  border: 1px solid #e5e1d8;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15,34,64,0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.xdev-card--connected { border-left: 4px solid #2E7D32; }
.xdev-card--clinical { border-left: 4px solid #2A4A7A; }
.xdev-card--rx { border-left: 4px solid #8B1538; }
.xdev-status--prior {
  background: rgba(139,21,56,0.10);
  color: #8B1538;
}
.xdev-note {
  font-size: 0.78rem;
  font-style: italic;
  color: #5C8AAE;
  background: rgba(42,74,122,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  line-height: 1.5;
}

/* -- Tier ladder (dashboard.html) -- */
.xtier-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.xtier-card {
  background: #fff;
  border: 1px solid #e5e1d8;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(15,34,64,0.05);
  display: flex;
  flex-direction: column;
}
.xtier-card--bronze   { border-top: 5px solid #B07A3C; }
.xtier-card--silver   { border-top: 5px solid #98A3AD; }
.xtier-card--gold     { border-top: 5px solid #E0A82E; }
.xtier-card--platinum { border-top: 5px solid #0F2240; background: linear-gradient(180deg, #FFF8EC 0%, #FFFFFF 70%); }
.xtier-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.xtier-name {
  font-family: var(--font-display, Inter, sans-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #0F2240;
  letter-spacing: 0.02em;
}
.xtier-mult {
  font-size: 0.85rem;
  font-weight: 700;
  color: #E36414;
}
.xtier-tag {
  font-size: 0.85rem;
  color: #5C8AAE;
  margin: 0 0 14px;
  font-style: italic;
}
.xtier-card h4 {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5C8AAE;
  margin: 14px 0 6px;
  font-weight: 600;
}
.xtier-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 0.86rem;
  color: #0F2240;
  line-height: 1.55;
}
.xtier-list li { margin-bottom: 4px; }
.xtier-list--bonus li { color: #2A4A7A; }
.xtier-next {
  font-size: 0.82rem;
  color: #5C8AAE;
  margin: 8px 0 0;
  padding: 8px 10px;
  background: rgba(15,34,64,0.04);
  border-radius: 6px;
  line-height: 1.5;
}
.xtier-next--strong {
  color: #B0481E;
  background: rgba(227,100,20,0.08);
  font-weight: 600;
}
.xtier-rationale {
  margin-top: 24px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e5e1d8;
  border-left: 4px solid #E36414;
  border-radius: 10px;
}
.xtier-rationale h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #0F2240;
}
.xtier-rationale p {
  margin: 0;
  font-size: 0.9rem;
  color: #0F2240;
  line-height: 1.6;
}
.xdev-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.xdev-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  letter-spacing: 0.04em;
  flex: 0 0 40px;
}
.xdev-titles { flex: 1 1 auto; min-width: 0; }
.xdev-titles h3 { margin: 0; font-size: 1.02rem; color: #0F2240; }
.xdev-brand { font-size: 0.76rem; color: #5C8AAE; }
.xdev-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.xdev-status--live { background: rgba(46,125,50,0.1); color: #2E7D32; }
.xdev-status--workout { background: rgba(255,119,0,0.12); color: #B05500; }
.xdev-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: xdevDot 1.6s ease-in-out infinite;
}
@keyframes xdevDot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.xdev-data {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  border-top: 1px solid #f0ebe1;
  padding-top: 12px;
}
.xdev-data li {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}
.xdev-data li strong { color: #5C8AAE; font-weight: 500; font-size: 0.72rem; letter-spacing: 0.02em; text-transform: uppercase; }
.xdev-data li span { color: #0F2240; font-weight: 600; }
.xdev-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.7rem;
  color: #5C8AAE;
  border-top: 1px solid #f0ebe1;
  padding-top: 10px;
  flex-wrap: wrap;
}
.xdev-fhir { color: #E36414; font-weight: 600; }

.xdash-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.xdash-factor {
  background: #fff;
  border: 1px solid #e5e1d8;
  border-radius: 12px;
  padding: 14px 16px;
}
.xdash-factor-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.xdash-factor-head strong { color: #0F2240; font-size: 0.95rem; }
.xdash-factor-head span { color: #E36414; font-weight: 700; font-size: 0.85rem; }
.xdash-factor-bar {
  height: 6px;
  background: rgba(15,34,64,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.xdash-factor-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2A4A7A, #5C8AAE);
}
.xdash-factor-note { font-size: 0.78rem; color: #5C8AAE; margin: 0; }

.xdash-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.xbtn--ghost {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  color: #fff;
}
.xbtn--ghost:hover { background: rgba(255,255,255,0.08); }
.xbtn--danger {
  background: #8B1B0A;
  color: #fff;
  border: 1.5px solid #B0341F;
}
.xbtn--danger:hover { background: #A02214; }

/* -- Confidential Pre-Patent Banner (sticky top, all pages) -- */
#xanadu-confidential-banner {
  position: sticky;
  top: 0;
  z-index: 9000;
  width: 100%;
  background: #5C1A0B;
  color: #FFF1DA;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #E36414;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
#xanadu-confidential-banner .xcb-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  background: #E36414;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(227,100,20,0.25);
  animation: xcbPulse 2.4s ease-in-out infinite;
}
#xanadu-confidential-banner .xcb-text {
  flex: 1 1 auto;
}
#xanadu-confidential-banner strong {
  color: #FFC580;
  letter-spacing: 0.04em;
}
@keyframes xcbPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(227,100,20,0.20); }
  50%      { box-shadow: 0 0 0 7px rgba(227,100,20,0.05); }
}
@media (max-width: 720px) {
  #xanadu-confidential-banner { font-size: 0.7rem; padding: 8px 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #xanadu-confidential-banner .xcb-dot { animation: none; }
}

/* Nav must sit BELOW the banner, not on top of it */
.xnav { top: var(--xcb-h, 0); }

/* -- Architecture diagram (how-it-works.html) -- */
.xarch-diagram { background: #F7F4EE; }
.xarch-svg-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border, #e5e1d8);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(15, 34, 64, 0.05);
}
.xarch-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Show horizontal on desktop/tablet, vertical on phone */
.xarch-svg-wrap--vertical { display: none; }
@media (max-width: 720px) {
  .xarch-svg-wrap--horizontal { display: none; }
  .xarch-svg-wrap--vertical { display: block; max-width: 400px; padding: 12px; }
}

.xtext-center { text-align: center; }

/* -- Architecture diagram: scroll-triggered animation --
   Each node/line/curve has --i (step index). On page load, fade in
   with a staggered delay (works everywhere). On browsers that
   support scroll-driven animations, also tie the reveal to the
   diagram entering the viewport for a more polished feel. */

.arch-node,
.arch-line,
.arch-flow-back {
  opacity: 0;
  animation: archFadeIn 0.55s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 180ms + 200ms);
}
.arch-line { transform-origin: left center; }
.arch-flow-back {
  stroke-dashoffset: 1800;
  stroke-dasharray: 1800;
  animation: archDrawLine 1.2s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 180ms + 200ms);
}

@keyframes archFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes archDrawLine {
  from { opacity: 0; stroke-dashoffset: 1800; }
  to   { opacity: 1; stroke-dashoffset: 0; }
}

/* Scroll-driven version (Chrome 115+, Edge 115+): only fires when
   the diagram enters the viewport. Falls back silently elsewhere. */
@supports (animation-timeline: view()) {
  .xarch-svg-wrap {
    view-timeline-name: --arch-reveal;
    view-timeline-axis: block;
  }
  .arch-node,
  .arch-line,
  .arch-flow-back {
    animation-timeline: --arch-reveal;
    animation-range: entry 10% cover 35%;
    animation-delay: 0s;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .arch-node, .arch-line, .arch-flow-back {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
  }
}
