/* ==========================================================================
   Tengar — site theme
   Self-contained. Mirrors the THENGA "Cyber Elegance" palette so the
   marketing site and the app share one visual identity, but tuned for
   long-form reading: larger line-height, capped measure, calmer accents.
   ========================================================================== */

:root {
  /* Brand palette — kept in sync with index.css in the app */
  --cyber-cyan: #00f0ff;
  --cyber-purple: #b026ff;
  --cyber-pink: #ff006e;
  --cyber-green: #39ff14;
  --cyber-dark: #0a0e27;

  /* Deeper surface tones derived from the base dark */
  --surface-0: #060915;
  --surface-1: #0a0e27;
  --surface-2: #111634;
  --surface-3: #1a2049;

  /* Text */
  --ink: #eef1ff;
  --ink-dim: #b9c0e8;
  --ink-mute: #8891c4;

  /* Accents */
  --gold: #f5c451;
  --accent: var(--cyber-cyan);
  --accent-2: var(--cyber-purple);

  /* Lines + glass */
  --line: rgba(0, 240, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --glass: rgba(17, 22, 52, 0.55);

  --radius: 18px;
  --radius-lg: 28px;
  --measure: 68ch;

  --shadow-cyan: 0 0 0 1px rgba(0, 240, 255, 0.22), 0 18px 48px -22px rgba(0, 240, 255, 0.45);
  --shadow-lift: 0 24px 60px -28px rgba(0, 0, 0, 0.85);

  --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.5rem + 2.9vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.7vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.15em; max-width: var(--measure); color: var(--ink-dim); }
p:last-child { margin-bottom: 0; }

ul, ol { color: var(--ink-dim); max-width: var(--measure); }
li { margin-bottom: 0.45em; }

strong { color: var(--ink); font-weight: 600; }

code, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

/* ------------------------------------------------------------ utilities */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.center { text-align: center; }
.center p, .center h2, .center h3 { margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.center .eyebrow { justify-content: center; }

.lede {
  font-size: clamp(1.05rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-dim);
}

.muted { color: var(--ink-mute); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8rem; }

.accent { color: var(--accent); }
.gold { color: var(--gold); }

.grad-text {
  background: linear-gradient(100deg, var(--accent) 0%, #ffffff 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------- layout */
.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1.05fr 0.95fr; }
  .split--reverse > :first-child { order: 2; }
}

/* --------------------------------------------------------------- panels */
.card {
  position: relative;
  padding: clamp(1.4rem, 2.5vw, 2rem);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow-cyan);
}
.card h3 { margin-bottom: 0.5rem; }

/* Corner ticks — signature detail from the app's cyber-card treatment */
.card--ticked::before,
.card--ticked::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  opacity: 0.7;
}
.card--ticked::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.card--ticked::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(0, 240, 255, 0.16), rgba(176, 38, 255, 0.16));
  font-size: 1.35rem;
}

/* ---------------------------------------------------------- stat blocks */
.stat {
  padding: 1.35rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(17, 22, 52, 0.75), rgba(10, 14, 39, 0.5));
  text-align: center;
}
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--accent), #fff 55%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-mute);
  line-height: 1.45;
}

/* --------------------------------------------------------------- button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn--primary {
  color: #04121a;
  background: linear-gradient(120deg, var(--cyber-cyan), #7ef7ff);
  box-shadow: 0 0 28px -8px rgba(0, 240, 255, 0.75);
}
.btn--primary:hover { box-shadow: 0 0 40px -6px rgba(0, 240, 255, 0.9); }

.btn--ghost {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

/* ---------------------------------------------------------------- badge */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 240, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.badge--warn { border-color: rgba(245, 196, 81, 0.4); background: rgba(245, 196, 81, 0.1); color: var(--gold); }

/* ------------------------------------------------------------ note callout */
.note {
  padding: 1.15rem 1.35rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(245, 196, 81, 0.07);
  font-size: 0.925rem;
  color: var(--ink-dim);
}
.note strong { color: var(--gold); }

