:root{
  --bg: #070a10;
  --panel: #0c1220;
  --panel2: #0f1830;
  --stroke: #22304d;
  --stroke2: #2a3a5c;
  --text: #e9f0ff;
  --muted: #b9c7e6;
  --muted2: #95a6cc;
  --good: #58e3b5;
  --warn: #ffbf7a;
  --bad: #ff6aa0;
  --accent: #6aa0ff;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 16px;
  --radius2: 22px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --max: 1120px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(106,160,255,.16), transparent 55%),
    radial-gradient(900px 500px at 85% 0%, rgba(88,227,181,.10), transparent 55%),
    radial-gradient(800px 500px at 50% 110%, rgba(255,191,122,.08), transparent 55%),
    var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }

.wrap{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,10,16,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(34,48,77,.6);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}
.logo-dark{ display:none; }
.site-logo{
  display:block;
  max-height:48px;
  width:auto;
}
.hero-logo-wrap{
  display:flex;
  justify-content:flex-start;
  margin-bottom:10px;
}
.hero-logo{
  display:block;
  width:min(100%, 480px);
  height:auto;
}
@media (prefers-color-scheme: dark){
  .logo-light{ display:none; }
  .logo-dark{ display:block; }
}

.nav{
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.nav a{
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
}
.nav a.active{
  color: var(--text);
  background: rgba(15,24,48,.65);
  border: 1px solid rgba(34,48,77,.65);
}
.pill{
  border: 1px solid rgba(106,160,255,.45);
  background: rgba(106,160,255,.10);
  color: var(--text) !important;
}

.hero{
  padding: 28px 0 10px;
}
.hero__grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}
.hero__copy h1{
  font-size: clamp(28px, 4vw, 44px);
  margin: 10px 0 10px;
  letter-spacing: -0.02em;
}
.lead{
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 16px;
}

.hero__notes{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.note{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,48,77,.65);
  background: rgba(12,18,32,.55);
}
.note__k{ color: var(--muted2); font-size: 12px; }
.note__v{ margin-top: 6px; font-size: 14px; }
.hero-metrics{ grid-template-columns: 1fr 1fr; }

