/* ==========================================================================
   PHOROS.SPACE — High-Contrast Dual-Theme Design System (Dark & Light)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-void: #070B14;
  --bg-surface: #0F172A;
  --bg-card: #131E33;
  --bg-visual: #0B1222;
  --bg-input: #09101E;
  --bg-nav: rgba(7, 11, 20, 0.88);

  --border-subtle: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.38);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --gold: #F0C264;
  --gold-soft: rgba(240, 194, 100, 0.16);
  --cyan: #38BDF8;
  --cyan-soft: rgba(56, 189, 248, 0.16);
  --crimson: #FB7185;
  --crimson-accent: #F43F5E;
  --crimson-soft: rgba(244, 63, 94, 0.18);

  --btn-primary-text: #060911;
  --code-bg: #080E1C;
  --code-text: #E2E8F0;
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.5);
  --svg-stroke-muted: #475569;
  --svg-text-muted: #94A3B8;
  --svg-panel-fill: #111C33;
}

[data-theme="light"] {
  --bg-void: #F8FAFC;
  --bg-surface: #EEF2F7;
  --bg-card: #FFFFFF;
  --bg-visual: #F1F5F9;
  --bg-input: #FFFFFF;
  --bg-nav: rgba(248, 250, 252, 0.9);

  --border-subtle: rgba(15, 23, 42, 0.14);
  --border-strong: rgba(15, 23, 42, 0.26);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #475569;

  --gold: #B47B14;
  --gold-soft: rgba(180, 123, 20, 0.12);
  --cyan: #0284C7;
  --cyan-soft: rgba(2, 132, 199, 0.12);
  --crimson: #E11D48;
  --crimson-accent: #E11D48;
  --crimson-soft: rgba(225, 29, 72, 0.12);

  --btn-primary-text: #FFFFFF;
  --code-bg: #0F172A;
  --code-text: #E2E8F0;
  --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.08);
  --svg-stroke-muted: #94A3B8;
  --svg-text-muted: #475569;
  --svg-panel-fill: #FFFFFF;
}

:root {
  --font-brand: 'Michroma', 'Space Grotesk', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-width: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-visual);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 20px;
}

.nav-brand { display: inline-flex; align-items: center; gap: 12px; }
.nav-brand img, .nav-brand svg { height: 36px; width: 36px; display: block; }
.nav-wordmark {
  font-family: var(--font-brand); font-weight: 400;
  font-size: 1.05rem; letter-spacing: 0.22em; color: var(--text-primary);
  -webkit-text-stroke: 0.45px currentColor;
}

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }

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

.ctrl-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.ctrl-pill:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer; border: 1px solid transparent; transition: all 0.2s ease;
}
.btn-primary { background: var(--gold); color: var(--btn-primary-text); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(229, 184, 92, 0.25); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-sm { padding: 8px 15px; font-size: 0.75rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 68px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-canvas-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 52px; align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  color: var(--text-secondary); letter-spacing: 0.07em; text-transform: uppercase;
}

.status-dots { display: inline-flex; gap: 5px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-crimson { background: var(--crimson-accent); }
.dot-gold { background: var(--gold); }
.dot-cyan { background: var(--cyan); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 700; line-height: 1.07; letter-spacing: -0.025em; margin: 22px 0;
}

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

.hero-lead {
  font-size: 1.06rem; color: var(--text-secondary);
  max-width: 530px; margin-bottom: 30px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Viewport Orbital ---------- */
.orbital-viewport {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.viewport-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
}

.pill-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--cyan-soft); color: var(--cyan);
  border: 1px solid var(--cyan);
}

/* Space viewport stays orbital dark for legibility of stars & limb */
.viewport-stage {
  position: relative; height: 270px; background: #070C18;
}
.viewport-stage canvas { width: 100%; height: 100%; display: block; }

.viewport-overlay-tl, .viewport-overlay-br {
  position: absolute; font-family: var(--font-mono); font-size: 0.7rem;
  color: #CBD5E1; pointer-events: none; padding: 12px 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.viewport-overlay-tl { top: 0; left: 0; }
.viewport-overlay-br { bottom: 0; right: 0; text-align: right; }

.viewport-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-subtle); background: var(--bg-surface);
}

.vtab {
  background: transparent; border: none; border-right: 1px solid var(--border-subtle);
  padding: 13px 10px; color: var(--text-muted); font-family: var(--font-mono);
  font-size: 0.72rem; cursor: pointer; transition: all 0.2s; text-align: center;
}
.vtab:last-child { border-right: none; }
.vtab strong { display: block; color: var(--text-primary); font-size: 0.76rem; margin-bottom: 2px; }
.vtab:hover { background: var(--bg-visual); }
.vtab.active { background: var(--cyan-soft); color: var(--cyan); box-shadow: inset 0 2.5px 0 var(--cyan); }
.vtab.active[data-regime="0"] { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 2.5px 0 var(--gold); }

