/* =============================================================================
   Lemniscia — Global Stylesheet
   -----------------------------------------------------------------------------
   Single source of truth for theming. Everything is driven by the CSS custom
   properties in :root below — change the brand colors there and the whole site
   updates. Dark mode is handled with [data-theme="dark"] + prefers-color-scheme.

   Table of contents
     1.  Design tokens (custom properties)
     2.  Reset & base
     3.  Typography helpers
     4.  Layout primitives (container, section)
     5.  Buttons
     6.  Navigation
     7.  Hero
     8.  Cards (services)
     9.  Apps grid
     10. About
     11. Contact & form
     12. Footer
     13. Reveal-on-scroll animation
     14. Legal / privacy document layout
     15. Privacy hub
     16. Utilities & accessibility
============================================================================= */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Brand palette (edit these to rebrand the whole site) ---
     Lemniscia "Scheme B": violet → magenta. No blue/teal in gradients;
     the only teal (--brand-node) lives on the logo mark alone. */
  --brand-primary:        #9333EA;   /* violet  — primary actions, links     */
  --brand-primary-strong: #A855F7;   /* lighter — primary hover              */
  --brand-accent:         #C04AE8;   /* purple  — mid-gradient, highlights   */
  --brand-accent-2:       #F45D9C;   /* magenta — gradient endpoint          */
  --brand-node:           #2EE8D8;   /* teal    — logo node only, never text */

  /* --- Neutrals: LIGHT theme (default) --- */
  --bg:            #ffffff;
  --bg-subtle:     #f8fafc;
  --surface:       #ffffff;
  --surface-2:     #f1f5f9;
  --text:          #0f172a;          /* deep charcoal/navy                   */
  --text-muted:    #56627a;
  --text-subtle:   #8a94a6;
  --border:        #e6e9ef;
  --border-strong: #cbd5e1;

  /* --- Semantic tokens --- */
  --primary:           var(--brand-primary);
  --primary-strong:    var(--brand-primary-strong);
  --primary-contrast:  #ffffff;
  --link:              #7E22CE;      /* darker violet keeps link text AA on white */
  --focus-ring:        color-mix(in srgb, var(--brand-primary) 55%, transparent);

  --callout-bg:     color-mix(in srgb, var(--brand-primary) 7%, var(--surface));
  --callout-border: color-mix(in srgb, var(--brand-primary) 35%, transparent);

  --quote-bar:      var(--brand-accent);

  /* Placeholder marker — deliberately loud so nothing ships unfilled */
  --ph-bg:     #fff3cd;
  --ph-text:   #7a4f01;
  --ph-border: #f0b429;

  /* --- Typography --- */
  --font-heading: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  /* Fluid type scale (clamp = mobile → desktop) */
  --fs-display: clamp(2.5rem, 1.4rem + 4.6vw, 4.25rem);
  --fs-h1:      clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --fs-h2:      clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-h3:      clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-lead:    clamp(1.05rem, 0.98rem + 0.45vw, 1.3rem);
  --fs-body:    1rem;
  --fs-sm:      0.9rem;
  --fs-xs:      0.8rem;

  /* --- Spacing scale (8px base) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* --- Radius --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* --- Shadows (soft, layered) --- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12), 0 6px 12px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 10px 40px color-mix(in srgb, var(--brand-primary) 30%, transparent);

  /* --- Layout --- */
  --container: 1140px;
  --reading:   760px;          /* readable column for legal docs */
  --nav-h:     68px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  0.35s;

  color-scheme: light;
}

/* --- Neutrals: DARK theme --- */
[data-theme="dark"] {
  --bg:            #0a0c12;          /* deep navy/charcoal base */
  --bg-subtle:     #0f1219;
  --surface:       #14171f;
  --surface-2:     #1b1f29;
  --text:          #f4f6fb;
  --text-muted:    #aeb6c6;
  --text-subtle:   #79839a;
  --border:        #232836;
  --border-strong: #323a4d;

  --primary:          #A855F7;       /* lighter violet reads better on dark */
  --primary-strong:   #C084FC;
  --link:             #C084FC;

  --callout-bg:     color-mix(in srgb, var(--brand-primary) 16%, var(--surface));
  --callout-border: color-mix(in srgb, var(--brand-primary) 45%, transparent);

  --ph-bg:     #3a2f12;
  --ph-text:   #ffd98a;
  --ph-border: #b07d18;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* Follow the OS when the user hasn't explicitly chosen light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0a0c12;
    --bg-subtle:     #0f1219;
    --surface:       #14171f;
    --surface-2:     #1b1f29;
    --text:          #f4f6fb;
    --text-muted:    #aeb6c6;
    --text-subtle:   #79839a;
    --border:        #232836;
    --border-strong: #323a4d;

    --primary:          #A855F7;
    --primary-strong:   #C084FC;
    --link:             #C084FC;

    --callout-bg:     color-mix(in srgb, var(--brand-primary) 16%, var(--surface));
    --callout-border: color-mix(in srgb, var(--brand-primary) 45%, transparent);

    --ph-bg:     #3a2f12;
    --ph-text:   #ffd98a;
    --ph-border: #b07d18;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
  }
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem); /* anchored TOC clears nav */
}

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

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 1.25rem; }

