/* ============================================================================
   AMSA tools — design system
   Near-monochrome warm brand, single "ember" accent, dark + light via tokens.
   Type: Geist (display/body) + Geist Mono. No pure #000/#fff. WCAG AA.
   ============================================================================ */

/* ---- Fonts (self-hosted) ---- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/BricolageGrotesque.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/HankenGrotesk.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* Brand accent (ember). Swap this one line to re-brand. */
  --accent:        #FF6A3D;
  --accent-strong: #F2521F;
  --accent-soft:   rgba(255, 106, 61, 0.12);
  --on-accent:     #1A0E08;

  /* Product accents (used only on their own pages) */
  --tc-violet:     #8B5CF6;

  /* Type */
  --font-sans:    "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radius (one scale, locked) */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Spacing rhythm */
  --container: 1200px;
  --gutter: clamp(20px, 5vw, 40px);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.45s;
}

/* Light theme (default) */
:root, [data-theme="light"] {
  --bg:        #FAFAF8;   /* warm off-white */
  --bg-elev:   #FFFFFF;
  --surface:   #F2F1EC;
  --border:    #E4E2DA;
  --border-strong: #D2CFC4;
  --text:      #15140F;   /* warm near-black */
  --text-soft: #56544C;
  --text-mute: #6C6A61;   /* darkened for WCAG AA (≈5.2:1 on the off-white bg) */
  /* Light-mode accent text: a darker ember than the brand --accent-strong so
     small accent labels (eyebrows, tags, code keywords) clear WCAG AA (≈5:1).
     Dark mode keeps the original below. The TouchCompanion violet override is
     scoped per-subtree, so it still wins where it applies. */
  --accent-strong: #C2410C;
  --shadow:    0 1px 2px rgba(20,18,12,.04), 0 12px 32px rgba(20,18,12,.06);
  --shadow-lg: 0 2px 6px rgba(20,18,12,.05), 0 30px 60px rgba(20,18,12,.10);
  --grid-line: rgba(20,18,12,.05);
  color-scheme: light;
}

/* Dark theme */
[data-theme="dark"] {
  --bg:        #0C0C0E;   /* warm near-black */
  --bg-elev:   #131316;
  --surface:   #17171B;
  --border:    #26262C;
  --border-strong: #34343C;
  --accent-strong: #F2521F;  /* dark theme keeps the brighter brand ember */
  --text:      #F4F3EF;
  --text-soft: #B4B2AB;
  --text-mute: #807E77;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 14px 40px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 36px 80px rgba(0,0,0,.6);
  --grid-line: rgba(255,255,255,.045);
  color-scheme: dark;
}

