/* ============================================================
   EBR Technology — shared styles
   Dark, modern marketing landing + clean light document pages.
   No external dependencies (system font stack, inline SVG icons).
   ============================================================ */

:root {
  /* Brand */
  --accent:        #6d8bff;
  --accent-2:      #43e0c7;
  --brand-grad:    linear-gradient(135deg, #7c8cff 0%, #43e0c7 100%);

  /* Dark (landing) palette */
  --bg:            #0a0d17;
  --bg-2:          #0c1120;
  --surface:       #121829;
  --surface-2:     #182035;
  --card:          #131a2c;
  --card-border:   rgba(255, 255, 255, 0.08);
  --card-border-h: rgba(124, 140, 255, 0.45);
  --text:          #eef2f9;
  --muted:         #9aa6be;
  --muted-2:       #6b7794;

  /* Light (document) palette */
  --doc-bg:        #f5f7fb;
  --doc-surface:   #ffffff;
  --doc-text:      #1c2433;
  --doc-muted:     #586074;
  --doc-border:    #e5e9f1;
  --doc-accent:    #4256d0;

  /* Shape & motion */
  --radius:        16px;
  --radius-sm:     10px;
  --maxw:          1120px;
  --shadow:        0 18px 50px -20px rgba(0, 0, 0, 0.55);
  --shadow-doc:    0 10px 40px -18px rgba(40, 60, 120, 0.18);
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.accent-text {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   NAVIGATION  (shared, theme-aware via body class)
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-size: 1.12rem;
  text-decoration: none;
}
.brand .logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  font-weight: 800;
  color: #0a0d17;
  font-size: 0.95rem;
  box-shadow: 0 6px 18px -6px rgba(109, 139, 255, 0.7);
  flex: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  opacity: 0.82;
  transition: opacity 0.2s var(--ease);
}
.nav-links a:hover { opacity: 1; }

/* Dark nav (landing) */
body.landing .nav {
  background: rgba(10, 13, 23, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.landing .brand { color: var(--text); }
body.landing .nav-links a { color: var(--text); }

/* Light nav (docs) */
body.doc .nav {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: var(--doc-border);
}
body.doc .brand { color: var(--doc-text); }
body.doc .nav-links a { color: var(--doc-text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-grad);
  color: #08101f;
  box-shadow: 0 10px 28px -10px rgba(109, 139, 255, 0.65);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(109, 139, 255, 0.8); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--card-border-h); transform: translateY(-2px); }
.nav-links .btn { padding: 9px 18px; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
body.landing {
  background: var(--bg);
  color: var(--text);
}

/* Ambient hero glow */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(60% 55% at 22% 12%, rgba(109, 139, 255, 0.28), transparent 60%),
    radial-gradient(48% 50% at 82% 8%, rgba(67, 224, 199, 0.20), transparent 60%);
  filter: blur(8px);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 75%);
  z-index: -1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(124, 140, 255, 0.10);
  border: 1px solid rgba(124, 140, 255, 0.25);
  color: #c6d0f5;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 26px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(67, 224, 199, 0.18);
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 22px;
  max-width: 16ch;
}
.hero p.lead {
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.stat .num {
  font-size: 1.9rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.stat .label { color: var(--muted-2); font-size: 0.9rem; }

/* Section scaffolding */
.section { padding: 86px 0; }
.section-head { max-width: 60ch; margin-bottom: 54px; }
.section-head .kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px;
  font-weight: 780;
}
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }

/* Service / feature grid */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-h);
  background: linear-gradient(180deg, rgba(124,140,255,0.07), rgba(255,255,255,0.012));
}
.card .icon {
  width: 50px; height: 50px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(124, 140, 255, 0.12);
  border: 1px solid rgba(124, 140, 255, 0.22);
  margin-bottom: 20px;
  color: #b9c5ff;
}
.card .icon svg { width: 24px; height: 24px; }
.card h3 { margin: 0 0 10px; font-size: 1.22rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card ul {
  margin: 16px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.card ul li {
  font-size: 0.8rem;
  color: #c2cbe0;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 5px 11px;
  border-radius: 999px;
}

/* Work / app showcase cards */
.app-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.app-card:hover { transform: translateY(-4px); border-color: var(--card-border-h); }
.app-card .app-top { display: flex; align-items: center; gap: 16px; }
.app-icon {
  width: 58px; height: 58px;
  border-radius: 15px;
  display: grid; place-items: center;
  font-size: 1.7rem;
  flex: none;
  box-shadow: var(--shadow);
}
.app-card h3 { margin: 0; font-size: 1.3rem; letter-spacing: -0.01em; }
.app-card .tag { font-size: 0.85rem; color: var(--muted-2); }
.app-card p { margin: 0; color: var(--muted); font-size: 0.98rem; flex: 1; }
.app-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chip-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: #c6d0f5;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.chip-link:hover { border-color: var(--accent); color: #fff; background: rgba(124,140,255,0.1); }

/* Process steps */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.step {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  background: rgba(255,255,255,0.018);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 700;
}
.step h4 { margin: 14px 0 8px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* CTA band */
.cta {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 60px 48px;
  background:
    radial-gradient(80% 140% at 0% 0%, rgba(109,139,255,0.25), transparent 55%),
    radial-gradient(80% 140% at 100% 100%, rgba(67,224,199,0.22), transparent 55%),
    #0e1426;
  border: 1px solid rgba(124,140,255,0.2);
  text-align: center;
}
.cta h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 14px; letter-spacing: -0.03em; }
.cta p { color: var(--muted); font-size: 1.1rem; margin: 0 auto 30px; max-width: 52ch; }

/* Footer (shared) */
.footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 54px 0 40px;
  margin-top: 20px;
}
body.doc .footer { border-top-color: var(--doc-border); background: var(--doc-surface); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer .brand { margin-bottom: 16px; }
.footer-blurb { color: var(--muted); font-size: 0.94rem; max-width: 34ch; margin: 0; }
body.doc .footer-blurb { color: var(--doc-muted); }
.footer h5 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 6px 0 16px;
  color: var(--muted-2);
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer ul a { text-decoration: none; font-size: 0.92rem; opacity: 0.85; }
.footer ul a:hover { opacity: 1; color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.86rem;
  color: var(--muted-2);
}
body.doc .footer-bottom { border-top-color: var(--doc-border); }
body.landing .footer .brand { color: var(--text); }
body.doc .footer .brand { color: var(--doc-text); }
body.doc .footer h5 { color: var(--doc-muted); }

/* ============================================================
   DOCUMENT PAGES (privacy / support)
   ============================================================ */
body.doc {
  background: var(--doc-bg);
  color: var(--doc-text);
}
.doc-hero {
  padding: 56px 0 30px;
  border-bottom: 1px solid var(--doc-border);
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(109,139,255,0.07), transparent 60%),
    var(--doc-surface);
}
.doc-hero .crumbs {
  font-size: 0.85rem;
  color: var(--doc-muted);
  margin-bottom: 16px;
}
.doc-hero .crumbs a { color: var(--doc-accent); text-decoration: none; }
.doc-hero .crumbs a:hover { text-decoration: underline; }
.doc-hero .app-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.doc-hero .app-emoji {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.6rem; flex: none;
  box-shadow: var(--shadow-doc);
}
.doc-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.1;
}
.doc-hero .sub { color: var(--doc-muted); font-size: 1.02rem; margin: 6px 0 0; }
.updated {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--doc-muted);
  background: #eef1f8;
  border: 1px solid var(--doc-border);
  padding: 5px 13px;
  border-radius: 999px;
}