button { font: inherit; color: inherit; cursor: pointer; }

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

::selection { background: color-mix(in srgb, var(--brand-primary) 30%, transparent); }

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

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

p { text-wrap: pretty; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
/* The little leading dot on the hero eyebrow picks up the magenta accent */
.eyebrow svg { color: var(--brand-accent-2); }

.lead   { font-size: var(--fs-lead); color: var(--text-muted); line-height: 1.6; }
.muted  { color: var(--text-muted); }

.gradient-text {
  /* Scheme B: violet → magenta, single hop (no blue endpoint) */
  background: linear-gradient(90deg, var(--brand-primary-strong), var(--brand-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   4. LAYOUT PRIMITIVES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(var(--space-8), 10vw, var(--space-10)); }
.section--tight { padding-block: clamp(var(--space-7), 7vw, var(--space-8)); }

.section__header {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section__header--center { margin-inline: auto; text-align: center; }
.section__header h2 { font-size: var(--fs-h2); margin-top: 0.75rem; }
.section__header p { margin-top: 1rem; }

.section--alt { background: var(--bg-subtle); }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-full);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.05em; height: 1.05em; }

.btn--primary {
  --btn-bg: var(--brand-primary);
  --btn-fg: var(--primary-contrast);
  --btn-bd: transparent;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { --btn-bg: var(--brand-primary-strong); box-shadow: var(--shadow-lg); }

.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn--ghost:hover { --btn-bg: var(--surface-2); }

.btn--lg { padding: 1rem 1.75rem; font-size: var(--fs-body); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--link);
}
.link-arrow svg { width: 1em; height: 1em; transition: transform var(--dur) var(--ease); }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ============================================================
   6. NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease);
}
/* Translucent blur once the page is scrolled */
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
}
.nav__inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav__logo:hover { text-decoration: none; }
.nav__logo svg { width: 28px; height: 28px; }
.nav__logo img { height: 28px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Mobile menu toggle (hamburger) */
.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
}
.nav__burger svg { width: 20px; height: 20px; }

@media (max-width: 820px) {
  .nav__burger { display: grid; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav__link { padding: 0.75rem 0.85rem; font-size: 1rem; }
}

/* ============================================================
   7. HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3rem, 9vw, 7rem));
  padding-bottom: clamp(3rem, 9vw, 7rem);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
/* Scheme B deep-purple hero glow — only in dark contexts, so it never
   sits behind the dark hero text of the light theme. */
[data-theme="dark"] .hero__bg {
  background: radial-gradient(120% 140% at 85% -20%,
    var(--lem-bg-glow, #2A1655) 0%, var(--lem-bg-mid, #170F30) 42%, var(--lem-bg-deep, #0D0A1F) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero__bg {
    background: radial-gradient(120% 140% at 85% -20%,
      #2A1655 0%, #170F30 42%, #0D0A1F 100%);
  }
}
/* Soft animated gradient blobs */
.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.hero__blob--1 {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -12%; left: -8%;
  background: radial-gradient(circle at 30% 30%, var(--brand-primary), transparent 70%);
  animation: drift1 18s ease-in-out infinite alternate;
}
.hero__blob--2 {
  width: 40vw; height: 40vw; max-width: 560px; max-height: 560px;
  top: -6%; right: -10%;
  background: radial-gradient(circle at 60% 40%, var(--brand-accent), transparent 70%);
  animation: drift2 22s ease-in-out infinite alternate;
}
.hero__blob--3 {
  width: 38vw; height: 38vw; max-width: 520px; max-height: 520px;
  bottom: -22%; left: 30%;
  background: radial-gradient(circle at 50% 50%, var(--brand-accent-2), transparent 70%);
  opacity: 0.4;
  animation: drift3 26s ease-in-out infinite alternate;
}
/* Faint grid overlay for a technical, geometric feel */
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
}

@keyframes drift1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px,30px,0) scale(1.1); } }
@keyframes drift2 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-50px,40px,0) scale(1.08); } }
@keyframes drift3 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(30px,-30px,0) scale(1.12); } }

