:root {
  --paper: #fbfcfd;
  --paper-2: #ffffff;
  --paper-3: #f1f5f9;
  --ink: #16202c;
  --ink-soft: #5a6b7e;
  --navy: #1e3a5f;
  --navy-deep: #0f2238;
  --line: #e2e8f0;
  --line-2: #cfd9e6;
  --grid: rgba(30, 58, 95, 0.045);
  --grid-bold: rgba(30, 58, 95, 0.08);
  --green: #16a34a;
  --green-dark: #0f7a37;
  --green-soft: rgba(22, 163, 74, 0.09);
  --radius: 16px;
  --radius-sm: 11px;
  --header-h: 70px;
  --shadow-sm: 0 4px 16px rgba(15, 34, 56, 0.05);
  --shadow: 0 30px 70px rgba(15, 34, 56, 0.1);
  --font: "Manrope", system-ui, sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 130px 130px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1160px, calc(100% - 2.5rem)); margin-inline: auto; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; }

/* Tag */
.tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.5rem; padding: 0.45rem 0.95rem;
  border: 1.5px solid rgba(22, 163, 74, 0.4); border-radius: 999px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--green-dark); background: var(--green-soft);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* Section index marker */
.index {
  display: block; margin-bottom: 0.9rem; font-family: var(--mono);
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green-dark);
}
.index.light { color: #6ee7a8; }

/* Headings */
h1, h2, h3 { line-height: 1.1; margin: 0 0 1.1rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 800; }
h1 em { font-style: normal; color: var(--green-dark); }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }
.section-lead { max-width: 60ch; color: var(--ink-soft); margin: 0; font-size: 1.04rem; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(251, 252, 253, 0.82); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-mark { border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); transition: color 0.2s; }
.site-nav a:hover { color: var(--green-dark); }
.nav-cta { padding: 0.55rem 1.1rem; border-radius: 999px; background: var(--green); color: #fff !important; box-shadow: var(--shadow-sm); }
.nav-cta:hover { background: var(--green-dark); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 0.5rem; background: none; border: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 1px; transition: 0.25s; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9rem 1.7rem; border-radius: 11px; font-size: 0.92rem; font-weight: 700;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.18s, background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 12px 26px rgba(22, 163, 74, 0.28); }
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 16px 32px rgba(22, 163, 74, 0.34); }
.btn-ghost { border-color: var(--line-2); color: var(--navy); background: var(--paper-2); }
.btn-ghost:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy-deep); }
.btn-light:hover { background: #eafaf0; }

/* Hero */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.hero-lead { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 46ch; margin: 0 0 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2.8rem; }
.hero-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.hero-metrics > div { padding: 1.4rem 1.1rem 0; border-right: 1px solid var(--line); }
.hero-metrics > div:last-child { border-right: 0; padding-right: 0; }
.hero-metrics > div:first-child { padding-left: 0; }
.hero-metrics dt { font-size: 1.45rem; font-weight: 800; color: var(--green-dark); letter-spacing: -0.02em; line-height: 1.1; }
.hero-metrics dd { margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--ink-soft); line-height: 1.35; }

