/*
 * zeroCORE Design System
 * ──────────────────────
 * Shared CSS for landing page and app dashboard.
 *
 * Usage:
 *   <link rel="stylesheet" href="/assets/css/zerocore.css">
 *
 * This file provides:
 *   1. CSS custom properties (design tokens)
 *   2. Base typography and reset
 *   3. Layout primitives
 *   4. Component classes
 *   5. Utility classes
 *   6. Responsive breakpoints
 *
 * See DESIGN_GUIDE.md for full documentation.
 */


/* ═══════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════ */

:root {
  /* ── Brand ── */
  --z:    #00E5C3;                     /* Zero Teal — primary accent            */
  --zdim: rgba(0, 229, 195, 0.10);    /* Teal tint — subtle backgrounds        */
  --zmid: rgba(0, 229, 195, 0.20);    /* Teal mid — borders, active states     */
  --zglo: rgba(0, 229, 195, 0.04);    /* Teal glow — very faint bg wash        */

  /* ── Surfaces (layered depth, darkest → lightest) ── */
  --ink:  #06101A;                     /* Page background                       */
  --c1:   #0B1C2B;                     /* Card background                       */
  --c2:   #102333;                     /* Elevated card / featured              */
  --c3:   #1A3045;                     /* Borders, dividers                     */
  --rule: #1E3A52;                     /* Subtle rule lines                     */

  /* ── Text (brightest → dimmest) ── */
  --wh:   #EBF5FF;                     /* Bright white — headlines, brand       */
  --t1:   #D0E8F7;                     /* Primary text — body, important        */
  --t2:   #89B5CC;                     /* Secondary text — descriptions         */
  --t3:   #4A7A96;                     /* Muted — labels, captions, metadata    */

  /* ── Semantic ── */
  --am:   #FFB547;                     /* Peak Amber — earnings, export prices  */
  --adim: rgba(255, 181, 71, 0.10);
  --rd:   #FF5A6E;                     /* Alert Red — errors, warnings, costs   */
  --rdim: rgba(255, 90, 110, 0.09);

  /* ── Spacing scale (4px base) ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 64px;
  --sp-11: 80px;
  --sp-12: 100px;

  /* ── Layout ── */
  --max-w: 1100px;
  --max-w-narrow: 720px;
  --page-pad: 40px;

  /* ── Typography ── */
  --font-brand: 'Orbitron', sans-serif;
  --font-body: 'Epilogue', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', 'Fira Code', monospace;

  /* ── Transitions ── */
  --ease: 0.15s ease;
}

@media (max-width: 600px) {
  :root {
    --page-pad: 20px;
  }
}


/* ═══════════════════════════════════════════
   2. RESET & BASE TYPOGRAPHY
   ═══════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  background: var(--ink);
  color: var(--t1);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Heading scale ── */
h1, h2, h3, h4 {
  color: var(--wh);
  line-height: 1.1;
}

h1 {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h3 {
  font-family: var(--font-brand);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--z);
}

/* ── Links ── */
a {
  color: var(--z);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover {
  color: var(--wh);
}


/* ═══════════════════════════════════════════
   3. LAYOUT PRIMITIVES
   ═══════════════════════════════════════════ */

.w {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  position: relative;
  z-index: 1;
}

.w-narrow {
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  position: relative;
  z-index: 1;
}


/* ═══════════════════════════════════════════
   4. COMPONENTS
   ═══════════════════════════════════════════ */

/* ── Brand display ──
   Use for large hero brand marks. Always:
   Zero<span class="brand-accent">CORE</span>
*/
.brand-display {
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 0.9;
  color: var(--wh);
}
.brand-accent {
  color: var(--z);
}
.brand-text {
  font-family: var(--font-brand);
  font-variant: small-caps;
  font-variant-caps: all-small-caps;
  font-weight: 800;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 var(--page-pad);
  background: rgba(6, 16, 26, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c3);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-left {
  display: flex;
  align-items: center;
}
.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-family: var(--font-brand);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--wh);
  text-decoration: none;
  line-height: 1;
}
.nav-logo-text span {
  color: var(--z);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-7);
  list-style: none;
}
.nav-links a {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t2);
  text-decoration: none;
  transition: color var(--ease);
}
.nav-links a:hover {
  color: var(--z);
}
.nav-links .nav-cta,
a.nav-cta {
  color: var(--ink) !important;
  background: var(--z);
  padding: 10px 22px;
  font-weight: 500;
}
.nav-links .nav-cta:hover,
a.nav-cta:hover {
  opacity: 0.85;
  color: var(--ink) !important;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--z);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 32px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity var(--ease), transform var(--ease);
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: var(--ink);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--t1);
  border: 1px solid var(--c3);
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 32px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.btn-outline:hover {
  border-color: var(--z);
  color: var(--z);
}

/* Nav CTA standalone (outside .nav-links) inherits from .nav-links .nav-cta above */

