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

/* ── Brand fonts (self-hosted, matches firmware boot logo) ── */
@font-face {
  font-family: 'Akira';
  font-weight: 700;
  font-style: normal;
  src: url('/fonts/Akira-Bold.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Akira';
  font-weight: 900;
  font-style: normal;
  src: url('/fonts/Akira-SuperBold.ttf') format('truetype');
  font-display: swap;
}

:root {
  --color-bg: #0a0a0a;
  --color-surface: #141414;
  --color-surface-hover: #1a1a1a;
  --color-text: #f0f0f0;
  --color-muted: #888;
  --color-border: #222;
  --color-accent: #e535ab;
  --color-accent-hover: #f04dbc;
  --max-width: 1100px;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  /* Akira-Expanded is uppercase-only; use only for short brand wordmarks */
  --font-brand: 'Akira', 'JetBrains Mono', 'Impact', sans-serif;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; font: inherit; }

/* ── Video Hero Splash ── */
.video-hero {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.video-hero.fade-out { opacity: 0; }

.video-hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-hero-overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

.video-hero-logo {
  font-family: var(--font-brand);
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
}

.video-hero-logo span { color: var(--color-accent); }

.video-hero-tagline {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  text-shadow: 0 1px 20px rgba(0,0,0,0.5);
}

.video-hero-enter {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 0.7rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease, background 0.2s, border-color 0.2s;
  pointer-events: none;
}

.video-hero-enter.visible {
  opacity: 1;
  pointer-events: auto;
}

.video-hero-enter:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
}

/* ── Site Fade In ── */
.site-content.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Header ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border);
}

.logo {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--color-text);
}

.logo span { color: var(--color-accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-right a {
  font-size: 0.85rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.header-right a:hover { color: var(--color-text); }

.cart-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--color-muted);
  position: relative;
  padding: 0.5rem;
  transition: color 0.15s;
}

.cart-btn:hover { color: var(--color-text); }

.cart-btn .count {
  position: absolute;
  top: -2px;
  right: -6px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Hero ── */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-brand);
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

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

.hero p {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  max-width: 500px;
  margin: 0 auto;
}

/* ── Product Grid ── */
.section-label {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.product-card:hover {
  border-color: #333;
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-card-info {
  padding: 1rem 1.25rem;
}

.product-card-info h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.product-card-info .price {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── Product Detail ── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: 2.5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (min-width: 640px) {
  .product-detail { grid-template-columns: 1fr 1fr; }
}

.product-gallery img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-surface);
}

.product-gallery .thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.product-gallery .thumbs img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

.product-gallery .thumbs img.active { border-color: var(--color-accent); }

.product-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.product-info .price {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.product-info .description {
  color: var(--color-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.product-info .description p { margin-bottom: 0.85rem; }

.product-info .description .desc-lead {
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.5;
}

.product-info .description .desc-fit {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  margin: 0.25rem 0 1rem;
}

.product-info .description h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 1.4rem 0 0.4rem;
}

.product-info .description strong { color: var(--color-text); }

.buy-note {
  color: var(--color-muted);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  max-width: 32ch;
}

/* ── Preorder Modal ── */
.preorder-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.preorder-overlay.open { opacity: 1; pointer-events: auto; }

.preorder-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: 460px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  z-index: 151;
  padding: 1.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.preorder-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.preorder-modal h2 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.preorder-sub {
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.preorder-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-muted);
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.preorder-close:hover { color: var(--color-text); }

#preorder-form label {
  display: block;
  margin-bottom: 0.9rem;
}

#preorder-form label > span {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

#preorder-form label > span em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

#preorder-form input,
#preorder-form select,
#preorder-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

#preorder-form input:focus,
#preorder-form select:focus,
#preorder-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

#preorder-form textarea { resize: vertical; min-height: 70px; }

.preorder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .preorder-row { grid-template-columns: 1fr; gap: 0; }
}

#preorder-form .btn {
  width: 100%;
  margin-top: 0.5rem;
}

.preorder-status {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

.preorder-status.success { color: #4ade80; }
.preorder-status.error { color: #f87171; }

.quantity-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quantity-picker button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1.1rem;
  transition: border-color 0.15s;
}

.quantity-picker button:hover { border-color: var(--color-muted); }

.quantity-picker span {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  min-width: 2ch;
  text-align: center;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: var(--color-accent-hover); }
.btn:active { transform: scale(0.98); }

/* ── Cart Drawer ── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cart-drawer-header h2 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-muted);
  transition: color 0.15s;
}

.cart-close:hover { color: var(--color-text); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--color-bg);
}

.cart-item-details { flex: 1; }
.cart-item-details h3 { font-size: 0.9rem; font-weight: 600; }

.cart-item-details .price {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.cart-item-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.85rem;
}

.cart-item-qty span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.cart-item-remove {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: none;
  font-size: 1.1rem;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.cart-item-remove:hover { color: #e53535; }

.cart-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 3rem 0;
  font-size: 0.9rem;
}

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

.cart-footer .subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.cart-footer .subtotal .cart-subtotal {
  font-family: var(--font-mono);
  color: var(--color-accent);
}

.cart-footer .btn { width: 100%; text-align: center; }

/* ── Footer ── */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
}

footer .footer-brand {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

/* Brand wordmark color tint for inline // span (matches firmware/boot) */
.logo span,
.video-hero-logo span,
.footer-brand span { color: var(--color-accent); }

footer .footer-links {
  display: flex;
  gap: 1.5rem;
}

footer .footer-links a {
  font-size: 0.8rem;
  color: var(--color-muted);
  transition: color 0.15s;
}

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

/* ── Status Pages ── */
.status-page {
  text-align: center;
  padding: 6rem 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.status-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.status-page p {
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.status-page a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  header { padding: 1rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .product-grid { padding: 1rem; gap: 1rem; }
  .product-detail { padding: 1.5rem 1rem; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}
