/* CrossVal — Technical Architecture Overview page
   Built on CrossVal design tokens (assets/colors_and_type.css). */

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

:root {
  /* page-controllable accent (tweakable) */
  --accent: var(--xv-mint-400);
  --accent-strong: var(--xv-mint-500);
  --accent-soft: rgba(148, 244, 175, 0.20);
  --accent-2: var(--xv-lilac-400);

  --ink: var(--xv-green-800);
  --ink-2: rgba(39, 63, 59, 0.66);
  --ink-3: rgba(39, 63, 59, 0.42);
  --hair: rgba(39, 63, 59, 0.12);
  --hair-soft: rgba(39, 63, 59, 0.07);
  --surface: #FFFFFF;
  --page: var(--xv-bg);

  --maxw: 980px;
  --gutter: 32px;
  --sec-pad: 132px;
}

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--xv-font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
a, button { -webkit-tap-highlight-color: transparent; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type helpers ---------- */
.display {
  font-family: var(--xv-font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.mono {
  font-family: var(--xv-font-mono);
  font-feature-settings: "tnum" 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--xv-font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--accent-strong);
  flex: none;
}

/* inline icon placeholder (lucide replaces the <i> with an <svg>) */
.ic { display: inline-flex; flex: none; line-height: 0; }
.ic svg { display: block; }
.confidential svg { width: 13px; height: 13px; }
.metalist li > .ic { margin-top: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--hair-soft);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left)) 0 max(var(--gutter), env(safe-area-inset-left));
  height: 76px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand img { height: 40px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: color .18s ease;
}
.nav a:hover { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--xv-font-body); font-weight: 500;
  border-radius: var(--xv-r-pill); cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink); color: var(--page);
  padding: 11px 22px; font-size: 14.5px;
}
.btn-primary:hover { background: #1d302c; box-shadow: 0 8px 22px rgba(39,63,59,0.18); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--hair); padding: 11px 22px; font-size: 14.5px;
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: 16px 30px; font-size: 16.5px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(720px 480px at 84% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(620px 420px at 6% 4%, rgba(172,173,237,0.16), transparent 60%);
}
.hero-inner { position: relative; padding: 96px 0 78px; }
.hero h1 {
  margin: 26px 0 0; font-size: clamp(38px, 5vw, 56px);
  max-width: 20ch;
}
.hero p.lede {
  margin: 30px 0 0; max-width: 62ch;
  font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--ink-2);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 46px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--xv-r-pill); padding: 9px 16px 9px 13px;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.chip svg { width: 15px; height: 15px; color: var(--ink); opacity: .8; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); }

