/* ================================================================
   Big Bets On Cheap Chairs — NAP Podcast
================================================================ */

:root {
  --black:       #000000;
  --orange:      #ffa700;
  --sky-blue:    #c4ffff;
  --punch-pink:  #f7345c;
  --font-mono:   'Space Mono', 'Courier New', monospace;
  --font-ui:     'Inter', system-ui, sans-serif;
  --radius:      6px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--black);
  color: var(--sky-blue);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ================================================================
   HERO — square dot grid (techy / hacky vibe)
================================================================ */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;

  /* Black base + SQUARE grid pattern — technical aesthetic */
  background-color: #000000;
  background-image:
    linear-gradient(
      rgba(196, 255, 255, 0.10) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(196, 255, 255, 0.10) 1px,
      transparent 1px
    );
  background-size: 50px 50px;
  background-position: 0 0;

  cursor: crosshair;
}

/* Small square dots at grid intersections */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    square,
    rgba(196, 255, 255, 0.22) 1.5px,
    transparent 1.5px
  );
  /* Fallback for browsers without square gradient — use tiny squares */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50'%3E%3Crect x='24' y='24' width='2' height='2' fill='rgba(196,255,255,0.22)' rx='0'/%3E%3C/svg%3E");
  background-size: 50px 50px;
  background-position: 0 0;
  z-index: 0;
  pointer-events: none;
}

/* ---- Brand mark (logo image link) — top left ---- */
.brand-mark {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 20;          /* above canvas (1) and fxCanvas (5) */
  display: block;
  text-decoration: none;
  opacity: 0.88;
  transition: opacity 150ms var(--ease);
  pointer-events: auto; /* explicit — must be clickable */
}
.brand-mark:hover { opacity: 1; }

.brand-logo {
  width: 100px;
  height: auto;
  display: block;
}

/* ---- Countdown — top right ---- */
.countdown {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.countdown-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.countdown-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 0;           /* square — techy */
  animation: dotBlink 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255, 167, 0, 0.55);
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

.countdown-status {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(196, 255, 255, 0.50);
}

.countdown-digits {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
}

.cd-block {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.cd-num {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(196, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
  text-align: right;
}

.cd-unit {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(196, 255, 255, 0.30);
  text-transform: uppercase;
}

.cd-sep {
  font-size: 12px;
  color: rgba(196, 255, 255, 0.22);
  margin: 0 1px;
  font-weight: 400;
}

/* ---- Three.js canvas — transparent background ---- */
#chairCanvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 1;
  touch-action: none;
}

/* ---- FX ripple overlay ---- */
#fxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ---- Drag hint ---- */
.drag-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(196,255,255,0.28);
  pointer-events: none;
  transition: opacity 700ms var(--ease);
  white-space: nowrap;
}

.drag-hint.hidden { opacity: 0; }

/* ================================================================
   CHAIR CTA  — subtle "click the chair" hint at bottom of hero
================================================================ */

.chair-cta {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  animation: ctaPulse 3s ease-in-out infinite;
}

.chair-cta-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(196,255,255,0.38);
  white-space: nowrap;
}

.chair-cta-line {
  display: block;
  width: 28px;
  height: 1px;
  background: rgba(196,255,255,0.18);
}

@keyframes ctaPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   RESPONSIVE
================================================================ */

@media (max-width: 768px) {
  .brand-mark { top: 20px; left: 20px; }
  .brand-logo { width: 80px; }
  .countdown  { top: 20px; right: 20px; }
  .cd-num     { font-size: 12px; }
  .countdown-status { font-size: 8px; }
}

@media (max-width: 480px) {
  .hero { min-height: 520px; }
  .brand-logo { width: 64px; }
  .cd-num     { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .drag-hint    { display: none; }
  .chair-cta    { animation: none; opacity: 0.6; }
  .countdown-dot { animation: none; }
}

/* ================================================================
   MODAL
================================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  padding: 44px 40px 40px;
  background: #000;
  border: 1px solid rgba(196, 255, 255, 0.25);
  border-radius: 0;
  transform: translateY(12px);
  transition: transform 220ms var(--ease);
}

.modal.is-open .modal-box { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: rgba(196, 255, 255, 0.4);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 150ms var(--ease);
}
.modal-close:hover { color: var(--sky-blue); }

.modal-title {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.modal-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(196, 255, 255, 0.40);
  text-transform: none;
  margin-bottom: 28px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-form input[type="email"] {
  width: 100%;
  padding: 13px 16px;
  background: rgba(196, 255, 255, 0.03);
  border: 1px solid rgba(196, 255, 255, 0.18);
  border-radius: 0;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  appearance: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.modal-form input[type="email"]::placeholder { color: rgba(196, 255, 255, 0.22); }

.modal-form input[type="email"]:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 167, 0, 0.08);
}

#modalSubmit {
  padding: 13px 20px;
  background: var(--orange);
  color: #000;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  transition: background 140ms var(--ease);
}

#modalSubmit:hover    { background: #ffbb2e; }
#modalSubmit:disabled { opacity: 0.55; cursor: not-allowed; }

.modal-btn-loader {
  display: none;
  width: 13px; height: 13px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

#modalSubmit.is-loading .modal-btn-label { display: none; }
#modalSubmit.is-loading .modal-btn-loader { display: block; }

.modal-msg {
  margin-top: 10px;
  min-height: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 250ms var(--ease);
}
.modal-msg.is-visible { opacity: 1; }
.modal-msg.is-success { color: var(--sky-blue); }
.modal-msg.is-error   { color: var(--punch-pink); }
.modal-msg.is-info    { color: rgba(196, 255, 255, 0.5); }

@media (max-width: 480px) {
  .modal-box { padding: 36px 24px 32px; }
}
