/* ==========================================================================
   XYVAE — Design System
   "Executive Intelligence Briefing" — dark ink ground, warm paper panels,
   teal-green as the decisive accent, gold for emphasis, muted violet
   reserved strictly for AI/intelligence callouts.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,450;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* --- Ground --- */
  --ink-950: #0a0e17;
  --ink-900: #0d1321;
  --ink-800: #131b2e;
  --ink-700: #1b2740;
  --ink-line: #26314d;

  /* --- Paper (content panels) --- */
  --paper-100: #f6f2e9;
  --paper-200: #eee7d8;
  --paper-ink: #1c1a15;
  --paper-muted: #6b6355;

  /* --- Accents --- */
  --teal-500: #2fa090;
  --teal-400: #45c2b0;
  --teal-700: #1c6459;
  --teal-glow: rgba(69, 194, 176, 0.18);
  --gold-500: #c9a24b;
  --gold-400: #e0be6c;
  --violet-500: #8b7bc7;
  --violet-glow: rgba(139, 123, 199, 0.16);
  --rust-700: #a8451f;

  /* --- Text on ink --- */
  --text-hi: #f3f0e6;
  --text-mid: #a9b2c6;
  --text-low: #6f7890;

  /* --- Type --- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* --- Rhythm --- */
  --edge: 1px solid var(--ink-line);
  --radius: 3px;
  --container: 1180px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.1; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* Background texture: faint grid + radial vignette, gives the "briefing room" depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(69, 194, 176, 0.08), transparent 60%),
    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: auto, 64px 64px, 64px 64px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-400);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--teal-400);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: var(--edge);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-hi);
}
.brand em {
  font-style: normal;
  color: var(--teal-400);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 14.5px;
  color: var(--text-mid);
}
.nav-links a { transition: color .2s ease; position: relative; }
.nav-links a:hover { color: var(--text-hi); }
.nav-links a.current { color: var(--text-hi); }
.nav-links a.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -27px;
  height: 2px;
  background: var(--teal-400);
}
.nav-cta {
  padding: 10px 20px;
  border: 1px solid var(--teal-500);
  border-radius: var(--radius);
  color: var(--teal-400) !important;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: all .2s ease;
}
.nav-cta:hover {
  background: var(--teal-500);
  color: var(--ink-950) !important;
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  color: var(--text-hi);
  font-size: 18px;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: var(--teal-500); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 3px;
}
.lang-switch a {
  padding: 5px 9px;
  border-radius: 2px;
  color: var(--text-low);
  transition: all .15s ease;
}
.lang-switch a:hover { color: var(--text-hi); }
.lang-switch a.current {
  background: var(--teal-glow);
  color: var(--teal-400);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all .2s ease;
}
.btn-primary {
  background: var(--teal-500);
  color: var(--ink-950);
}
.btn-primary:hover { background: var(--teal-400); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--ink-line);
  color: var(--text-hi);
}
.btn-ghost:hover { border-color: var(--teal-500); color: var(--teal-400); }
.btn-gold {
  background: var(--gold-500);
  color: var(--ink-950);
}
.btn-gold:hover { background: var(--gold-400); }

/* ---------- Sections ---------- */
section { padding: 72px 0; position: relative; }
section.tight { padding: 48px 0; }
.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;
}
.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(30px, 4vw, 42px);
  margin-top: 18px;
  color: var(--text-hi);
}
.section-head p {
  margin-top: 18px;
  color: var(--text-mid);
  font-size: 17px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 84px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  margin-top: 22px;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}
.hero h1 .accent { color: var(--teal-400); font-style: italic; }
.hero .lede {
  margin-top: 26px;
  font-size: 19px;
  color: var(--text-mid);
  max-width: 52ch;
}
.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Decorative "console" panel used on hero / architecture visuals */
.console {
  background: var(--ink-800);
  border: var(--edge);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: var(--edge);
  background: var(--ink-700);
}
.console-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-line); }
.console-label {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-low);
  letter-spacing: 0.05em;
}
.console-body { padding: 22px 20px; }
.stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  margin-bottom: 8px;
  background: var(--ink-900);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-mid);
}
.stack-row:last-child { margin-bottom: 0; }
.stack-row .tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}
.tag-teal { background: var(--teal-glow); color: var(--teal-400); }
.tag-gold { background: rgba(201,162,75,0.16); color: var(--gold-400); }
.tag-violet { background: var(--violet-glow); color: var(--violet-500); }