/* ---------- residency strip ---------- */
.residency {
  border-top: 1px solid var(--hair-soft);
  border-bottom: 1px solid var(--hair-soft);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.residency-inner {
  display: flex; flex-direction: column; gap: 22px;
  padding: 30px 0;
}
.residency-control { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.residency-control .label {
  font-family: var(--xv-font-mono); font-size: 11.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3);
}
.segmented {
  display: inline-flex; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--hair); border-radius: var(--xv-r-pill);
}
.seg {
  appearance: none; -webkit-appearance: none; border: none; background: transparent;
  cursor: pointer; font-family: var(--xv-font-body); font-weight: 500; font-size: 14px;
  color: var(--ink-2); padding: 8px 18px; border-radius: var(--xv-r-pill); white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.seg:hover { color: var(--ink); }
.seg.active { background: var(--ink); color: var(--page); }
.residency-info { display: block; }
.residency-summary { margin: 16px 0 0; font-size: 15px; color: var(--ink-2); }
.names { display: flex; align-items: center; gap: 12px 36px; flex-wrap: wrap; }
.partner {
  display: flex; align-items: baseline; gap: 9px; white-space: nowrap;
  font-family: var(--xv-font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: 19px; color: var(--ink);
}
.partner span { font-family: var(--xv-font-mono); font-weight: 500; font-size: 11px; letter-spacing: .04em; color: var(--ink-3); }

/* ---------- section scaffolding ---------- */
section.block { padding: var(--sec-pad) 0; }
section.block + section.block { padding-top: 0; }
.sec-head { max-width: 64ch; margin-bottom: 52px; }
.sec-head h2 {
  margin: 18px 0 0; font-size: clamp(30px, 3.6vw, 44px);
  font-family: var(--xv-font-display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05;
  text-wrap: balance;
}
.sec-head p { margin: 18px 0 0; color: var(--ink-2); font-size: 19px; max-width: 58ch; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--xv-r-xl);
  padding: 36px 34px;
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--xv-shadow-card); border-color: rgba(39,63,59,0.18); }
.card .kicker {
  font-family: var(--xv-font-mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 12px; font-family: var(--xv-font-display); font-weight: 700;
  font-size: 24px; letter-spacing: -0.02em; line-height: 1.12;
}
.card p { margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }
.card .icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; margin-bottom: 22px;
  background: var(--accent-soft); color: var(--ink);
}
.card .icon svg { width: 22px; height: 22px; }
.card.lilac .icon { background: rgba(172,173,237,0.24); }

/* meta list inside cards */
.metalist { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.metalist li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.metalist li svg { width: 16px; height: 16px; color: var(--ink); flex: none; margin-top: 2px; opacity: .75; }
.metalist li b { color: var(--ink); font-weight: 600; }

/* highlight callout row */
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.callout {
  border: 1px solid var(--hair); border-radius: var(--xv-r-lg);
  padding: 26px 26px; background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.callout .big {
  font-family: var(--xv-font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: 19px; line-height: 1.15; margin-bottom: 8px;
}
.callout p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* ---------- security ---------- */
.sec-rows { border-top: 1px solid var(--hair); }
.sec-row {
  display: grid; grid-template-columns: 0.9fr 1.5fr auto; gap: 28px;
  align-items: center; padding: 26px 4px; border-bottom: 1px solid var(--hair);
}
.sec-row .area { font-family: var(--xv-font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.sec-row .desc { color: var(--ink-2); font-size: 16px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: var(--xv-font-mono); font-size: 12px; letter-spacing: .06em;
  font-weight: 500; padding: 7px 14px; border-radius: var(--xv-r-pill);
}
.badge svg { width: 14px; height: 14px; }
.badge-ok { background: var(--accent); color: var(--xv-green-800); }
.badge-info { background: transparent; border: 1px solid var(--hair); color: var(--ink-2); }

/* ---------- architecture ---------- */
.boundary {
  position: relative; border: 1.5px dashed rgba(39,63,59,0.28);
  border-radius: var(--xv-r-xl); padding: 56px 34px 38px;
  background:
    radial-gradient(900px 320px at 50% 120%, var(--accent-soft), transparent 70%);
}
.boundary-tag {
  position: absolute; top: -13px; left: 28px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--page); padding: 4px 14px;
  font-family: var(--xv-font-mono); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink); font-weight: 500;
}
.boundary-tag svg { width: 14px; height: 14px; color: var(--ink); }
.flow { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.node {
  flex: 1 1 0; min-width: 150px; background: var(--surface);
  border: 1px solid var(--hair); border-radius: var(--xv-r-md);
  padding: 18px 18px; text-align: center;
}
.node .nlabel { font-family: var(--xv-font-display); font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; line-height: 1.15; }
.node .ntech { font-family: var(--xv-font-mono); font-size: 11px; color: var(--ink-3); margin-top: 7px; letter-spacing: .02em; }
.arrow { display: grid; place-items: center; padding: 0 6px; color: var(--ink-3); flex: none; }
.arrow svg { width: 22px; height: 22px; }
.boundary-note {
  margin-top: 26px; text-align: center; font-size: 14px; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.boundary-note .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); }

/* architecture table */
.atable { width: 100%; border-collapse: collapse; margin-top: 40px; }
.atable thead th {
  text-align: left; font-family: var(--xv-font-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
  padding: 0 16px 14px; border-bottom: 1px solid var(--hair);
}
.atable thead th:last-child { text-align: right; }
.atable tbody td { padding: 18px 16px; border-bottom: 1px solid var(--hair); font-size: 16px; vertical-align: middle; }
.atable tbody td:first-child { font-family: var(--xv-font-display); font-weight: 700; letter-spacing: -0.01em; }
.atable tbody td.tech { font-family: var(--xv-font-mono); font-size: 13.5px; color: var(--ink-2); }
.atable tbody td.region { text-align: right; }
.rpill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--xv-font-mono); font-size: 12px; letter-spacing: .05em;
  padding: 6px 13px; border-radius: var(--xv-r-pill);
  border: 1px solid var(--hair); color: var(--ink);
}
.rpill .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-strong); }
.rpill.na { color: var(--ink-3); }
.rpill.na .pip { background: var(--ink-3); }

/* ---------- closing cta ---------- */
.closing { padding: 0 0 var(--sec-pad); }
.closing-card {
  position: relative; overflow: hidden;
  background: var(--xv-green-800); color: var(--page);
  border-radius: var(--xv-r-xl); padding: 76px 64px;
}
.closing-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(540px 360px at 92% 8%, rgba(148,244,175,0.22), transparent 60%),
    radial-gradient(440px 320px at 4% 100%, rgba(172,173,237,0.18), transparent 60%);
}
.closing-card .inner { position: relative; max-width: 60ch; }
.closing-card .eyebrow { color: rgba(244,244,244,0.62); }
.closing-card .eyebrow::before { background: var(--accent-strong); }
.closing-card h2 {
  margin: 20px 0 0; font-family: var(--xv-font-display); font-weight: 700;
  font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.025em; line-height: 1.04; color: var(--page);
}
.closing-card p { margin: 22px 0 0; color: rgba(244,244,244,0.78); font-size: 19px; max-width: 52ch; }
.closing-card .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.btn-mint { background: var(--accent); color: var(--xv-green-800); padding: 16px 30px; font-size: 16.5px; }
.btn-mint:hover { background: var(--accent-strong); }
.btn-ondark { background: transparent; border-color: rgba(244,244,244,0.3); color: var(--page); padding: 16px 30px; font-size: 16.5px; }
.btn-ondark:hover { border-color: var(--page); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--hair); }
.foot-inner { padding: 44px 0 56px; display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.foot .brand img { height: 34px; }
.foot .meta { margin-left: auto; text-align: right; color: var(--ink-3); font-size: 13.5px; line-height: 1.7; }
.foot .meta .mono { color: var(--ink-2); }
.confidential {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--xv-font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--hair); border-radius: var(--xv-r-pill); padding: 5px 12px;
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  :root { --sec-pad: 84px; }
  .nav a { display: none; }
  .g-2, .g-3, .callouts { grid-template-columns: 1fr; }
  .sec-row { grid-template-columns: 1fr; gap: 10px; }
  .sec-row .badge { justify-self: start; }
  .node { flex-basis: 100%; }
  .arrow { transform: rotate(90deg); padding: 8px 0; }
  .closing-card { padding: 52px 30px; }
}

