/* =========================================================================
   Nullbase — Liquid Glass Design System
   Light-first, true to the original brand: Sky Indigo, Spring Fern,
   Digital Coral on Soft Gray-Blue. Glassmorphism per design.md.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand (design.md) */
  --brand: #5d8edc;          /* Sky Indigo   */
  --brand-strong: #4a7bc8;
  --fern: #a1c181;           /* Spring Fern  */
  --fern-strong: #8fb06d;
  --accent: #ff6b6b;         /* Digital Coral */
  --accent-strong: #ff5252;
  --slate: #1f2d3d;          /* Dark Slate   */

  /* Radii (design.md: buttons 12, cards 16, modals 20) */
  --r-sm: 8px;
  --r-btn: 12px;
  --r-card: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing scale (8pt) */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 32px;
  --s-5: 48px; --s-6: 64px; --s-7: 96px; --s-8: 128px;

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  /* Motion (design.md) */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1180px;
}

/* Dark theme — the one and only */
:root {
  color-scheme: dark;
  --bg: #131c31;
  --bg-elev: #192440;
  /* liquid glass surfaces */
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-edge: rgba(93, 142, 220, 0.32);      /* translucent-border */
  --glass-highlight: rgba(255, 255, 255, 0.14); /* specular inset */
  --hairline: rgba(255, 255, 255, 0.10);
  --text: #eef2f8;
  --text-muted: rgba(238, 242, 248, 0.66);
  --text-faint: rgba(238, 242, 248, 0.4);
  --shadow-glass: 0 8px 32px rgba(3, 8, 20, 0.5);
  --shadow-heavy: 0 18px 50px -14px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(25, 36, 62, 0.7);
  --mesh-a: rgba(93, 142, 220, 0.14);
  --mesh-b: rgba(161, 193, 129, 0.10);
  --mesh-c: rgba(255, 107, 107, 0.045);
  --footer-bg: #0f1729;
  --hero-grad:
    radial-gradient(56rem 34rem at 92% 118%, rgba(161, 193, 129, 0.22), transparent 62%),
    linear-gradient(140deg, #2c4f8c 0%, #3a63ab 55%, #446db3 100%);
}

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

* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background: var(--bg);
}

/* soft brand-coloured mesh pinned behind everything — what the glass refracts
   (a fixed element instead of background-attachment: fixed, which iOS ignores) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52rem 36rem at 12% -6%, var(--mesh-a), transparent 60%),
    radial-gradient(44rem 30rem at 96% 10%, var(--mesh-b), transparent 60%),
    radial-gradient(34rem 24rem at 90% 104%, var(--mesh-c), transparent 65%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-3);
}

.section { padding-block: var(--s-6); position: relative; }
.section--tight { padding-block: var(--s-5); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
  color: var(--text-muted);
  max-width: 60ch;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h3 { font-size: 1.28rem; letter-spacing: -0.01em; }

/* Brand gradient text: indigo → coral (design.md link pairing) */
.gradient-text {
  background: linear-gradient(100deg, var(--brand) 0%, #7d9be0 45%, var(--accent) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  padding: 0.8rem 1.5rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.98rem;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(0) scale(1); }

.btn--primary {
  background: var(--brand);
  box-shadow: 0 6px 20px -8px rgba(93, 142, 220, 0.5);
}
.btn--primary:hover { background: var(--brand-strong); }

.btn--accent {
  background: var(--accent);
  box-shadow: 0 6px 20px -8px rgba(255, 107, 107, 0.5);
}
.btn--accent:hover { background: var(--accent-strong); }

.btn--ghost {
  background: var(--glass);
  color: var(--text);
  border-color: var(--glass-edge);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.btn--ghost:hover { background: var(--glass-2); border-color: var(--brand); }

.btn__arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Liquid glass cards ---------- */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-card);
  padding: var(--s-4);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-glass), inset 0 1px 0 var(--glass-highlight);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.card--hover:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-heavy), inset 0 1px 0 var(--glass-highlight);
  border-color: var(--brand);
}

