/* ============================================
   WATTx Project Website — Dark Theme
   ============================================ */

:root {
  --gold: #E8D44D;
  --gold-dim: #E8D44D99;
  --gold-glow: #E8D44D33;
  --gold-hover: #F0DC5A;
  --bg: #000000;
  --bg-alt: #060608;
  --surface: #161B22;
  --surface-hover: #1C2230;
  --border: #21262D;
  --text: #E6EDF3;
  --text-muted: #8B949E;
  --text-dim: #6E7681;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1140px;
  --nav-height: 64px;
}

/* ============================================
   Video Intro Overlay
   ============================================ */
#videoIntro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.8s ease;
}

#videoIntro.fade-out {
  opacity: 0;
  pointer-events: none;
}

#videoIntro.hidden {
  display: none;
}

#introVideo {
  max-width: 560px;
  max-height: 560px;
  width: 80vmin;
  height: 80vmin;
  object-fit: contain;
  display: none;
}

#introVideo.playing {
  display: block;
}

.intro-prompt {
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: pulse-glow 2s ease-in-out infinite;
  margin-top: 24px;
}

.intro-prompt.hidden {
  display: none;
}

.intro-logo-preview {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 30px rgba(232, 212, 77, 0.5));
  animation: float 3s ease-in-out infinite;
  margin-bottom: 24px;
}

.intro-logo-preview.hidden {
  display: none;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; text-shadow: 0 0 10px rgba(232, 212, 77, 0.3); }
  50% { opacity: 1; text-shadow: 0 0 20px rgba(232, 212, 77, 0.6); }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--gold-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.3s;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-brand:hover {
  color: var(--gold);
}

.nav-logo {
  width: 32px;
  height: 32px;
}

.nav-wordmark {
  letter-spacing: 0.04em;
}

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

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

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

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -55%);
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* Hero Logo Wrap — electricity container */
.hero-logo-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo {
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 0 40px var(--gold-glow));
  animation: float 6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Electricity SVG overlay */
.electricity {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.bolt {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: bolt-flash 0.15s ease-out forwards;
}

@keyframes bolt-flash {
  0% { opacity: 1; stroke-width: 3; }
  50% { opacity: 0.8; stroke-width: 2; }
  100% { opacity: 0; stroke-width: 1; }
}

/* Ecosystem gold-shine logo */
.card-icon-img {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 96px;
  margin-bottom: 16px;
}

.ecosystem-logo {
  width: 96px;
  height: 96px;
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(232, 212, 77, 0.4));
  animation: gold-shine 3s ease-in-out infinite;
}

.ecosystem-logo-wide {
  max-width: 160px;
  max-height: 74px;
}

.ecosystem-logo-bridge {
  max-width: 96px;
  max-height: 96px;
}

@keyframes gold-shine {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(232, 212, 77, 0.3)) brightness(1);
    opacity: 0.9;
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(232, 212, 77, 0.7)) drop-shadow(0 0 40px rgba(232, 212, 77, 0.3)) brightness(1.15);
    opacity: 1;
  }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--gold);
  color: #0D1117;
}

.btn-primary:hover {
  background: var(--gold-hover);
  color: #0D1117;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-glow);
}

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

.btn-secondary:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 10px 24px;
  font-size: 0.9rem;
}

.btn-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 56px;
  font-size: 1.05rem;
}

.subsection-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 64px 0 12px;
}

/* ============================================
   Card Grid
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:hover {
  border-color: var(--gold-glow);
  transform: translateY(-4px);
}

.card-link {
  color: var(--text);
}

.card-link:hover {
  color: var(--text);
}

.card-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-disabled .coming-soon-badge {
  margin-top: auto;
}

.coming-soon-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
}

.footer-coming-soon {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   Tables
   ============================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.spec-table thead {
  background: var(--surface);
}

.spec-table th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--gold);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.spec-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.spec-table tbody tr:hover {
  background: var(--surface);
}

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

/* Trust Tier Shields */
.shield-svg {
  width: 18px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
  filter: drop-shadow(0 0 4px currentColor);
}

/* ============================================
   Specs Grid
   ============================================ */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  transition: border-color 0.3s;
}

.spec-card:hover {
  border-color: var(--gold-glow);
}

.spec-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.spec-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

/* ============================================
   Downloads
   ============================================ */
.download-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.download-card:hover {
  border-color: var(--gold-glow);
  transform: translateY(-4px);
}

.download-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(232, 212, 77, 0.3)) brightness(0.9);
  animation: gold-shine 3s ease-in-out infinite;
  transition: filter 0.3s;
}

.download-card:hover .download-logo {
  filter: drop-shadow(0 0 14px rgba(232, 212, 77, 0.6)) brightness(1.2);
}

.download-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.download-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.download-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ============================================
   Accordion
   ============================================ */
.accordion {
  max-width: 720px;
  margin: 0 auto;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.accordion-item:hover {
  border-color: var(--gold-glow);
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--surface);
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--surface-hover);
}

.accordion-chevron {
  font-size: 0.85rem;
  transition: transform 0.3s;
  color: var(--text-muted);
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--bg);
}

.accordion-body pre {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
}

.accordion-body code {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.accordion-body p {
  padding: 0 24px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 28px;
  height: 28px;
}

.footer-wordmark {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .hero-logo-wrap {
    width: 220px;
    height: 220px;
  }

  .hero-logo {
    width: 120px;
    height: 120px;
  }

  .section {
    padding: 72px 0;
  }

  .card-grid,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px;
  }

  .card-disabled .card-icon-img {
    min-height: auto;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tables: card-style on mobile */
  .spec-table thead {
    display: none;
  }

  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table td {
    display: block;
  }

  .spec-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
  }

  .spec-table td {
    padding: 4px 0;
    border-bottom: none;
    font-size: 0.9rem;
  }

  .spec-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gold);
    margin-right: 8px;
  }

  .spec-table td:first-child {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  /* Footer stacking */
  .footer-links {
    flex-direction: column;
    gap: 12px;
  }

  .footer-links a,
  .footer-coming-soon {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Accordion touch targets */
  .accordion-header {
    padding: 20px 24px;
    min-height: 56px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

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

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 60px;
  }

  .hero-logo-wrap {
    width: 180px;
    height: 180px;
  }

  .hero-logo {
    width: 100px;
    height: 100px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    min-height: 48px;
  }

  .section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-sub {
    font-size: 0.95rem;
    margin-bottom: 40px;
  }

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

  .download-card {
    padding: 24px 20px;
  }

  .spec-card {
    padding: 16px;
  }

  .spec-label {
    font-size: 0.7rem;
  }

  .spec-value {
    font-size: 1rem;
  }

  .ecosystem-logo-bridge {
    width: 96px;
    height: 96px;
  }

  .ecosystem-logo-wide {
    width: 120px;
    height: auto;
  }
}