/* ---------- mobile native ---------- */
@media (max-width: 640px) {
  :root { --gutter: 18px; --sec-pad: 64px; }

  body { font-size: 17px; }
  .wrap { padding: 0 var(--gutter); }

  /* top bar: logo + single action, comfortably tappable */
  .topbar-inner { height: 64px; gap: 14px; }
  .brand img { height: 34px; }
  .btn-primary { padding: 11px 16px; font-size: 13.5px; }

  /* hero */
  .hero-inner { padding: 48px 0 44px; }
  .hero h1 { font-size: clamp(32px, 8vw, 44px); margin-top: 20px; }
  .hero p.lede { margin-top: 22px; font-size: 17px; }
  .hero-cta { margin-top: 30px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .chips { gap: 8px; margin-top: 34px; }
  .chip { font-size: 13px; padding: 9px 14px 9px 12px; }
  .btn-lg { padding: 16px 24px; min-height: 52px; }

  /* residency strip stacks */
  .residency-inner { gap: 18px; padding: 22px 0; }
  .residency-control { gap: 12px; }
  .segmented { width: 100%; }
  .seg { flex: 1; padding: 9px 8px; font-size: 13px; }
  .names { gap: 12px 24px; }
  .partner { font-size: 16px; }

  /* sections + cards */
  .sec-head { margin-bottom: 36px; }
  .sec-head h2 { font-size: clamp(26px, 7vw, 34px); }
  .sec-head p { font-size: 17px; }
  .card { padding: 28px 24px; }
  .card h3 { font-size: 22px; }
  .callout { padding: 22px 22px; }

  /* architecture diagram */
  .boundary { padding: 48px 18px 30px; }
  .boundary-tag { left: 18px; }

  /* architecture table → stacked rows */
  .atable { margin-top: 30px; }
  .atable thead { display: none; }
  .atable tbody td { display: block; border: none; padding: 2px 0; }
  .atable tbody tr { display: block; padding: 18px 0; border-bottom: 1px solid var(--hair); }
  .atable tbody td:first-child { font-size: 18px; }
  .atable tbody td.region { text-align: left; margin-top: 10px; }
  .atable tbody td.tech { margin-top: 4px; }

  /* footer */
  .foot-inner { flex-direction: column; gap: 22px; padding: 36px 0 calc(40px + env(safe-area-inset-bottom)); }
  .foot .meta { margin-left: 0; text-align: left; }
}

@media (max-width: 380px) {
  .nav { display: none; }
  .btn-primary { padding: 10px 14px; }
  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