.section{
  padding: 18px 0;
}
.section h2{
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.muted{ color: var(--muted); line-height: 1.6; }

.pagehead{
  padding: 22px 0 6px;
}
.pagehead h1{
  margin: 8px 0 6px;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.card{
  border: 1px solid rgba(34,48,77,.75);
  background: linear-gradient(180deg, rgba(12,18,32,.82), rgba(12,18,32,.62));
  border-radius: var(--radius2);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card--link{
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.card--link:hover{
  transform: translateY(-2px);
  border-color: rgba(106,160,255,.55);
  background: linear-gradient(180deg, rgba(15,24,48,.85), rgba(12,18,32,.60));
  text-decoration:none;
}
.card__title{
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.subhead{
  font-weight: 650;
  margin: 8px 0 6px;
  color: var(--text);
}

.list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}
.list li{ margin: 4px 0; }

.divider{
  height: 1px;
  background: rgba(34,48,77,.7);
  margin: 14px 0;
}

.cta-row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  margin-top: 10px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(106,160,255,.6);
  background: rgba(106,160,255,.14);
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(106,160,255,.18);
  text-decoration:none;
}
.btn:active{ transform: translateY(0px); }

.btn--ghost{
  border: 1px solid rgba(34,48,77,.85);
  background: rgba(15,24,48,.45);
  color: var(--muted);
}
.btn--ghost:hover{
  border-color: rgba(106,160,255,.45);
  color: var(--text);
}

.tagrow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.tag{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(34,48,77,.75);
  background: rgba(15,24,48,.45);
  padding: 6px 10px;
  border-radius: 999px;
}

.table{
  display:grid;
  grid-template-columns: 1fr;
  border: 1px solid rgba(34,48,77,.75);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(7,10,16,.25);
}
.tr{
  display:grid;
  grid-template-columns: 1.2fr .8fr 1.2fr;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(34,48,77,.55);
  align-items: center;
  color: var(--muted);
}
.tr:first-child{ border-top: none; }
.th{
  background: rgba(15,24,48,.65);
  color: var(--text);
  font-weight: 650;
}
.mono{ font-family: var(--mono); letter-spacing: .01em; }

.codeblock{
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,48,77,.75);
  background: rgba(0,0,0,.20);
  color: #dbe6ff;
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}

.kpi-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi-grid--big{ grid-template-columns: 1fr 1fr; }
.kpi{
  border: 1px solid rgba(34,48,77,.65);
  background: rgba(15,24,48,.45);
  border-radius: 16px;
  padding: 12px;
}
.kpi__label{ color: var(--muted2); font-size: 12px; }
.kpi__value{ margin-top: 8px; font-size: 18px; font-weight: 750; }

.soft{
  margin-top: 10px;
  color: var(--muted2);
  font-size: 13px;
  line-height: 1.55;
}

.form{
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.form__row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
label{
  display:flex;
  flex-direction:column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  min-width: 240px;
}
label.grow{ flex: 1; min-width: 260px; }
input, select, textarea{
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(34,48,77,.8);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(106,160,255,.7);
  box-shadow: 0 0 0 3px rgba(106,160,255,.12);
}
textarea{ resize: vertical; }

.details{
  border: 1px solid rgba(34,48,77,.75);
  border-radius: 16px;
  padding: 12px;
  background: rgba(15,24,48,.30);
}
.details summary{
  cursor:pointer;
  color: var(--text);
  font-weight: 650;
}
.details > *:not(summary){
  margin-top: 10px;
}

.ok{ color: var(--good); font-weight: 650; }
.warn{ color: var(--warn); font-weight: 650; }

.resultline{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed rgba(34,48,77,.6);
}
.resultline:first-of-type{ border-top: none; }
.resultline__k{ color: var(--muted); }
.resultline__v{ color: var(--text); font-weight: 750; }

.footer{
  margin-top: 26px;
  border-top: 1px solid rgba(34,48,77,.6);
  background: rgba(7,10,16,.45);
}
.footer__inner{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  padding: 16px 0;
}
.footer__brand{ font-weight: 750; }
.footer__right{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content:flex-end;
  color: var(--muted);
}

@media (max-width: 920px){
  .hero__grid{ grid-template-columns: 1fr; }
  .hero__notes{ grid-template-columns: 1fr; }
  .site-logo{ max-height:36px; }
  .hero-logo-wrap{ justify-content:center; }
  .grid3{ grid-template-columns: 1fr; }
  .grid2{ grid-template-columns: 1fr; }
  .topbar__inner{ flex-direction: column; align-items:flex-start; }
  .nav{ justify-content:flex-start; }
  .tr{ grid-template-columns: 1fr; }
  label{ min-width: 100%; }
}

.diagram-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
}

.dataflow-diagram {
  width: 100%;
  height: auto;
}

.df-box {
  fill: #111827;
  stroke: #374151;
  stroke-width: 2;
}

.df-box-dashed {
  fill: #0f172a;
  stroke: #6b7280;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.df-title {
  fill: #e5e7eb;
  font-size: 16px;
  font-weight: 600;
}

.df-sub {
  fill: #9ca3af;
  font-size: 13px;
}

.df-line {
  stroke: #6b7280;
  stroke-width: 2;
}

.df-arrow {
  fill: #6b7280;
}

.table--classification .tr--classification {
  grid-template-columns: 1fr 1.8fr 1fr 1fr;
}

.whitepaper h2 {
  margin-top: 2.5rem;
  font-size: 1.4rem;
}

.wp-section {
  margin-top: 2rem;
}

.wp-header {
  margin-bottom: 2rem;
}

.architecture-flow {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #374151;
  background: #0f172a;
  font-family: monospace;
  text-align: center;
}

.whitepaper h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.whitepaper h4 {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--muted);
}

.table--mc .tr--mc {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

/* ===========================
   WHITEPAPER TYPOGRAPHY MODE
   =========================== */

.whitepaper {
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.65;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 16px;
  color: #e5e7eb;
}

/* Section spacing tighter, more document-like */
.wp-section {
  margin-top: 2.2rem;
}

/* Headings: structured hierarchy */
.whitepaper h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.whitepaper h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #374151;
}

.whitepaper h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.8rem;
}

