/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("assets/fonts/source-serif-4-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #FFFFFF;
  --header-bg: rgba(255, 255, 255, 0.86);
  --surface: #F4F7FB;
  --card: #FFFFFF;
  --ink: #0A2540;
  --muted: #4E5D78;
  --border: #E1E7F0;
  --border-strong: #C3CEDD;
  --accent: #1F6FEB;
  --accent-hover: #1A5FCC;
  --accent-text: #1A5FCC;
  --accent-soft: #E6F0FE;
  --on-accent: #FFFFFF;
  --hi: #3CC8F4;
  --line: #D3DCE8;
  --line-strong: #B5C3D6;
  --shadow: rgba(10, 37, 64, 0.18);
  --band: #0A2540;
  --band-ink: #F3F6FB;
  --band-muted: #B4C1D6;
  --band-card: #0F2E50;
  --band-border: #1D3D63;

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
  --header-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06152A;
    --header-bg: rgba(6, 21, 42, 0.86);
    --surface: #0B1D38;
    --card: #0D2140;
    --ink: #E8EEF7;
    --muted: #9AA9C2;
    --border: #1A3052;
    --border-strong: #2B4570;
    --accent: #5B9BFF;
    --accent-hover: #7DB0FF;
    --accent-text: #7DB0FF;
    --accent-soft: #13305C;
    --on-accent: #06152A;
    --line: #1C3458;
    --line-strong: #2E4C78;
    --shadow: rgba(0, 0, 0, 0.5);
    --band: #0D2140;
    --band-ink: #E8EEF7;
    --band-muted: #9AA9C2;
    --band-card: #122A4E;
    --band-border: #1F3A64;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #06152A;
  --header-bg: rgba(6, 21, 42, 0.86);
  --surface: #0B1D38;
  --card: #0D2140;
  --ink: #E8EEF7;
  --muted: #9AA9C2;
  --border: #1A3052;
  --border-strong: #2B4570;
  --accent: #5B9BFF;
  --accent-hover: #7DB0FF;
  --accent-text: #7DB0FF;
  --accent-soft: #13305C;
  --on-accent: #06152A;
  --line: #1C3458;
  --line-strong: #2E4C78;
  --shadow: rgba(0, 0, 0, 0.5);
  --band: #0D2140;
  --band-ink: #E8EEF7;
  --band-muted: #9AA9C2;
  --band-card: #122A4E;
  --band-border: #1F3A64;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h2 { font-size: clamp(32px, 4vw, 44px); line-height: 1.12; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.eyebrow {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 52px; padding: 0 24px; border-radius: var(--radius); font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { border-color: var(--border-strong); color: var(--ink); }
.btn-secondary:hover { background: var(--surface); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  min-height: 44px; font-weight: 500; color: var(--accent-text); text-decoration: none;
}
.text-link svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms ease; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover svg { transform: translateX(2px); }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tag {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}

/* ---------- Logo mark ---------- */
.mk-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.mk-node { fill: var(--ink); }
.mk-hi { fill: var(--hi); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 21px; color: var(--ink); }
.brand-name-sm { font-size: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav-cta { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.icon-close, .icon-sun { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-inner { display: flex; align-items: center; gap: 48px; padding-top: 96px; padding-bottom: 96px; }
.hero-copy { position: relative; z-index: 1; flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: clamp(42px, 5.6vw, 72px); line-height: 1.05; }
.pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hi); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.credentials {
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}
.credentials li { display: flex; align-items: center; gap: 8px; }
.credentials svg { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero-art { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }
.network { width: 100%; max-width: 500px; height: auto; animation: drift 14s ease-in-out infinite; }
.net-line line { stroke: var(--line); stroke-width: 1.2; }
.net-path line { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.net-node circle { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.5; }
.net-halo { fill: var(--accent-soft); }
.net-core { fill: var(--accent); }
.net-hi { fill: var(--hi); }
.net-ink { fill: var(--ink); }

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -8px); }
}

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-tight-top { padding-top: 0; }
.section-surface { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; display: flex; flex-direction: column; }
.section-head h2 + .lead { margin-top: 16px; font-size: 18px; }
.stack-md { display: flex; flex-direction: column; gap: 40px; }
.stack-lg { display: flex; flex-direction: column; gap: 48px; }

.card { padding: 22px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }

/* About */
.split { display: flex; flex-wrap: wrap; gap: 32px 80px; }
.split-head { flex: 1 1 300px; min-width: 0; }
.split-body { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.about-lead { font-size: 21px; line-height: 1.6; }
.split-body .muted { font-size: 17px; }

/* Ripli */
.product { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.product-copy { flex: 1 1 500px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.product-copy .eyebrow { margin-bottom: -12px; }
.product-title { display: flex; align-items: center; gap: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.features .card { display: flex; flex-direction: column; gap: 10px; }
.features svg { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.features p { font-size: 15px; color: var(--muted); }

.logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--border-strong); color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.logo-placeholder-sq { width: 52px; height: 52px; border-radius: 14px; }
.logo-placeholder-wide { width: 120px; height: 44px; border-radius: 8px; }

.product-art { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }
.mock {
  width: 100%; max-width: 400px; padding: 20px;
  border-radius: 24px; background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 24px 48px -24px var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.mock-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.mock-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); }
.mock-id { flex: 1; display: flex; flex-direction: column; line-height: 1.4; }
.mock-id strong { font-size: 14px; }
.mock-id small { font-size: 12px; color: var(--muted); }
.mock .tag { font-size: 12px; padding: 4px 10px; }
.bubble { max-width: 80%; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.bubble-in { align-self: flex-start; border-radius: 16px 16px 16px 4px; background: var(--surface); }
.bubble-out { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--accent); color: var(--on-accent); }
.mock-meta { align-self: flex-end; margin-top: -6px; font-size: 11px; color: var(--muted); }
.mock-chart { margin-top: 6px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.mock-chart-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; }
.bars i { flex: 1; border-radius: 4px; background: var(--line-strong); }
.bars .bar-accent { background: var(--accent); }
.bars .bar-hi { background: var(--hi); }

/* Trust band */
.section-band { background: var(--band); color: var(--band-ink); }
.section-band h2, .section-band h3 { color: var(--band-ink); }
.section-band .eyebrow { color: var(--hi); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.band-card {
  padding: 28px; border-radius: var(--radius-lg);
  background: var(--band-card); border: 1px solid var(--band-border);
  display: flex; flex-direction: column; gap: 12px;
}
.band-card h3 { font-size: 19px; }
.band-card p { font-size: 15px; color: var(--band-muted); }
.band-card svg { fill: none; stroke: var(--hi); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.policy-links {
  display: flex; flex-wrap: wrap; gap: 0 28px;
  padding-top: 24px; border-top: 1px solid var(--band-border);
  font-size: 15px; font-weight: 500;
}
.policy-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--band-ink); text-underline-offset: 4px; }
.policy-links a:hover { color: var(--hi); }
.section-band :focus-visible { outline-color: var(--hi); }

/* Partners */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.partner { padding: 28px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 18px; }
.partner h3 { font-size: 21px; margin-bottom: 4px; }
.partner .muted { font-size: 15px; }
.partner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.partner-cta { border: 1.5px dashed var(--border-strong); justify-content: center; gap: 10px; }
.partner-cta h3 { font-size: 19px; margin: 0; }

/* Contact */
.contact-panel {
  padding: 48px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px;
}
.contact-head { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.contact-head .eyebrow { margin-bottom: 0; }
.contact-head h2 { font-size: clamp(30px, 3.6vw, 40px); }
.contact-head .btn { align-self: flex-start; margin-top: 8px; }
.facts { flex: 1 1 380px; min-width: 0; margin: 0; }
.facts div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd a { color: var(--accent-text); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; }
.footer-inner { display: flex; flex-direction: column; gap: 20px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-tagline { font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; font-size: 14px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); text-underline-offset: 4px; }
.footer-links a:hover { color: var(--ink); }
.footer-legal { font-size: 13px; color: var(--muted); }
.footer-fine { max-width: 760px; font-size: 12px; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease-out, transform 600ms ease-out; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .network { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .text-link svg { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 24px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px -24px var(--shadow);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity 200ms ease, transform 200ms ease; }
  .nav a:not(.btn) { display: flex; align-items: center; min-height: 52px; font-size: 17px; color: var(--ink); border-bottom: 1px solid var(--border); }
  .nav-cta { display: inline-flex; margin-top: 16px; height: 52px; }

  .hero-inner { padding-top: 72px; padding-bottom: 72px; }
  .hero-art { position: absolute; right: -140px; top: -20px; width: 460px; opacity: 0.45; pointer-events: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { height: 64px; }
  :root { --header-h: 64px; }
  .brand-name { font-size: 19px; }
  .header-cta { display: none; }

  .hero-inner { padding-top: 40px; padding-bottom: 48px; }
  .hero-copy { gap: 20px; }
  .hero-art { right: -170px; top: -60px; width: 380px; }
  .pill { font-size: 12px; }
  .lead { font-size: 17px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .credentials { flex-direction: column; gap: 10px; }

  .section { padding: 72px 0; }
  .section-tight-top { padding-top: 0; }
  .about-lead { font-size: 18px; }
  .stack-lg { gap: 32px; }
  .band-card, .partner { padding: 22px; }
  .contact-panel { padding: 28px 20px; border-radius: 20px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 960px) {
  .nav, .nav.is-open { transition: none; }
}
