@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@900,700,500,400&display=swap');

/* ==========================================================================
   OpenEyes Design System - Industrial Precision
   Anti-Slop Pattern Guidelines Applied
   ========================================================================== */

:root {
  /* Colors - Void Black to Graphite */
  --bg-base: #060608;
  --bg-surface: #0B0B0F;
  --bg-panel: #13131A;
  --bg-elevated: #1C1C26;
  
  /* Accents - Electric & Warm */
  --accent-primary: #00E5FF; /* Electric Cyan */
  --accent-primary-dim: rgba(0, 229, 255, 0.15);
  --accent-secondary: #FF5A36; /* Coral */
  --accent-secondary-dim: rgba(255, 90, 54, 0.15);
  --signal-success: #39FF14; /* Terminal Green */
  
  /* Typography Colors */
  --text-hi-res: #FFFFFF;
  --text-medium: #A1A1AA;
  --text-muted: #6B7280;
  
  /* Borders */
  --border-dim: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.2);
  
  /* Fonts */
  --font-display: 'Satoshi', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Intentional Spacing Rhythm (Not strictly 4/8px grid) */
  --space-xs: 6px;
  --space-sm: 14px;
  --space-md: 22px;
  --space-lg: 35px;
  --space-xl: 56px;
  --space-2xl: 88px;
  --space-3xl: 140px;
  
  /* Motion - Custom Curves */
  --ease-snappy: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-medium);
  font-family: var(--font-body);
  font-size: 17px; /* Better readability */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

/* Hardware texture background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--border-dim) 1px, transparent 1px);
  background-size: 35px 35px;
  z-index: -1;
  opacity: 0.4;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-hi-res);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.5rem;
  font-weight: 500;
}

p {
  margin-bottom: var(--space-md);
  max-width: 65ch; /* Optimal reading length */
}

a {
  color: var(--text-hi-res);
  text-decoration: none;
  transition: color 0.3s var(--ease-snappy);
}

a:hover {
  color: var(--accent-primary);
}

.text-accent {
  color: var(--accent-primary);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: -0.01em;
}

/* ===== Layout Architecture ===== */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-tight {
  padding: var(--space-xl) 0;
}

/* ===== Minimal Navigation ===== */
.nav-dock {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 11, 15, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-focus);
  padding: var(--space-sm) var(--space-md);
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-hi-res);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-brand img {
  height: 22px;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-hi-res);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.4s var(--ease-snappy);
  border: none;
}

.btn-primary {
  background: var(--text-hi-res);
  color: var(--bg-base);
  border-radius: 2px; /* Sharp industrial corners */
}

.btn-primary:hover {
  background: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--accent-primary-dim);
}

.btn-secondary {
  background: transparent;
  color: var(--text-hi-res);
  border: 1px solid var(--border-focus);
  border-radius: 2px;
}

.btn-secondary:hover {
  border-color: var(--text-hi-res);
  background: var(--bg-surface);
}

/* ===== Hero Section (Asymmetric) ===== */
.hero {
  min-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-2xl);
  padding-top: var(--space-2xl);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-tag {
  font-family: var(--font-mono);
  color: var(--accent-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-secondary);
  border-radius: 50%;
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--text-medium);
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* ===== Terminal Component ===== */
.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
  position: relative;
  width: 100%;
}

.terminal-header {
  background: var(--bg-elevated);
  padding: var(--space-xs) var(--space-sm);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-dim);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4B4B5E;
}

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-medium);
  line-height: 1.5;
  height: 350px;
  overflow-y: auto;
}

.term-line { margin-bottom: 4px; }
.term-cmd { color: var(--text-hi-res); }
.term-success { color: var(--signal-success); }
.term-accent { color: var(--accent-primary); }
.term-warn { color: var(--accent-secondary); }
.term-dim { color: var(--text-muted); }

/* Blinking cursor */
.cursor::after {
  content: "█";
  animation: blink 1s step-end infinite;
  color: var(--text-hi-res);
}

@keyframes blink { 50% { opacity: 0; } }

/* ===== Bento Grid Features ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(250px, auto);
  gap: var(--space-sm);
}

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.3s var(--ease-snappy), background 0.3s;
}

.bento-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-panel);
}

/* Varied spans */
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.row-span-2 { grid-row: span 2; }

.bento-icon {
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
}

.bento-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  color: var(--text-hi-res);
}

.bento-text {
  font-size: 0.95rem;
  margin: 0;
}

/* ===== Performance Specs Table ===== */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.spec-table th, .spec-table td {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-dim);
  text-align: left;
}