/* Follow system when no explicit choice stored (JS sets data-theme; this is the
   pre-JS fallback so first paint matches OS preference). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#0C0C0E; --bg-elev:#131316; --surface:#17171B; --border:#26262C;
    --border-strong:#34343C; --accent-strong:#F2521F;
    --text:#F4F3EF; --text-soft:#B4B2AB; --text-mute:#807E77;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 14px 40px rgba(0,0,0,.5);
    --shadow-lg:0 2px 8px rgba(0,0,0,.5),0 36px 80px rgba(0,0,0,.6);
    --grid-line:rgba(255,255,255,.045); color-scheme: dark;
  }
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.011em;
  min-height: 100dvh;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

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

::selection { background: var(--accent-soft); color: var(--text); }

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

/* Skip-to-content: first focusable element, hidden until keyboard-focused. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -120px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-weight: 500;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(72px, 12vw, 132px); }
.section--tight { padding-block: clamp(48px, 8vw, 88px); }

/* ---- Typography ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 500;
}
[data-theme="dark"] .eyebrow { color: var(--accent); }

.h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  font-weight: 600;
}
.lead {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 48ch;
}
.muted { color: var(--text-mute); }
.mono  { font-family: var(--font-mono); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.72em 1.25em;
  border-radius: var(--r-pill);
  font-weight: 500; font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 24px var(--accent-soft);
}
.btn--primary:hover { background: var(--accent-strong); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface); border-color: var(--text-mute); }

.btn--lg { padding: 0.92em 1.5em; font-size: 1.02rem; }

/* Destructive action button (account deletion, etc.) */
.btn--danger {
  background: transparent;
  color: #C24141;
  border-color: rgba(214,69,69,.45);
}
.btn--danger:hover { background: rgba(214,69,69,.1); border-color: #C24141; }
[data-theme="dark"] .btn--danger { color: #F08A8A; border-color: rgba(240,138,138,.4); }
[data-theme="dark"] .btn--danger:hover { background: rgba(240,138,138,.12); border-color: #F08A8A; }

/* link with arrow */
.tlink {
  display: inline-flex; align-items: center; gap: 0.4em;
  color: var(--text); font-weight: 500;
  border-bottom: 1px solid transparent;
}
.tlink:hover { color: var(--accent-strong); }
[data-theme="dark"] .tlink:hover { color: var(--accent); }
.tlink .ar { transition: transform .2s var(--ease); }
.tlink:hover .ar { transform: translateX(3px); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: 68px;
  display: flex; align-items: center;
  backdrop-filter: saturate(150%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  background: radial-gradient(120% 120% at 50% 35%, #1b1411, #0d0a0b 55%, #070506);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 12px rgba(255,90,31,.20), inset 0 0 0 1px rgba(255,255,255,.05);
}
.brand-mark img { width: 38px; height: 38px; display: block; }
.brand-word { font-weight: 600; color: var(--text); }
.brand-word b { font-weight: 700; }
.brand-tools { color: var(--accent-strong); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text-soft); font-size: 0.94rem; font-weight: 500;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.is-active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-soft); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-toggle { display: none; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(56px, 9vw, 104px);
}
.hero-copy { max-width: 36ch; }
.hero h1 { margin-top: 18px; }
.hero .lead { margin-top: 22px; }
.hero-cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ambient backdrop (treatment, not a fake screenshot) */
.hero::before {
  content: ""; position: absolute; inset: -10% -20% auto auto;
  width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 62%);
  pointer-events: none; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

/* hero visual: product frame floating above a subtle constellation + glow */
.hero-visual { position: relative; }
.hero-net {
  /* canvas is a replaced element: inset alone won't stretch it, so size it
     explicitly. The box overspills the frame on every side so nodes peek out. */
  position: absolute;
  left: -11%; top: -16%;
  width: 122%; height: 132%;
  z-index: 0; pointer-events: none;
  display: block;
}
/* soft accent bloom behind the frame, for depth (theme-aware via tokens) */
.hero-visual::before {
  content: ""; position: absolute; inset: -8% -6%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 55% at 32% 30%, var(--accent-soft), transparent 70%),
    radial-gradient(55% 55% at 78% 80%, color-mix(in srgb, var(--tc-violet) 16%, transparent), transparent 72%);
  filter: blur(8px);
}

/* product visual frame on the right of the hero */
.showcase {
  position: relative;
  z-index: 1;                  /* sits above the constellation + glow */
  aspect-ratio: 16 / 11;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 60%, transparent), var(--surface));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.showcase img { width: 100%; height: 100%; object-fit: cover; }
.showcase .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  color: var(--text-mute); text-align: center; padding: 24px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
}
.showcase .placeholder .ph-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.showcase .placeholder .ph-sub { font-size: 12px; color: var(--text-mute); opacity: .85; }

/* ---- Section header ---- */
.section-head { max-width: 60ch; }
.section-head .h2 { margin-top: 14px; }
.section-head p { margin-top: 14px; color: var(--text-soft); font-size: 1.08rem; line-height: 1.55; }

/* ---- Products (asymmetric, not 3 equal cards) ---- */
.products { display: grid; gap: 22px; margin-top: clamp(34px, 5vw, 56px); }
.product {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.product:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.product--reverse { grid-template-columns: 1fr 1.1fr; }
.product--reverse .product-media { order: -1; }
.product[data-accent="tc"] { --accent: var(--tc-violet); --accent-strong: #7C3AED; --accent-soft: rgba(139,92,246,.14); }

.product-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mute);
}
.product-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); }
.product-status.is-live .dot { background: #2FBF71; box-shadow: 0 0 0 3px rgba(47,191,113,.18); }
.product-status.is-live { color: #2FBF71; }
.product h3 { margin-top: 14px; }
.product p { margin-top: 12px; color: var(--text-soft); max-width: 42ch; line-height: 1.55; }
.product-foot { margin-top: 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.product-media {
  aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  position: relative;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-media .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-mute); font-family: var(--font-mono); font-size: 12px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* full-width section screenshot (16:9 framed) */
.shot {
  margin-top: clamp(28px, 4vw, 48px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* feature chips inside a product */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-size: 0.84rem; padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
}

/* ---- About / maker ---- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.about-grid .h2 { letter-spacing: -0.03em; }
.about-points { display: grid; gap: 2px; }
.about-point { padding: 20px 0; border-top: 1px solid var(--border); }
.about-point:first-child { border-top: 0; }
.about-point h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.about-point p { margin-top: 6px; color: var(--text-soft); line-height: 1.55; }

/* ---- CTA band ---- */
.cta-band {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%),
    var(--bg-elev);
  padding: clamp(36px, 6vw, 72px);
  text-align: center;
}
.cta-band .h2 { max-width: 18ch; margin-inline: auto; }
.cta-band p { margin-top: 14px; color: var(--text-soft); max-width: 46ch; margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; margin-top: 28px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); padding-block: 48px 40px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { max-width: 30ch; }
.footer-brand p { margin-top: 12px; color: var(--text-mute); font-size: 0.92rem; line-height: 1.55; }
.footer-cols { display: flex; gap: clamp(32px, 6vw, 80px); flex-wrap: wrap; }
.footer-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); }
.footer-col a { display: block; margin-top: 12px; color: var(--text-soft); font-size: 0.94rem; }
.footer-col a:hover { color: var(--text); }
.footer-base { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-mute); font-size: 0.86rem; }