/* ----------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 9, 21, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 70px;
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.brand__sub {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--accent); background: rgba(0, 240, 255, 0.1); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    inset: 70px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem var(--gutter) 1.25rem;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(6, 9, 21, 0.97);
    display: none;
  }
  .nav[data-open='true'] { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; border-radius: 8px; }
}

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding-block: clamp(4rem, 11vw, 8.5rem) clamp(3.5rem, 9vw, 6.5rem);
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

/* Grid + glow backdrop */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  top: -28%;
  left: 50%;
  width: min(900px, 130vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15), rgba(176, 38, 255, 0.07) 42%, transparent 66%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero h1 { margin-bottom: 0.5em; }
.hero__lede { font-size: clamp(1.08rem, 1rem + 0.55vw, 1.35rem); }

/* Floating product chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2.25rem; }
.chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 39, 0.7);
  font-size: 0.82rem;
  color: var(--ink-dim);
}
.chip b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ strip */
.strip {
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-1);
  padding-block: 2.5rem;
}

/* ---------------------------------------------------------------- section */
.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow { justify-content: center; }

/* Numbered process */
.steps { counter-reset: step; display: grid; gap: 1.1rem; }
.step {
  position: relative;
  padding-left: 3.4rem;
  counter-increment: step;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(0, 240, 255, 0.14), rgba(176, 38, 255, 0.14));
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}
.step h3 { margin-bottom: 0.35rem; }

/* Feature list with ticks */
.ticks { list-style: none; padding: 0; }
.ticks li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.8rem;
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px -2px var(--accent);
}

/* Table (evidence pages) */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--glass);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  min-width: 520px;
}
th, td { padding: 0.85rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
td { color: var(--ink-dim); }
td:first-child { color: var(--ink); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(0, 240, 255, 0.04); }

/* --------------------------------------------------------------- accordion */
.acc { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--glass); overflow: hidden; }
.acc details { border-bottom: 1px solid var(--line-soft); }
.acc details:last-child { border-bottom: 0; }
.acc summary {
  padding: 1.1rem 1.35rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent);
  transition: transform 0.25s ease;
}
.acc details[open] summary::after { transform: rotate(45deg); }
.acc .acc__body { padding: 0 1.35rem 1.35rem; }
.acc .acc__body > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- forms */
/* Honeypot field: off-screen and unreachable by keyboard so no real visitor
   can fill it, while a bot that screenscrapes every input will. It must stay
   literally invisible to a human (no clip tricks that leave a focusable zone). */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(6, 9, 21, 0.7);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.14);
}
.field textarea { min-height: 130px; resize: vertical; }
.field__hint { margin-top: 0.35rem; font-size: 0.8rem; color: var(--ink-mute); }

.form-note {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  font-size: 0.85rem;
  color: var(--ink-mute);
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  margin-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--line-soft);
  background: var(--surface-1);
  padding-block: clamp(2.5rem, 5vw, 4rem) 2rem;
}
.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.site-footer h4 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--ink-dim); font-size: 0.9rem; }
.site-footer a:hover { color: var(--accent); }

.site-footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------- reveal */
/* Gated on <html class="js"> so that if JavaScript is disabled, blocked or
   throws, every block below is still fully visible. Never hide content that
   only JavaScript can un-hide. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Emergency net. The inline head bootstrap arms a timer that adds this class if
   assets/js/site.js never reports in (blocked, 404, parse error). It makes all
   reveal content visible regardless of animation state. */
.reveal-fallback .reveal,
.reveal-fallback .reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------ skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* -------------------------------------------------------- print styles */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .nav-toggle, .btn { display: none !important; }
  .card, .stat, .table-wrap { border-color: #ccc; background: #fff; box-shadow: none; }
  a { color: #000; }
}