.whitepaper h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Muted explanatory text */
.whitepaper .muted {
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Tables: more formal */
.whitepaper .table {
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.whitepaper .tr {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-bottom: 1px solid #2d3748;
  padding: 0.6rem 0;
}

.whitepaper .th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

/* Code blocks: technical appendix feel */
.whitepaper .codeblock {
  background: #0b1220;
  border: 1px solid #2d3748;
  padding: 1rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin-top: 0.8rem;
}

/* Lists: formal spacing */
.whitepaper .list {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
}

.whitepaper .list li {
  margin-bottom: 0.4rem;
}

/* Architecture block styling */
.whitepaper .architecture-flow {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #2d3748;
  background: #0b1220;
  font-family: monospace;
  text-align: center;
  font-size: 0.9rem;
}

/* Remove excessive marketing spacing */
.pagehead,
.section {
  margin-top: 1rem;
}

/* ===========================
   FORMAL CITATION SYSTEM
   =========================== */

.whitepaper sup.ref {
  font-size: 0.75rem;
  vertical-align: super;
  margin-left: 2px;
  color: #9ca3af;
}

.whitepaper .references {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #374151;
}

.whitepaper .references h2 {
  border-bottom: none;
  margin-bottom: 1rem;
}

.whitepaper .ref-item {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.whitepaper .ref-index {
  font-weight: 600;
  margin-right: 6px;
}

.whitepaper .footnote {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 1rem;
}

/* ===========================
   PRINT / PDF (A4) STYLES
   =========================== */

@media print {
  /* Page setup */
  @page {
    size: A4;
    margin: 18mm 16mm 18mm 16mm;
  }

  /* Remove web chrome */
  .topbar,
  .nav,
  .footer,
  .cta-row,
  .pill {
    display: none !important;
  }

  /* Neutral print background */
  html, body {
    background: #ffffff !important;
    color: #111827 !important;
  }

  /* Whitepaper typography for print */
  .whitepaper {
    max-width: none !important;
    margin: 0 !important;
    font-family: "Georgia", "Times New Roman", serif !important;
    font-size: 11pt !important;
    line-height: 1.45 !important;
    color: #111827 !important;
  }

  .whitepaper h1 { font-size: 18pt !important; margin: 0 0 6pt 0 !important; }
  .whitepaper h2 {
    font-size: 13pt !important;
    margin: 16pt 0 6pt 0 !important;
    padding-bottom: 4pt !important;
    border-bottom: 1pt solid #9ca3af !important;
  }
  .whitepaper h3 { font-size: 11pt !important; margin: 12pt 0 4pt 0 !important; }
  .whitepaper h4 { font-size: 10pt !important; margin: 10pt 0 4pt 0 !important; }

  .whitepaper p, .whitepaper li {
    color: #111827 !important;
  }
  .whitepaper .muted, .whitepaper .footnote {
    color: #374151 !important;
  }

  /* Tables: print-friendly */
  .whitepaper .table {
    box-shadow: none !important;
    border: 1pt solid #9ca3af !important;
    background: transparent !important;
  }

  .whitepaper .tr {
    border-top: none !important;
    border-bottom: 1pt solid #e5e7eb !important;
    color: #111827 !important;
    padding: 6pt 8pt !important;
  }

  .whitepaper .th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border-bottom: 1pt solid #9ca3af !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    font-size: 8.5pt !important;
  }

  /* Code blocks: keep readable */
  .whitepaper .codeblock {
    box-shadow: none !important;
    background: #f9fafb !important;
    border: 1pt solid #9ca3af !important;
    color: #111827 !important;
    font-size: 9pt !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Diagrams: keep together */
  .diagram-wrap,
  .dataflow-diagram,
  svg {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Ensure section blocks don’t split awkwardly */
  .wp-section,
  .references,
  .card {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* But allow long appendices to paginate naturally */
  .wp-section.allow-break {
    page-break-inside: auto;
    break-inside: auto;
  }

  /* Page breaks you can manually apply in HTML with class="pagebreak" */
  .pagebreak {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* Citation markers */
  .whitepaper sup.ref {
    color: #111827 !important;
  }

  /* Show URLs after links in print */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #374151;
  }

  /* Avoid underlines everywhere; keep clean */
  a {
    text-decoration: none !important;
    color: #111827 !important;
  }
}

/* ===========================
   PRINT HEADER / FOOTER
   =========================== */

@media print {

  /* Enable page counters */
  body {
    counter-reset: page;
  }

  /* Fixed header */
  .print-header {
    position: fixed;
    top: -12mm;
    left: 0;
    right: 0;
    height: 10mm;
    font-size: 9pt;
    color: #374151;
    display: flex;
    justify-content: space-between;
  }

  /* Fixed footer */
  .print-footer {
    position: fixed;
    bottom: -14mm;
    left: 0;
    right: 0;
    height: 12mm;
    font-size: 9pt;
    color: #374151;
    display: flex;
    justify-content: space-between;
  }

  /* Page number counter */
  .page-number:after {
    content: "Page " counter(page);
  }

}

/* ===========================
   PRINT COVER PAGE
   =========================== */

.print-cover {
  display: none;
}

@media print {

  .print-cover {
    display: block;
    page-break-after: always;
    height: 100vh;
  }

  .cover-inner {
    margin-top: 120mm;
    text-align: center;
  }

  .print-cover h1 {
    font-size: 26pt;
    margin-bottom: 10pt;
    font-weight: 600;
  }

  .print-cover h2 {
    font-size: 16pt;
    font-weight: 500;
    margin-bottom: 30pt;
  }

  .cover-meta {
    font-size: 11pt;
    margin-top: 20pt;
    line-height: 1.8;
  }

  .cover-divider {
    margin: 40pt auto;
    width: 60%;
    border-bottom: 1pt solid #9ca3af;
  }

  .cover-approval {
    font-size: 10pt;
    line-height: 1.8;
  }

}

.print-header,
.print-footer {
  display: none;
}

@media print {
  .print-header,
  .print-footer {
    display: flex;
  }
}

@media print {
  .print-legal {
    position: fixed;
    bottom: -20mm;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #6b7280;
  }
}

/* ===========================
   EXECUTIVE SUMMARY PAGE
   =========================== */

.print-executive {
  display: none;
}

@media print {

  .print-executive {
    display: block;
    page-break-after: always;
    height: 100vh;
  }

  .exec-inner {
    margin-top: 35mm;
    max-width: 150mm;
    margin-left: auto;
    margin-right: auto;
    font-family: "Georgia", "Times New Roman", serif;
  }

  .print-executive h1 {
    font-size: 18pt;
    margin-bottom: 12pt;
  }

  .print-executive h2 {
    font-size: 12pt;
    margin-top: 18pt;
    border-bottom: 1pt solid #9ca3af;
    padding-bottom: 4pt;
  }

  .print-executive ul {
    margin-top: 8pt;
    padding-left: 18pt;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .exec-conclusion {
    margin-top: 20pt;
    font-weight: 600;
    font-size: 11pt;
  }

}


.hero-sub { margin-bottom: 0.6rem; }
.hero-support { color: var(--muted); margin: 0 0 1rem; line-height: 1.6; }

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.hero-platform {
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 1.1rem;
}