/* frosted top sheen sweeping across the glass */
.card--glow::before {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  border-radius: var(--r-card) var(--r-card) 50% 50%;
  background: linear-gradient(180deg, var(--glass-highlight), transparent);
  opacity: 0.35;
  pointer-events: none;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-btn);
  background: linear-gradient(160deg, rgba(93, 142, 220, 0.22), rgba(161, 193, 129, 0.16));
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  color: var(--brand);
  margin-bottom: var(--s-3);
}
.icon-tile svg { width: 26px; height: 26px; }

/* ---------- Header (frosted glass nav, per design.md) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 var(--hairline);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: var(--s-1); }
.brand__logo { height: 42px; width: auto; } /* brand indigo, straight from the SVG; header stays 72px */

.nav { display: flex; align-items: center; gap: 2px; }
.nav__link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-btn);
  color: var(--text-muted);
  font-weight: 550;
  font-size: 0.95rem;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--glass-2); }
.nav__link.is-active { color: var(--brand); font-weight: 650; }

.header-actions { display: flex; align-items: center; gap: var(--s-1); }
/* compact button in the header — the nav shouldn't shout */
.header-actions .btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-btn);
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle { display: none; }

/* Mobile nav */
@media (max-width: 800px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: grid; }
  .nav.is-open {
    display: flex;
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: var(--s-2);
    background: var(--bg-elev);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow-heavy);
  }
  .nav.is-open .nav__link { padding: 0.9rem 1rem; font-size: 1.05rem; }
}