/* ---- Auth (login) ---- */
.auth-wrap { min-height: calc(100dvh - 68px); display: grid; place-items: center; padding-block: 48px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(28px, 5vw, 40px);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.6rem; letter-spacing: -0.025em; font-weight: 600; }
.auth-card .sub { margin-top: 8px; color: var(--text-soft); font-size: 0.96rem; }
.field { margin-top: 18px; }
.field label { display: block; font-size: 0.88rem; font-weight: 500; color: var(--text-soft); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 0.78em 0.9em;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input::placeholder { color: var(--text-mute); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 22px; }
.auth-error { margin-top: 16px; padding: 11px 13px; border-radius: var(--r-sm); background: rgba(214,69,69,.1); border: 1px solid rgba(214,69,69,.3); color: #C24141; font-size: 0.9rem; }
[data-theme="dark"] .auth-error { color: #F08A8A; }

/* ---- Coming soon / 404 ---- */
.centered { min-height: calc(100dvh - 68px); display: grid; place-items: center; text-align: center; padding: 48px; }
.centered .h1 { max-width: 16ch; }
.centered p { margin-top: 18px; }
.centered .hero-cta { justify-content: center; margin-top: 30px; }

/* ============================================================================
   Product pages (TouchCompanion, Magnifier)
   ============================================================================ */
/* Scope the violet accent to the whole TouchCompanion page, not just a card. */
[data-accent="tc"] { --accent: var(--tc-violet); --accent-strong: #7C3AED; --accent-soft: rgba(139,92,246,.14); --on-accent: #fff; }

.product-page { padding-top: clamp(36px, 6vw, 64px); }

/* hero */
.phero { display: grid; grid-template-columns: 1.06fr 0.94fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.phero .lead { margin-top: 20px; }
.phero .hero-cta { margin-top: 30px; }
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.tag {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-soft);
}
.tag--accent { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
[data-theme="dark"] .tag--accent { color: var(--accent); }

/* feature bento (not 3 equal cards: a wide lead tile + a 2-col grid) */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: clamp(30px, 4vw, 52px); }
.feature {
  grid-column: span 2; padding: clamp(20px, 2.3vw, 28px);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elev);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature--wide { grid-column: span 3; }
.feature--lead { grid-column: span 6; display: grid; grid-template-columns: auto 1fr; gap: clamp(18px, 2.4vw, 32px); align-items: center; }
.ficon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 16px; flex: none; }
[data-theme="dark"] .ficon { color: var(--accent); }
.feature--lead .ficon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 0; }
.feature h3 { font-size: 1.12rem; }
.feature--lead h3 { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); }
.feature p { margin-top: 9px; color: var(--text-soft); line-height: 1.55; font-size: .96rem; }

/* numbered contrast rows ("why not the built-in") */
.compare { display: grid; gap: 14px; margin-top: clamp(28px, 4vw, 44px); }
.compare-row {
  display: grid; grid-template-columns: 30px 1fr; gap: 18px; align-items: start;
  padding: clamp(20px, 2.4vw, 26px) clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elev);
}
.compare-row .n { font-family: var(--font-mono); font-size: 1.1rem; color: var(--accent-strong); font-weight: 500; line-height: 1.4; }
[data-theme="dark"] .compare-row .n { color: var(--accent); }
.compare-row h4 { font-size: 1.06rem; letter-spacing: -0.01em; }
.compare-row p { margin-top: 7px; color: var(--text-soft); line-height: 1.6; max-width: 70ch; }

