/* ═══════════════════════════════════════════════════
   Day 08 – Flow Field
   ═══════════════════════════════════════════════════ */

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

/* ─── Custom Properties ─────────────────────────── */

:root {
  --bg-deep: #050510;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e6f0;
  --text-muted: rgba(255, 255, 255, 0.4);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-glow: rgba(56, 189, 248, 0.3);
  --radius: 10px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  font-family: var(--font-mono);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ─── Canvas ────────────────────────────────────── */

.flow-page {
  position: relative;
  width: 100%;
  height: 100%;
}

[data-canvas] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ─── Overlay ───────────────────────────────────── */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  pointer-events: none;
}

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

.hero-copy {
  max-width: 480px;
  animation: fadeSlideIn 0.8s ease-out both;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-copy.hidden {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Control Bar ───────────────────────────────── */

.control-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(8, 8, 30, 0.5);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  pointer-events: auto;
  animation: slideUp 0.6s ease-out 0.3s both;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.control-group--buttons {
  flex-direction: row;
  gap: 0.5rem;
  margin-left: auto;
}

/* ─── Slider Labels ─────────────────────────────── */

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.slider-label output {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  font-size: 0.62rem;
  opacity: 0.7;
}

/* ─── Range Sliders ─────────────────────────────── */

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 80px;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-border);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type='range']:hover::-webkit-slider-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 14px var(--accent-glow);
}

input[type='range']:hover::-moz-range-thumb {
  transform: scale(1.25);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ─── Select ────────────────────────────────────── */

select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 1.8rem 0.35rem 0.55rem;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2338bdf8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

select:hover,
select:focus {
  border-color: var(--accent);
  background-color: var(--surface-hover);
}

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

.btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn:active {
  transform: scale(0.96);
}

.btn--accent {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.2);
  color: var(--accent);
}

.btn--accent:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
}

/* ─── Animations ────────────────────────────────── */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 720px) {
  .overlay {
    padding: 1.25rem;
  }

  .control-bar {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
  }

  .control-group {
    flex: 1 1 40%;
  }

  .control-group--buttons {
    flex: 1 1 100%;
    justify-content: stretch;
  }

  .control-group--buttons .btn {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .hero-copy h1 {
    font-size: 2rem;
  }

  .control-group {
    flex: 1 1 100%;
  }
}