/* ── Tags / Badges ── */
.tag {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid;
  white-space: nowrap;
  display: inline-block;
}
.tag-teal {
  background: var(--zdim);
  color: var(--z);
  border-color: var(--zmid);
}
.nav-logo .nav-tagline {
  font-family: var(--font-brand);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t2);
  white-space: nowrap;
}
.tag-amber {
  background: var(--adim);
  color: var(--am);
  border-color: rgba(255, 181, 71, 0.3);
}
.tag-red {
  background: var(--rdim);
  color: var(--rd);
  border-color: rgba(255, 90, 110, 0.2);
}
.tag-muted {
  background: rgba(30, 48, 80, 0.5);
  color: var(--t3);
  border-color: var(--c3);
}

/* ── Cards ── */
.card {
  background: var(--c1);
  border: 1px solid var(--c3);
  padding: var(--sp-5) var(--sp-6);
}
.card-featured {
  background: var(--c2);
  border-color: var(--zmid);
}

/* ── Callout boxes ── */
.box {
  border-left: 2px solid var(--z);
  background: var(--zglo);
  padding: 17px 22px;
}
.box-amber {
  border-left-color: var(--am);
  background: var(--adim);
}
.box-red {
  border-left-color: var(--rd);
  background: var(--rdim);
}

/* ── Data grid ── */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--c3);
  border: 1px solid var(--c3);
}
.data-cell {
  background: var(--c1);
  padding: 18px;
  text-align: center;
}

/* ── Metrics ── */
.metric-value {
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 800;
  color: var(--z);
  letter-spacing: -0.02em;
  line-height: 1;
}
.metric-value.amber {
  color: var(--am);
}
.metric-value.red {
  color: var(--rd);
}
.metric-label {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  margin-top: var(--sp-1);
}

/* ── Action badges (battery states) ── */
.act {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid;
  white-space: nowrap;
  display: inline-block;
}
.act-charge {
  background: rgba(0, 229, 195, 0.12);
  color: var(--z);
  border-color: var(--zmid);
}
.act-export {
  background: rgba(255, 181, 71, 0.12);
  color: var(--am);
  border-color: rgba(255, 181, 71, 0.3);
}
.act-hold {
  background: rgba(51, 88, 112, 0.20);
  color: var(--t3);
  border-color: var(--rule);
}
.act-plan {
  background: rgba(0, 85, 238, 0.12);
  color: var(--t2);
  border-color: rgba(0, 85, 238, 0.2);
}

/* ── Section pattern (landing page) ── */
section {
  padding: var(--sp-12) 0;
  border-top: 1px solid var(--c3);
}
.section-label {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--z);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--z);
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--wh);
  line-height: 1.1;
  margin-bottom: var(--sp-5);
}
.section-title span {
  color: var(--z);
}
.section-body {
  font-size: 18px;
  color: var(--t2);
  max-width: 580px;
  line-height: 1.75;
  margin-bottom: var(--sp-8);
  font-weight: 400;
}

/* ── Ambient background orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(140px);
  opacity: 0.06;
}
.orb-1 {
  width: 800px; height: 800px;
  background: var(--z);
  top: -300px; right: -200px;
}
.orb-2 {
  width: 500px; height: 500px;
  background: #0055EE;
  bottom: 0; left: -150px;
}
.orb-3 {
  width: 400px; height: 400px;
  background: var(--am);
  opacity: 0.03;
  bottom: 40%; right: 10%;
}


/* ═══════════════════════════════════════════
   5. UTILITY CLASSES
   ═══════════════════════════════════════════ */

/* Text colours */
.text-teal   { color: var(--z); }
.text-amber  { color: var(--am); }
.text-red    { color: var(--rd); }
.text-muted  { color: var(--t3); }
.text-body   { color: var(--t2); }
.text-bright { color: var(--wh); }

/* Font families */
.font-mono {
  font-family: var(--font-mono);
}

/* Label style (brand font, small, uppercase) */
.label {
  font-family: var(--font-brand);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}


/* ═══════════════════════════════════════════
   6. ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════
   7. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════

   Breakpoints:
   - Mobile:  ≤ 600px
   - Tablet:  ≤ 800px
   - Desktop: > 800px

   Nav links hide at ≤ 800px.
   Mobile CTA shows at ≤ 580px.
   Page padding shrinks at ≤ 600px.
*/

@media (max-width: 800px) {
  .nav-links { display: none; }
  .nav-logo .nav-tagline { display: none; }
  .nav-logo { font-size: 22px; }
  .section-title { font-size: clamp(24px, 6vw, 32px); }
  .section-body { font-size: 16px; }
  section { padding: var(--sp-11) 0; }
}

@media (max-width: 580px) {
  .nav-cta-desktop { display: none; }
  .nav-logo { font-size: 18px; }
  section { padding: var(--sp-10) 0; }
  .section-body { margin-bottom: var(--sp-6); }
}