/* split content (text + framed visual) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.split--rev .split-media { order: -1; }
.split-copy .h2 { margin-top: 12px; }
.split-copy p { margin-top: 14px; color: var(--text-soft); line-height: 1.6; max-width: 46ch; }
.split-media {
  aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); position: relative; box-shadow: var(--shadow);
}
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split-media .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; text-align: center; padding: 24px;
  color: var(--text-mute); font-family: var(--font-mono); font-size: 12px; letter-spacing: .03em;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* bullet list with accent markers */
.ticks { display: grid; gap: 14px; margin-top: 22px; }
.ticks li { list-style: none; display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--text-soft); line-height: 1.55; }
.ticks li svg { margin-top: 3px; color: var(--accent-strong); flex: none; }
[data-theme="dark"] .ticks li svg { color: var(--accent); }
.ticks li b { color: var(--text); font-weight: 600; }

/* code block (action-button script) */
.code {
  font-family: var(--font-mono); font-size: .86rem; line-height: 1.75;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 22px; overflow-x: auto; color: var(--text); margin-top: 22px;
}
.code .c { color: var(--text-mute); }
.code .k { color: var(--accent-strong); }
[data-theme="dark"] .code .k { color: var(--accent); }

/* hotkey / reference table */
.ktable { width: 100%; border-collapse: collapse; margin-top: 26px; }
.ktable th, .ktable td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: .94rem; vertical-align: top; }
.ktable th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); font-weight: 500; }
.ktable td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.ktable td.desc { color: var(--text-soft); line-height: 1.5; }
kbd {
  font-family: var(--font-mono); font-size: .8rem; padding: 3px 7px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border-strong); box-shadow: 0 1px 0 var(--border-strong);
  color: var(--text); white-space: nowrap;
}

/* spec list (requirements) */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(32px, 5vw, 64px); margin-top: 28px; }
.spec { display: flex; justify-content: space-between; gap: 18px; padding: 15px 0; border-top: 1px solid var(--border); }
.spec dt { color: var(--text-mute); font-size: .92rem; }
.spec dd { color: var(--text); font-weight: 500; text-align: right; font-size: .94rem; }

/* small print note */
.note { margin-top: 22px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font-size: .92rem; line-height: 1.6; }
.note b { color: var(--text); }

/* long-form legal / prose pages */
.prose { max-width: 72ch; margin-top: clamp(28px, 4vw, 44px); }
.prose h2 {
  font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .8vw, 1.45rem);
  letter-spacing: -0.015em; line-height: 1.2; font-weight: 600;
  margin-top: clamp(28px, 4vw, 40px);
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 12px; color: var(--text-soft); line-height: 1.7; }
.prose ul { margin-top: 12px; padding-left: 22px; color: var(--text-soft); line-height: 1.7; }
.prose li { margin-top: 6px; }
.prose li b, .prose p b { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-strong); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
[data-theme="dark"] .prose a { color: var(--accent); }
.prose a:hover { border-bottom-color: currentColor; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text); }

@media (max-width: 900px) {
  .phero { grid-template-columns: 1fr; }
  .phero .showcase { order: -1; }
  .feature, .feature--wide, .feature--lead { grid-column: 1 / -1; }
  .feature--lead { grid-template-columns: auto 1fr; }
  .split, .split--rev { grid-template-columns: 1fr; }
  .split--rev .split-media, .split .split-media { order: 0; }
  .specs { grid-template-columns: 1fr; }
}

