/**
 * GlassesJS — Website Styles
 *
 * Dark theme with BEAM green (#10b981) accent.
 * Fonts: Outfit (body) + JetBrains Mono (code)
 */

/* ─── Reset & Base ────────────────────────────────────────────────── */

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

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #161f32;
  --bg-card-hover: #1c2740;
  --bg-code: #0d1424;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --accent-glow: rgba(16, 185, 129, 0.3);

  --border: #1e293b;
  --border-accent: rgba(16, 185, 129, 0.3);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1100px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

img, video, canvas {
  display: block;
  max-width: 100%;
}

/* ─── Typography ──────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5em;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.4em;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ─── Layout ──────────────────────────────────────────────────────── */

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

section {
  padding: 5rem 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ─── Navigation ──────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .logo-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

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

.nav-links a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.lang-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 2px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.lang-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* ─── Hero ────────────────────────────────────────────────────────── */

.hero {
  padding-top: calc(var(--nav-height) + 5rem);
  padding-bottom: 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse at center,
    var(--accent-glow) 0%,
    transparent 70%
  );
  opacity: 0.3;
  pointer-events: none;
}

.hero h1 {
  position: relative;
  margin-bottom: 0.5rem;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-description {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.btn-copy {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-code);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: all;
}

.btn-copy:hover {
  border-color: var(--border-accent);
}

/* ─── Demo Section ────────────────────────────────────────────────── */

#demo {
  padding-top: calc(var(--nav-height) + 3rem);
}

.demo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.demo-video-wrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.demo-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.demo-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.demo-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-result-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.demo-result-main.glasses {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
}

.demo-result-main.no-glasses {
  border-color: var(--border);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.result-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-confidence {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.result-frames {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Method breakdown */
.demo-methods {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.method-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.method-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
}

.method-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.method-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.method-score {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 32px;
  text-align: right;
}

/* ─── Methods (How It Works) ──────────────────────────────────────── */

.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.method-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.method-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 0 20px var(--accent-dim);
}

.method-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.method-card-weight {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.method-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ─── API Section ─────────────────────────────────────────────────── */

.api-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.api-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s;
}

.api-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.api-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.api-panel {
  display: none;
}

.api-panel.active {
  display: block;
}

.api-panel p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ─── Install Section ─────────────────────────────────────────────── */

.install-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.install-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.install-option h3 {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content a {
  color: var(--text-secondary);
}

.footer-copyright {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-copyright a {
  color: var(--accent);
}

.footer-built {
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .demo-container {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 3rem;
  }

  .methods-grid {
    grid-template-columns: 1fr;
  }

  .install-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 0.5rem;
  }

  .nav-links .nav-link-text {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
  }
}