/* ---------- Hero: the signature gradient panel ---------- */
/* Full-bleed hero: the gradient flows straight from the header, edge to edge */
.hero {
  padding-bottom: var(--s-5);
}
.hero__inner {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: clamp(44px, 7vw, 90px) var(--s-3);
  text-align: center;
  background: var(--hero-grad);
  box-shadow: var(--shadow-heavy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* everything inside the gradient panel is white */
.hero__inner h1 { color: #fff; text-shadow: 0 2px 18px rgba(31, 45, 61, 0.25); }
.hero__inner .lead { color: rgba(255, 255, 255, 0.92); margin-inline: auto; margin-top: var(--s-3); }
.hero__inner .eyebrow { color: rgba(255, 255, 255, 0.88); }
.hero .gradient-text {
  background: linear-gradient(100deg, #ffffff 0%, #ffdcd2 70%, #ffb8b0 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; margin-top: var(--s-4); }
.hero .btn--ghost {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.hero .btn--ghost:hover { background: rgba(255, 255, 255, 0.3); border-color: #fff; }

.hero__inner > *:not(.grid-overlay):not(.bits) { position: relative; z-index: 2; }

/* geeky bit-drift: faint 0s, 1s and nulls floating up through the panel */
.bits {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.bits span {
  position: absolute;
  bottom: -2.5em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  will-change: transform, opacity;
  animation: bit-rise linear infinite;
}
@keyframes bit-rise {
  from { transform: translateY(0); opacity: 0; }
  6%   { opacity: var(--o, 0.09); }
  88%  { opacity: var(--o, 0.09); }
  to   { transform: translateY(-1060px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bits { display: none; } }

/* fine dotted texture over the gradient */
.grid-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 20%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 20%, #000 20%, transparent 72%);
  opacity: 0.4;
}

/* pill badge — glass on gradient */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 0.42rem 1rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  font-weight: 650;
  color: #fff;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #ffe08a; box-shadow: 0 0 0 4px rgba(255, 224, 138, 0.25); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: var(--s-3); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) { .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.section-head { max-width: 62ch; margin-bottom: var(--s-5); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: var(--s-2); }
.section-head .lead { margin-top: var(--s-2); }
.section-head.center .lead { margin-inline: auto; }

/* ---------- Feature card ---------- */
.feature h3 { margin-bottom: var(--s-1); }
.feature p { color: var(--text-muted); font-size: 0.97rem; }

/* ---------- Product showcase ---------- */
.showcase {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s-5);
  align-items: center;
  padding: var(--s-5);
}
@media (max-width: 860px) { .showcase { grid-template-columns: 1fr; text-align: center; } }
.showcase__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  background:
    radial-gradient(120% 120% at 28% 18%, rgba(93, 142, 220, 0.2), transparent 60%),
    radial-gradient(120% 120% at 82% 88%, rgba(161, 193, 129, 0.22), transparent 55%),
    #ffffff;
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.showcase__media img { width: 58%; max-width: 260px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.32rem 0.75rem; border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 700;
  background: rgba(161, 193, 129, 0.18); color: var(--fern);
  border: 1px solid rgba(161, 193, 129, 0.45);
}
.showcase__cta { margin-top: var(--s-3); display: inline-flex; }

/* ---------- Trust strip (plain row below the hero, no chrome) ---------- */
.trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5);
  padding: var(--s-2) 0;
}
.trust__item { display: inline-flex; align-items: center; gap: var(--s-1); color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.trust__item svg { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; }

/* ---------- CTA band (gradient echo of the hero) ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(var(--s-5), 7vw, var(--s-7));
  text-align: center;
  background: var(--hero-grad);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-heavy);
}
.cta-band > *:not(.bits) { position: relative; z-index: 2; }
.cta-band h2 { color: #fff; text-shadow: 0 2px 14px rgba(31, 45, 61, 0.25); }
.cta-band .eyebrow { color: rgba(255, 255, 255, 0.88); }
.cta-band .lead { color: rgba(255, 255, 255, 0.92); }
.cta-band .btn--ghost {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.cta-band .btn--ghost:hover { background: rgba(255, 255, 255, 0.3); border-color: #fff; }

/* ---------- Prose (about / privacy body) ---------- */
.prose p { color: var(--text-muted); margin-bottom: var(--s-2); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }

.contact-list { display: grid; gap: var(--s-2); }
.contact-list dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }
.contact-list dd { color: var(--text); margin-top: 2px; }
.contact-list a { color: var(--brand); }
.contact-list a:hover { color: var(--accent); }

/* ---------- Footer (dark slate, like the original) ---------- */
.site-footer {
  margin-top: var(--s-7);
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.85);
}
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: var(--s-4);
  justify-content: space-between; align-items: flex-start;
  padding-block: var(--s-5);
}
.footer-brand { max-width: 36ch; }
.footer-brand img { height: 28px; margin-bottom: var(--s-2); filter: brightness(0) invert(1); }
.footer-brand p { color: rgba(255, 255, 255, 0.6); font-size: 0.92rem; }

.footer-nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); margin-bottom: var(--s-2); }
.footer-col a { display: block; color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; padding: 4px 0; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--s-3);
  display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between;
  color: rgba(255, 255, 255, 0.45); font-size: 0.88rem;
}

/* ---------- Scroll reveal ---------- */
/* Only hide when JS is present (it un-hides on scroll); no-JS users see everything. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- Modal (glass, design.md: radius 20) ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: var(--s-3); }
.modal.is-open { display: grid; }
.modal__scrim { position: absolute; inset: 0; background: rgba(31, 45, 61, 0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal__box {
  position: relative; z-index: 1; max-width: 460px; width: 100%;
  background: var(--glass-2);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: var(--s-5); text-align: center;
  box-shadow: var(--shadow-heavy), inset 0 1px 0 var(--glass-highlight);
  animation: pop 0.3s var(--ease-out);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__emoji { font-size: 3rem; margin-bottom: var(--s-2); }
.modal__box h3 { margin-bottom: var(--s-1); }
.modal__box p { color: var(--text-muted); margin-bottom: var(--s-2); }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.stack > * + * { margin-top: var(--s-2); }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 999;
  background: var(--brand); color: #fff; padding: 0.6rem 1rem; border-radius: var(--r-sm);
}
.skip-link:focus { left: 8px; }