/* ============================================================================
   Account + Admin
   ============================================================================ */
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.account-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.account-actions form { margin: 0; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-mute);
}
.badge--on { color: #2FBF71; border-color: rgba(47,191,113,.4); background: rgba(47,191,113,.1); }
.badge--accent { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
[data-theme="dark"] .badge--accent { color: var(--accent); }
.badge--warn { color: #C2871B; border-color: rgba(194,135,27,.4); background: rgba(194,135,27,.1); }
[data-theme="dark"] .badge--warn { color: #E0A93C; }

/* entitlements (account) */
.entitlements { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 20px; }
.ent {
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: clamp(22px, 2.6vw, 28px); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elev);
}
.ent.is-off { opacity: .72; }
.ent-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ent-top h3 { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -0.015em; }
.ent p { margin-top: 10px; color: var(--text-soft); line-height: 1.5; font-size: .95rem; }

/* flash */
.flash { margin-top: 24px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--border); }
.flash--ok { background: rgba(47,191,113,.08); border-color: rgba(47,191,113,.35); }
.flash--err { background: rgba(214,69,69,.08); border-color: rgba(214,69,69,.35); }
.flash p { color: var(--text); font-size: .95rem; }
.copyrow { display: flex; gap: 8px; margin-top: 12px; }
.copyrow input {
  flex: 1; padding: .6em .8em; font-family: var(--font-mono); font-size: .82rem;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text);
}
.copyrow .btn { flex: none; }

/* panel (create user) */
.panel { margin-top: 28px; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-elev); }
.panel--danger { border-color: rgba(214,69,69,.35); background: rgba(214,69,69,.04); }
.panel .h3 { margin-bottom: 18px; }
.create-form .cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.create-form .field { margin-top: 0; }
.cf-apps { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; }
.cf-legend { font-size: .9rem; color: var(--text-soft); font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .94rem; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check--sep { margin-left: auto; padding-left: 16px; border-left: 1px solid var(--border); color: var(--text-soft); }
.create-form > .btn { margin-top: 22px; }

/* users table */
.utable-wrap { margin-top: 30px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; overflow-x: auto; background: var(--bg-elev); }
.utable { width: 100%; border-collapse: collapse; min-width: 640px; }
.utable th, .utable td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--border); vertical-align: top; }
.utable thead th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); font-weight: 500; background: var(--surface); }
.utable tbody tr:last-child td { border-bottom: 0; }
.ta-r { text-align: right; }
.u-id { display: flex; flex-direction: column; gap: 2px; }
.u-email { font-weight: 500; color: var(--text); }
.u-name { font-size: .86rem; color: var(--text-mute); }
.u-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggles form { margin: 0; }
.toggle {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .02em;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: transparent; border: 1px dashed var(--border-strong); color: var(--text-mute); cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.toggle:hover { color: var(--text); border-color: var(--text-mute); }
.toggle.is-on { background: var(--accent-soft); border-style: solid; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-strong); }
[data-theme="dark"] .toggle.is-on { color: var(--accent); }
.toggle.is-on::before { content: "\2713\00a0"; }

.row-actions { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.row-actions form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-size: .88rem; color: var(--text-soft); font-weight: 500; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn--danger { color: #C24141; }
.link-btn--danger:hover { color: #C24141; }

@media (max-width: 680px) {
  .create-form .cf-row { grid-template-columns: 1fr; }
  .check--sep { margin-left: 0; border-left: 0; padding-left: 0; }
}

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================================
   Network band — full-bleed "futuristic" hero. A live canvas constellation
   sits behind the copy; it's cursor- and scroll-reactive (see app.js).
   The band is intentionally dark in BOTH themes — a deliberate "tech" surface.
   ============================================================================ */
.netband {
  position: relative;
  isolation: isolate;
  overflow: hidden;            /* section is already full-width; clip the glows */
  padding-block: clamp(104px, 17vw, 208px);
  background:
    radial-gradient(125% 95% at 82% 8%,  rgba(139, 92, 246, .20), transparent 55%),
    radial-gradient(115% 95% at 10% 96%, rgba(255, 106, 61, .18), transparent 55%),
    linear-gradient(180deg, #0A0A0D 0%, #100F16 55%, #0B0B0F 100%);
  border-block: 1px solid rgba(255, 255, 255, .07);
  color: #F4F3EF;
}
/* the live canvas, painted behind the copy */
.netband__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; z-index: 0;
  pointer-events: none;       /* the section captures the pointer, not the canvas */
}
/* faint scanline grid + top/bottom vignette for depth */
.netband::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,10,13,.55) 0%, transparent 22%, transparent 78%, rgba(10,10,13,.65) 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 44px);
  mask-image: radial-gradient(140% 100% at 50% 50%, #000 60%, transparent 100%);
}
.netband .container { position: relative; z-index: 1; }
.netband__inner { max-width: 40ch; }

.netband .eyebrow { color: #C9A8FF; }
.netband__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-top: 16px;
}
.netband__title .grad {
  background: linear-gradient(105deg, var(--accent) 0%, #FF9A6B 28%, #C9A8FF 70%, var(--tc-violet) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.netband__lead {
  margin-top: 22px;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  color: rgba(244, 243, 239, .72);
}
.netband__cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }
/* buttons inside the dark band: keep ember primary, lighten the ghost */
.netband .btn--ghost {
  border-color: rgba(255,255,255,.22); color: #F4F3EF; background: rgba(255,255,255,.02);
}
.netband .btn--ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }

