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

/* ── Theme variables ── */
:root {
  --transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

[data-theme="dark"] {
  --bg: #000;
  --text: #c8c8c8;
  --text-dim: #444;
  --text-muted: #555;
  --accent: #c8c8c8;
  --border: #1e1e1e;
  --btn-bg: #c8c8c8;
  --btn-text: #000;
  --btn-border: #c8c8c8;
  --toggle-bg: #111;
  --toggle-border: #2a2a2a;
  --dot-color: #3a7a3a;
}

[data-theme="light"] {
  --bg: #f5f5f3;
  --text: #1a1a1a;
  --text-dim: #aaa;
  --text-muted: #888;
  --accent: #1a1a1a;
  --border: #ddd;
  --btn-bg: #1a1a1a;
  --btn-text: #f5f5f3;
  --btn-border: #1a1a1a;
  --toggle-bg: #fff;
  --toggle-border: #ddd;
  --dot-color: #2a6e2a;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

/* ── Canvas ── */
#canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 100;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: var(--text);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition), transform 0.15s;
}

.theme-toggle:hover {
  transform: scale(1.06);
}

[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ── Main layout ── */
main {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* ── Content ── */
.content {
  text-align: center;
  max-width: 560px;
}

.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(4rem, 14vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 1.75rem;
  user-select: none;
}

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 2rem;
  opacity: 0.75;
}

/* ── Status row ── */
.status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot-color);
  box-shadow: 0 0 0 0 var(--dot-color);
  animation: pulse-ring 2.4s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(34, 160, 34, 0.6); }
  60%  { box-shadow: 0 0 0 7px rgba(34, 160, 34, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 160, 34, 0); }
}

.status-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Description ── */
.description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 420px;
  margin: 0 auto 2rem;
}

/* ── Actions ── */
.actions {
  display: flex;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 0.6rem 1.3rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.82;
}

/* ── Footer line ── */
.footer-line {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  z-index: 10;
  white-space: nowrap;
}

/* ── Scramble animation (JS-driven) ── */
.brand.scrambling {
  opacity: 0.85;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .brand { letter-spacing: -0.03em; }
  .description { font-size: 0.85rem; }
}