.hero__content { max-width: 820px; }
.hero__title { font-size: var(--fs-display); margin-top: 1.25rem; }
.hero__subtitle {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  margin-top: 1.5rem;
  max-width: 620px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.25rem;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 3rem;
  color: var(--text-subtle);
  font-size: var(--fs-sm);
}
.hero__trust span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__trust svg { width: 1.1em; height: 1.1em; color: var(--primary); }

/* ============================================================
   8. CARDS (Services)
   ============================================================ */
.cards {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
}
.card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  color: var(--primary-contrast);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .card__icon { color: #fff; }
.card__icon svg { width: 26px; height: 26px; }
.card__title { font-size: var(--fs-h3); margin-bottom: 0.5rem; }
.card__text { color: var(--text-muted); font-size: var(--fs-sm); }

/* ============================================================
   9. APPS GRID
   ============================================================ */
.app-grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
}
/* When the whole card is a link, never underline it on hover */
a.app-card, a.app-card:hover { text-decoration: none; color: inherit; }
.app-card__top { display: flex; align-items: center; gap: 0.9rem; }
.app-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary-contrast);
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-primary));
}
.app-card__icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.app-card__name { font-size: var(--fs-h3); }
.app-card__platform { font-size: var(--fs-xs); color: var(--text-subtle); }
.app-card__desc { color: var(--text-muted); font-size: var(--fs-sm); flex: 1 1 auto; }
.app-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   10. ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }
.about__col h2 { font-size: var(--fs-h2); margin-bottom: 1rem; }
.about__col p + p { margin-top: 1rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.stat__num {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
}
.stat__label { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 0.5rem; }

/* ============================================================
   11. CONTACT & FORM
   ============================================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 820px) { .contact__grid { grid-template-columns: 1fr; } }
.contact__info h2 { font-size: var(--fs-h2); margin-bottom: 1rem; }
.contact__methods { list-style: none; padding: 0; margin-top: 1.5rem; display: grid; gap: 1rem; }
.contact__methods li { display: flex; align-items: center; gap: 0.75rem; }
.contact__methods svg { width: 20px; height: 20px; color: var(--primary); flex: 0 0 auto; }

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-md);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }
.form__group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.form__label { font-size: var(--fs-sm); font-weight: 600; }
.form__input, .form__textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form__input::placeholder, .form__textarea::placeholder { color: var(--text-subtle); }
.form__input:focus, .form__textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.form__textarea { resize: vertical; min-height: 130px; }
.form__submit { width: 100%; margin-top: 0.5rem; }
.form__status {
  margin-top: 1rem;
  font-size: var(--fs-sm);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  display: none;
}
.form__status.is-success { display: block; background: color-mix(in srgb, #16a34a 14%, var(--surface)); color: #15803d; border: 1px solid color-mix(in srgb, #16a34a 30%, transparent); }
.form__status.is-error   { display: block; background: color-mix(in srgb, #dc2626 14%, var(--surface)); color: #b91c1c; border: 1px solid color-mix(in srgb, #dc2626 30%, transparent); }
[data-theme="dark"] .form__status.is-success { color: #86efac; }
[data-theme="dark"] .form__status.is-error   { color: #fca5a5; }

/* ============================================================
   12. FOOTER
   ============================================================ */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
}
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand p { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 1rem; max-width: 32ch; }
.footer__logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; color: var(--text);
}
.footer__logo svg { width: 26px; height: 26px; }
.footer__logo img { height: 26px; width: auto; }
.footer__col h3 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}
.footer__links { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.footer__links a { color: var(--text-muted); font-size: var(--fs-sm); }
.footer__links a:hover { color: var(--text); }
.footer__social { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.footer__social a {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer__social a:hover { color: var(--text); border-color: var(--brand-primary); transform: translateY(-2px); }
.footer__social svg { width: 18px; height: 18px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: var(--fs-sm);
}

/* ============================================================
   13. REVEAL-ON-SCROLL
   ============================================================ */
.reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
/* Hide pre-reveal ONLY when JS is available to reveal them (no-JS = always visible) */
.js .reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   14. LEGAL / PRIVACY DOCUMENT
   ============================================================ */
.legal {
  padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 3.5rem));
  padding-bottom: clamp(3rem, 8vw, 5rem);
}
/* Slightly narrower column for legal pages so the heading, TOC and body align */
.legal .container { max-width: 1080px; }
.legal__wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, var(--reading));
  gap: clamp(2rem, 5vw, 4rem);
  justify-content: center;
}
@media (max-width: 900px) { .legal__wrap { grid-template-columns: 1fr; } }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link svg { width: 1em; height: 1em; }