.hero-figure {
  position: relative; margin: 0; padding: 0.8rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-figure img { border-radius: 9px; width: 100%; }
.hero-figure figcaption, .matrix-figure figcaption {
  position: absolute; bottom: 1.3rem; left: 1.4rem; font-family: var(--mono);
  font-size: 0.68rem; letter-spacing: 0.05em; color: var(--navy);
  background: rgba(255,255,255,0.85); padding: 0.25rem 0.55rem; border-radius: 6px; border: 1px solid var(--line);
}

/* Corner ticks */
.corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--green); z-index: 2; }
.corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* Ruler divider */
.ruler { height: 26px; border-top: 1px solid var(--line-2); background-image: repeating-linear-gradient(90deg, var(--line-2) 0, var(--line-2) 1px, transparent 1px, transparent 13px); background-size: 100% 9px; background-repeat: repeat-x; opacity: 0.7; }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-paper {
  background-color: var(--paper-2);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  border-block: 1px solid var(--line);
}
.section-head { margin-bottom: 3rem; max-width: 780px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .section-lead { margin-inline: auto; }

/* Card grids */
.card-grid { display: grid; gap: 1.3rem; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.card-grid.one { grid-template-columns: 1fr; }

/* Frame card */
.frame-card {
  position: relative; padding: 1.8rem; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.frame-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.frame-no { display: block; margin-bottom: 0.9rem; font-family: var(--mono); font-size: 0.85rem; color: var(--green-dark); }
.frame-label { display: block; margin-bottom: 0.7rem; font-weight: 700; font-size: 0.98rem; color: var(--green-dark); }
.frame-card h3 { margin-bottom: 0.6rem; }
.frame-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.frame-card p:not(:last-child) { margin-bottom: 0.6rem; }

/* Banner */
.banner {
  margin: 2.5rem 0 0; padding: 1.15rem 1.6rem; text-align: center;
  background: linear-gradient(100deg, var(--green), var(--green-dark)); color: #fff;
  border-radius: 12px; font-weight: 700; font-size: 1.08rem; box-shadow: 0 14px 30px rgba(22,163,74,0.22);
}
.banner.inline { margin-top: 1.5rem; text-align: left; font-size: 0.95rem; font-weight: 600; box-shadow: none; }

/* Blueprint figure */
.blueprint-figure { position: relative; margin: 0; padding: 0.8rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.blueprint-figure img { border-radius: 9px; width: 100%; }
.section-dark .blueprint-figure { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }

/* Matrix */
.matrix-layout { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 2.5rem; align-items: center; margin-bottom: 2.5rem; }
.matrix-figure { position: relative; margin: 0; padding: 0.8rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.matrix-figure img { border-radius: 9px; }
.matrix-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.matrix-cards article { position: relative; padding: 1.3rem 1.3rem 1.3rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); transition: transform 0.2s; }
.matrix-cards article:hover { transform: translateY(-3px); }
.matrix-cards .dot { position: absolute; top: 1.55rem; left: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.matrix-cards h3 { color: var(--navy); font-size: 1rem; margin-bottom: 0.4rem; }
.matrix-cards p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

.callout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.callout { padding: 1.5rem 1.6rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.callout strong { display: block; margin-bottom: 0.35rem; color: var(--ink); }
.callout span { color: var(--ink-soft); font-size: 0.92rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; counter-reset: s; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); transition: transform 0.2s, box-shadow 0.2s; }
.steps li:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.steps li span { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; font-weight: 800; font-size: 1.1rem; background: var(--green-soft); color: var(--green-dark); border: 1.5px solid rgba(22,163,74,0.35); }
.steps h3 { margin-bottom: 0.3rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

/* Nexus (dark) */
.section-dark { background: radial-gradient(120% 90% at 50% -10%, #1c3a5e 0%, var(--navy-deep) 60%); color: #e8f0f8; background-color: var(--navy-deep); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .section-lead { color: #a9c0d6; }
.nexus-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.5rem; }
.nexus-flow article { padding: 1.5rem; border: 1px solid rgba(255,255,255,0.13); border-radius: var(--radius); background: rgba(255,255,255,0.04); transition: transform 0.25s, background 0.25s, border-color 0.25s; }
.nexus-flow article:hover { transform: translateY(-4px); background: rgba(255,255,255,0.07); border-color: rgba(110,231,168,0.4); }
.step-no { display: inline-block; margin-bottom: 0.7rem; font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: #6ee7a8; }
.nexus-flow h3 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.nexus-flow p { margin: 0; font-size: 0.88rem; color: #a9c0d6; }
.nexus-cta { margin: 2.5rem 0 0; text-align: center; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 660px; }
th, td { padding: 1.15rem 1.3rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--paper-3); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
th.col-gs { color: var(--green-dark); }
td.col-gs { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
td.neg { color: #c0392b; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--paper); }

/* Markets */
.markets-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.5rem; align-items: center; }
.markets-figure { margin: 0; padding: 0.8rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.markets-figure img { border-radius: 9px; }
.markets-cards { display: grid; gap: 1.1rem; }
.market-sum { font-size: 1.6rem; font-weight: 800; color: var(--green-dark); margin: 0.25rem 0 0.6rem !important; letter-spacing: -0.02em; }

/* Formula */
.formula { font-family: var(--mono); font-size: clamp(1.5rem, 4vw, 2.3rem); font-weight: 500; color: var(--navy); padding: 1.4rem 1.6rem; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; margin-bottom: 1.6rem; box-shadow: var(--shadow-sm); }
.formula sub { font-size: 0.6em; } .formula sup { font-size: 0.6em; }
.def-list { list-style: none; margin: 0; padding: 0; }
.def-list li { padding: 0.65rem 0 0.65rem 1.5rem; position: relative; color: var(--ink-soft); border-bottom: 1px dashed var(--line); }
.def-list li::before { content: "→"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.def-list b { color: var(--ink); }
.scale-fig img { max-height: 460px; width: auto; margin-inline: auto; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.team-grid article { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); border-top: 3px solid var(--green); transition: transform 0.2s, box-shadow 0.2s; }
.team-grid article:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.team-grid strong { display: block; margin-bottom: 0.3rem; font-size: 1.05rem; }
.team-grid span { font-size: 0.88rem; color: var(--ink-soft); }

/* CTA band */
.cta-band { padding: clamp(3.5rem, 8vw, 5.5rem) 0; text-align: center; background: radial-gradient(120% 120% at 50% 0%, #1c3a5e, var(--navy-deep)); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #a9c0d6; max-width: 50ch; margin: 0 auto 2rem; font-size: 1.05rem; }

/* Footer */
.site-footer { padding: 3rem 0 2rem; border-top: 1px solid var(--line); background: var(--paper-2); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 0.9rem; }
.footer-brand img { border-radius: 10px; }
.footer-brand p { margin: 0; font-weight: 700; line-height: 1.4; }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--ink-soft); font-size: 0.9rem; }
.footer-links a:hover { color: var(--green-dark); }
.copyright { text-align: center; margin: 2.5rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .split, .matrix-layout, .markets-layout,
  .card-grid.three, .card-grid.two, .matrix-cards,
  .callout-row, .nexus-flow, .team-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .nexus-flow { grid-template-columns: 1fr 1fr; }
  .markets-figure { max-width: 480px; margin-inline: auto; }
  .scale-fig img { max-height: 360px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    padding: 1rem 1.25rem 1.25rem; background: rgba(251,252,253,0.98); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); transform: translateY(-130%); opacity: 0; pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease; box-shadow: var(--shadow);
  }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav a { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { text-align: center; margin-top: 0.6rem; border-bottom: 0; }
  .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); }
  .hero-metrics { grid-template-columns: 1fr 1fr; }
  .hero-metrics > div { border-bottom: 1px solid var(--line); padding: 1.1rem 1rem; }
  .hero-metrics > div:nth-child(2) { border-right: 0; padding-right: 0; }
  .hero-metrics > div:nth-child(odd) { padding-left: 0; }
  .nexus-flow { grid-template-columns: 1fr; }
  .brand-text { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .frame-card:hover, .team-grid article:hover, .nexus-flow article:hover { transform: none; }
}