/* ---------- Metrics Strip ---------- */
.metrics-strip {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 36px 0;
}
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.metric-item { border-left: 3px solid var(--border-strong); padding-left: 18px; }
.metric-item.gold { border-left-color: var(--gold); }
.metric-item.cyan { border-left-color: var(--cyan); }
.metric-item.crimson { border-left-color: var(--crimson-accent); }
.metric-big { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.metric-sub { font-size: 0.84rem; color: var(--text-secondary); margin-top: 5px; }

/* ---------- Sections ---------- */
section.section { padding: 96px 0; border-bottom: 1px solid var(--border-subtle); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 52px; }
.section-kicker {
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px;
}
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.85rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.12; }
.section-head p { color: var(--text-secondary); font-size: 1rem; max-width: 480px; justify-self: end; }

/* ---------- Bento Grid ---------- */
.bento-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.bento-card:hover { transform: translateY(-2px); border-color: var(--cyan); }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }

.bento-visual {
  background: var(--bg-visual);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; justify-content: center; min-height: 132px;
}
.bento-visual svg { width: 100%; max-height: 112px; display: block; }

.card-tag {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  display: inline-block; padding: 4px 10px; border-radius: 5px; margin-bottom: 12px;
}
.tag-gold { background: var(--gold-soft); color: var(--gold); }
.tag-cyan { background: var(--cyan-soft); color: var(--cyan); }
.tag-crimson { background: var(--crimson-soft); color: var(--crimson); }

.bento-card h3 { font-family: var(--font-display); font-size: 1.28rem; margin-bottom: 8px; color: var(--text-primary); }
.bento-card p { color: var(--text-secondary); font-size: 0.94rem; }

/* ---------- Gamme ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px; display: flex; flex-direction: column; gap: 22px;
  box-shadow: var(--shadow-card);
}
.product-card.core { border-top: 3.5px solid var(--gold); }
.product-card.deep { border-top: 3.5px solid var(--cyan); }
.product-schematic {
  background: var(--bg-visual); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 18px;
}
.product-schematic svg { width: 100%; height: auto; display: block; }
.product-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.product-header h3 { font-family: var(--font-brand); font-size: 1.28rem; letter-spacing: 0.08em; -webkit-text-stroke: 0.4px currentColor; }

.spec-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.spec-list li { font-size: 0.93rem; color: var(--text-secondary); padding-left: 18px; position: relative; }
.spec-list li strong { color: var(--text-primary); }
.spec-list li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }
.product-card.deep .spec-list li::before { color: var(--cyan); }

/* ---------- Missions ---------- */
.missions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mission-card {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 26px; box-shadow: var(--shadow-card);
}
.mission-num { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 10px; }
.mission-card h4 { font-family: var(--font-display); font-size: 1.12rem; margin-bottom: 10px; color: var(--text-primary); }
.mission-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* ---------- Intégration ---------- */
.interface-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 44px; align-items: center; }
.state-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.state-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.state-badge { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; min-width: 90px; padding-top: 2px; }

.code-panel {
  background: var(--code-bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card);
}
.code-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 18px; background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-family: var(--font-mono); font-size: 0.73rem; color: #CBD5E1;
}
.code-panel pre { padding: 20px; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.68; color: var(--code-text); overflow-x: auto; }
.k { color: #38BDF8; } .s { color: #F0C264; } .n { color: #FB7185; } .b { color: #C084FC; }

/* ---------- Brand Signature + NDA CTA ---------- */
.brand-banner { display: flex; justify-content: center; margin-bottom: 44px; }
.brand-banner .logo-variant {
  width: 100%; max-width: 460px; height: auto; display: block;
  border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-card);
}
[data-theme="dark"] .logo-light-only { display: none; }
[data-theme="light"] .logo-dark-only { display: none; }

.cta-box {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 48px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; align-items: center;
  box-shadow: var(--shadow-card);
}
.cta-box h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 2.8vw, 2.3rem); margin-bottom: 14px; }
.cta-box p { color: var(--text-secondary); margin-bottom: 22px; }

.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.92rem; outline: none;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--cyan); }
.form-note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
footer { padding: 36px 0; color: var(--text-muted); font-size: 0.85rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-content, .section-head, .interface-grid, .cta-box { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .span-7, .span-5, .span-6 { grid-column: span 12; }
  .missions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .grid-2, .metrics-row { grid-template-columns: 1fr; }
  .cta-box { padding: 28px 20px; }
}