/* little legend tying the visual to the products */
.netband__legend {
  margin-top: 40px; display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .02em;
  color: rgba(244,243,239,.6);
}
.netband__legend span { display: inline-flex; align-items: center; gap: 8px; }
.netband__legend i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 10px currentColor;
}
.netband__legend .d-ember  { color: var(--accent); background: var(--accent); }
.netband__legend .d-violet { color: var(--tc-violet); background: var(--tc-violet); }

@media (max-width: 680px) {
  .netband__legend { gap: 16px; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero .showcase { order: -1; }
  .product, .product--reverse { grid-template-columns: 1fr; }
  .product--reverse .product-media, .product .product-media { order: 0; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav { display: none; }
  .nav-toggle {
    display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: var(--r-pill); border: 1px solid var(--border);
    background: transparent; color: var(--text); cursor: pointer;
  }
  .site-header.nav-open { background: var(--bg); }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px; gap: 2px;
  }
  .nav.is-open a { padding: 12px; font-size: 1rem; }
}

/* ============================================================================
   Consent checkbox + visible legal links (register / forms)
   ============================================================================ */
/* A consent row is NOT a text field — opt it out of the .field input box styling
   so the checkbox stays a small native checkbox instead of a full-width box with
   a large focus ring. */
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; cursor: pointer; }
.consent input[type="checkbox"] {
  flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0;
  padding: 0; border: 0; box-shadow: none; background: none;
  accent-color: var(--accent); cursor: pointer;
}
.consent input[type="checkbox"]:focus { box-shadow: none; }
.consent .consent-text { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--text-soft); }
/* Legal links read as links: accent colour + underline (global `a` strips these). */
.consent .consent-text a,
.legal-link {
  color: var(--accent-strong); text-decoration: underline;
  text-underline-offset: 2px; font-weight: 500;
}
.consent .consent-text a:hover,
.legal-link:hover { color: var(--accent); }

/* ============================================================================
   Show / hide password toggle (injected by app.js around input[type=password])
   ============================================================================ */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 2.7em; }
.pw-toggle {
  position: absolute; top: 0; right: 0; height: 100%; width: 2.7em;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: transparent; color: var(--text-mute);
  cursor: pointer; border-radius: var(--r-sm);
}
.pw-toggle:hover { color: var(--text-soft); }
.pw-toggle svg { width: 18px; height: 18px; display: block; }

/* ============================================================================
   Textarea fields (developer apply, etc.) — match the text-input look, and
   stop the user from freely drag-resizing the box out of the layout.
   ============================================================================ */
.field textarea {
  width: 100%; padding: 0.78em 0.9em;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); color: var(--text);
  font: inherit; line-height: 1.5; min-height: 120px; resize: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea::placeholder { color: var(--text-mute); }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea.textarea--lg { min-height: 168px; }

/* ============================================================================
   First-visit hero splash (Ember Node build-in). Shown once per browser via
   localStorage; never on repeat visits or with prefers-reduced-motion.
   ============================================================================ */
.ember-splash { display: none; }
.ember-splash.is-on {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 2000;
  background: radial-gradient(120% 120% at 50% 38%, #14100f 0%, #0b0809 42%, #060406 100%);
  opacity: 1; transition: opacity .6s var(--ease, ease);
}
.ember-splash.is-out { opacity: 0; pointer-events: none; }
.ember-splash svg { width: min(92vw, 1080px); height: auto; display: block; }
.ember-splash__skip {
  position: fixed; bottom: 26px; right: 26px; z-index: 2001;
  font: inherit; font-size: .9rem; cursor: pointer;
  padding: 8px 16px; border-radius: 8px;
  background: rgba(255,255,255,.06); color: #cfc9c2;
  border: 1px solid rgba(255,255,255,.16);
  transition: background .15s ease, color .15s ease;
}
.ember-splash__skip:hover { background: rgba(255,255,255,.13); color: #fff; }
html.intro-lock, html.intro-lock body { overflow: hidden; }
@keyframes drift {
  0%   { transform: translate(0,0); opacity: 0; }
  20%  { opacity: .55; }
  80%  { opacity: .35; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ember-splash, .ember-splash.is-on { display: none !important; }
}