/* Sticky in-page table of contents */
.legal__toc {
  align-self: start;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  font-size: var(--fs-sm);
}
.legal__toc h2 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin-bottom: 0.85rem;
}
.legal__toc nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.legal__toc nav li.toc-sub { margin-left: 0.85rem; }
.legal__toc nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.legal__toc nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.legal__toc nav a.is-active {
  color: var(--primary);
  border-left-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
  font-weight: 600;
}
@media (max-width: 900px) {
  .legal__toc {
    position: static;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
  }
}

/* The document body */
.legal__header { margin-bottom: 2rem; }
.legal__header h1 { font-size: var(--fs-h1); }
.legal__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  color: var(--text-subtle);
  font-size: var(--fs-sm);
}
.legal__meta time { color: var(--text-muted); font-weight: 600; }

.legal__body { font-size: 1.02rem; }
.legal__body h2 {
  font-size: var(--fs-h3);
  margin-top: 2.75rem;
  padding-top: 0.5rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.legal__body h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.legal__body p { margin-top: 1rem; color: var(--text); }
.legal__body ul, .legal__body ol { margin-top: 1rem; padding-left: 1.4rem; display: grid; gap: 0.5rem; }
.legal__body li { padding-left: 0.25rem; }
.legal__body li > ul, .legal__body li > ol { margin-top: 0.5rem; }
.legal__body strong { font-weight: 700; color: var(--text); }
.legal__body a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.legal__body hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Blockquote */
.legal__body blockquote {
  margin: 1.5rem 0;
  padding: 0.85rem 1.25rem;
  border-left: 4px solid var(--quote-bar);
  background: var(--surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-muted);
}
.legal__body blockquote p { margin-top: 0; }
.legal__body blockquote p + p { margin-top: 0.6rem; }

/* "Short version" / summary callout */
.callout {
  margin: 1.75rem 0;
  padding: 1.5rem 1.75rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--radius-lg);
  /* It can be a TOC scroll target (#summary), so clear the fixed nav */
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.callout__title {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.callout__title svg { width: 1.2em; height: 1.2em; color: var(--primary); }
.callout p { margin-top: 0.6rem; }
.callout ul { margin-top: 0.75rem; }

/* Tables (third-party services etc.) */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.legal__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 520px;
}
.legal__body thead th {
  text-align: left;
  background: var(--surface-2);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-strong);
}
.legal__body tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}
.legal__body tbody tr:last-child td { border-bottom: none; }
.legal__body tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

/* Highlighted [PLACEHOLDER] marker */
.placeholder {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.05em 0.45em;
  margin: 0 0.1em;
  color: var(--ph-text);
  background: var(--ph-bg);
  border: 1px dashed var(--ph-border);
  border-radius: 6px;
  white-space: normal;
}

/* ============================================================
   15. PRIVACY HUB
   ============================================================ */
.hub { padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4rem)); }
.policy-list {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.25rem);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-top: 2.5rem;
}
.policy-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.policy-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border));
  text-decoration: none;
}
.policy-card__icon {
  display: grid; place-items: center;
  width: 50px; height: 50px; flex: 0 0 auto;
  border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem;
  color: var(--primary-contrast);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}
.policy-card__body { flex: 1 1 auto; min-width: 0; }
.policy-card__name { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 1.1rem; color: var(--text); }
.policy-card__desc { display: block; color: var(--text-muted); font-size: var(--fs-sm); margin-top: 0.2rem; }
.policy-card__arrow { color: var(--text-subtle); flex: 0 0 auto; transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.policy-card:hover .policy-card__arrow { color: var(--primary); transform: translateX(4px); }
.policy-card__arrow svg { width: 20px; height: 20px; }

/* ============================================================
   16. UTILITIES & ACCESSIBILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--brand-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; text-decoration: none; }

[hidden] { display: none !important; }

/* Honeypot spam trap: off-screen for everyone (also aria-hidden + tabindex=-1) */
.honeypot { position: absolute; left: -9999px; }

/* --- Small helpers that replace former inline style="" attributes ---------
   These exist so every page can run under a strict Content-Security-Policy
   (style-src 'self' …) with NO inline styles. Prefer adding a class here over
   re-introducing a style="" attribute. */
.about__cta            { margin-top: var(--space-5); }            /* "Work with us" link spacing  */
.app-card--cta         { justify-content: center; text-align: center; align-items: center; }
.app-card__icon--alt   { background: linear-gradient(135deg, var(--brand-accent-2), var(--brand-primary)); }
.hub__header           { max-width: 680px; }                       /* privacy-hub heading block     */
.hub__hint             { margin-top: 2.5rem; font-size: var(--fs-sm); }
.back-link--inline     { margin: 0; }                              /* back-link used mid-paragraph  */