.spec-table th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-table td {
  color: var(--text-hi-res);
}

.spec-highlight {
  color: var(--signal-success) !important;
}

/* ===== Hardware Grid ===== */
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.hw-card {
  background: transparent;
  border: 1px solid var(--border-dim);
  padding: var(--space-lg);
}

.hw-card:hover {
  border-color: var(--accent-primary);
}

.hw-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-hi-res);
  margin-bottom: var(--space-xs);
}

.hw-spec {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-size: 0.85rem;
}

/* ===== Content Area (Docs) ===== */
.content-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar a {
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: var(--space-xs) 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-sm);
}

.sidebar a:hover, .sidebar a.active {
  color: var(--text-hi-res);
  border-left-color: var(--accent-primary);
}

.doc-content h2 {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-dim);
}

.doc-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
  color: var(--text-medium);
}

.doc-content li {
  margin-bottom: var(--space-xs);
}

/* ===== Premium Minimalist Footer ===== */
.footer {
  border-top: 1px solid var(--border-dim);
  padding: var(--space-2xl) 0 var(--space-lg) 0;
  margin-top: var(--space-3xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  width: 100%;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
  margin: 0;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-medium);
  margin-top: var(--space-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--signal-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--signal-success);
  animation: pulse-glow 2.5s infinite;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-hi-res);
  margin-bottom: var(--space-xs);
}

.footer-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-snappy);
  text-decoration: none;
  line-height: 1.8;
}

.footer-link:hover {
  color: var(--text-hi-res);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    padding-top: var(--space-2xl);
  }
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .col-span-3 { grid-column: span 2; }
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: var(--space-md);
  }
  .sidebar a {
    border-left: none;
    padding-left: 0;
    border-bottom: 2px solid transparent;
    padding-bottom: var(--space-xs);
  }
  .sidebar a:hover, .sidebar a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-primary);
  }
}

@media (max-width: 768px) {
  :root {
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
  }
  
  html { font-size: 15px; }
  
  .container {
    padding: 0 var(--space-md);
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }
  .col-span-2, .col-span-3 { grid-column: span 1; }
  .row-span-2 { grid-row: span 1; }
  
  .nav-dock {
    width: calc(100% - 32px);
    top: 16px;
    padding: 16px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-radius: 16px;
  }
  
  .nav-brand {
    font-size: 1.2rem;
  }
  .nav-brand img {
    height: 24px;
  }

  .nav-links {
    gap: 16px 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    font-size: 0.95rem;
  }
  
  .hero {
    min-height: auto;
    padding-top: 160px;
    padding-bottom: var(--space-2xl);
  }

  h1 {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }
  
  .terminal-body {
    height: 280px;
    font-size: 0.75rem;
    padding: var(--space-sm);
  }

  .term-line {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .footer {
    padding: var(--space-2xl) 0 var(--space-2xl) 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl) var(--space-md);
  }
  
  .footer-brand-col {
    grid-column: span 2;
    align-items: flex-start;
    text-align: left;
    margin-bottom: var(--space-md);
  }

  .footer-desc {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: left;
    align-items: flex-start;
  }
}

/* ==========================================================================
   INTERACTIONS & EFFECTS (Added for v3.0.1)
   ========================================================================== */

/* 1. Film Grain Overlay */
.film-grain {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 2. Global Spotlight (follows mouse on body) */
body {
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.03),
    transparent 40%
  );
  transition: opacity 0.5s var(--ease-smooth);
}

/* 3. Bento Card Spotlight */
.bento-card {
  position: relative;
  overflow: hidden; /* For spotlight to stay inside */
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(
    400px circle at var(--card-mouse-x, -500px) var(--card-mouse-y, -500px),
    rgba(0, 229, 255, 0.08), /* Cyan tint spotlight */
    transparent 40%
  );
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s;
  opacity: 0;
}
.bento-card:hover::before {
  opacity: 1;
}

/* Make sure bento content stays above the card spotlight */
.bento-card > * {
  position: relative;
  z-index: 1;
}

/* 4. Scroll Reveals */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
  will-change: opacity, transform;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 5. Docs ScrollSpy active state */
.sidebar-link.active {
  color: var(--accent-primary);
  border-left: 2px solid var(--accent-primary);
  padding-left: calc(var(--space-sm) - 2px);
  background: var(--accent-primary-dim);
}
.demo-media { width: 100%; border-radius: 4px; margin-bottom: var(--space-md); margin-top: var(--space-xs); border: 1px solid var(--border-dim); }