/* ---------- Paper panel (content card on ink ground) ---------- */
.panel {
  background: var(--paper-100);
  color: var(--paper-ink);
  border-radius: 4px;
  padding: 40px;
}
.panel .eyebrow { color: var(--teal-500); }
.panel h3 { color: var(--paper-ink); }
.panel p { color: var(--paper-muted); }
.panel .field label { color: var(--paper-muted); }
.panel .form-status.ok { color: var(--teal-700); }
.panel .form-status.err { color: var(--rust-700); }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ink-800);
  border: var(--edge);
  border-radius: 5px;
  padding: 32px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--teal-500); transform: translateY(-3px); }
.card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal-400);
  letter-spacing: 0.1em;
}
.card h3 {
  font-size: 21px;
  color: var(--text-hi);
  margin-top: 14px;
}
.card p {
  margin-top: 12px;
  color: var(--text-mid);
  font-size: 15px;
}
.card.violet:hover { border-color: var(--violet-500); }
.card.violet .num { color: var(--violet-500); }

/* ---------- Stat strip ---------- */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--edge);
  border-bottom: var(--edge);
}
.stat {
  padding: 36px 28px;
  border-right: var(--edge);
}
.stat:last-child { border-right: none; }
.stat .figure {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--gold-400);
}
.stat .label {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-mid);
}

/* ---------- Roadmap / timeline (used on platform.html) ---------- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-top: var(--edge);
}
.timeline-item:first-child { border-top: none; }
.timeline-phase {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal-400);
  letter-spacing: 0.06em;
}
.timeline-phase .status {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-low);
}
.timeline-item h3 { font-size: 24px; color: var(--text-hi); }
.timeline-item p { margin-top: 10px; color: var(--text-mid); max-width: 60ch; }
.timeline-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.timeline-tags span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1px solid var(--ink-line);
  border-radius: 20px;
  color: var(--text-mid);
}

/* ---------- Solution rows (used on solutions.html) ---------- */
.solution-list { display: flex; flex-direction: column; }
.solution-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 44px 0;
  border-top: var(--edge);
}
.solution-row:first-child { border-top: none; }
.solution-row .idx {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal-400);
  letter-spacing: 0.06em;
}
.solution-row h3 { font-size: 25px; color: var(--text-hi); margin-top: 4px; }
.solution-row .desc { margin-top: 12px; color: var(--text-mid); max-width: 68ch; }
.solution-row .caps {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.solution-row .caps span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1px solid var(--ink-line);
  border-radius: 20px;
  color: var(--text-mid);
}
@media (max-width: 900px) {
  .solution-row { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Quote / mission block ---------- */
.mission {
  border-left: 3px solid var(--teal-500);
  padding-left: 32px;
}
.mission p {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 450;
  color: var(--paper-ink);
  line-height: 1.4;
}

/* ---------- Footer ---------- */
footer {
  border-top: var(--edge);
  padding: 56px 0 40px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-mid);
}
.footer-links a:hover { color: var(--teal-400); }
.footer-meta {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-low);
  font-family: var(--font-mono);
}

/* ---------- Forms (contact + admin) ---------- */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--ink-800);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 15px;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.form-status { margin-top: 16px; font-size: 14px; font-family: var(--font-mono); }
.form-status.ok { color: var(--teal-400); }
.form-status.err { color: #d97757; }

/* ---------- Reveal-on-load animation ---------- */
.reveal { opacity: 0; transform: translateY(16px); animation: reveal .7s ease forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-800);
  border: 1px solid var(--ink-line);
  color: var(--teal-400);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, border-color .2s ease, background .2s ease;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.5);
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  border-color: var(--teal-500);
  background: var(--teal-500);
  color: var(--ink-950);
}
@media (max-width: 600px) {
  #back-to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink-900);
    border-bottom: var(--edge);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 32px; }
  .nav-links a.current::after { display: none; }
  .nav-links a.current { color: var(--teal-400); }
  .lang-switch { margin: 12px 32px; align-self: flex-start; }
  .nav-cta { margin: 4px 32px 20px; text-align: center; }
}
@media (max-width: 600px) {
  section { padding: 52px 0; }
  section.tight { padding: 36px 0; }
  .hero { padding: 32px 0 40px !important; }
  .nav-inner { height: 60px; }
  .container { padding: 0 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: var(--edge); }
  .stat { padding: 24px 20px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}