.doc-body { padding: 44px 0 70px; }
.doc-layout { display: grid; grid-template-columns: 230px 1fr; gap: 50px; align-items: start; }

/* sticky table of contents */
.toc {
  position: sticky;
  top: 90px;
  font-size: 0.9rem;
}
.toc h6 {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--doc-muted);
  margin: 0 0 14px;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a {
  display: block;
  text-decoration: none;
  color: var(--doc-muted);
  padding: 6px 12px;
  border-left: 2px solid var(--doc-border);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toc a:hover { color: var(--doc-accent); border-left-color: var(--doc-accent); }

.prose { max-width: 72ch; }
.prose h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 42px 0 14px;
  padding-top: 8px;
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.prose p { margin: 0 0 16px; color: #313a4d; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 9px; color: #313a4d; }
.prose strong { color: var(--doc-text); }
.prose a { color: var(--doc-accent); }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #eef1f8;
  border: 1px solid var(--doc-border);
  padding: 2px 6px;
  border-radius: 6px;
}

.callout {
  border: 1px solid var(--doc-border);
  border-left: 3px solid var(--doc-accent);
  background: #f0f3fb;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 0 24px;
}
.callout.warn { border-left-color: #e0a042; background: #fdf6ec; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { display: block; margin-bottom: 4px; }

/* Privacy "at a glance" summary table */
.glance {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 0.94rem;
  border: 1px solid var(--doc-border);
  border-radius: 12px;
  overflow: hidden;
}
.glance th, .glance td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--doc-border);
  vertical-align: top;
}
.glance th { background: #f2f5fb; font-weight: 650; width: 38%; }
.glance tr:last-child td, .glance tr:last-child th { border-bottom: none; }

.faq { border-top: 1px solid var(--doc-border); margin-top: 8px; }
.faq details {
  border-bottom: 1px solid var(--doc-border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 36px 16px 4px;
  font-weight: 600;
  font-size: 1.02rem;
  position: relative;
  color: var(--doc-text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--doc-accent);
  transition: transform 0.2s var(--ease);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { color: var(--doc-accent); }
.faq .faq-a { padding: 0 4px 18px; color: #313a4d; }
.faq .faq-a p { margin: 0 0 12px; }
.faq .faq-a p:last-child { margin-bottom: 0; }

.contact-card {
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 28px;
  box-shadow: var(--shadow-doc);
}
.contact-card h3 { margin: 0 0 8px; }
.contact-card p { margin: 0 0 14px; color: var(--doc-muted); }
.contact-card a.email {
  font-weight: 650;
  color: var(--doc-accent);
  text-decoration: none;
  font-size: 1.05rem;
}
.contact-card a.email:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; top: 0; }
  .toc { display: none; }
}
@media (max-width: 620px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding: 64px 0 56px; }
  .section { padding: 60px 0; }
  .cta { padding: 44px 24px; }
  .stats { gap: 26px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
