/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATION PLAYGROUND STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-light: #F5F1E8;
  --text-dark: #2a2a2a;
  --accent: #6b5b3e;
  --panel-bg: #1a1a1eee;
  --panel-border: #333;
  --highlight: #e8c87a;
  --control-bg: #2a2a2e;
  --control-hover: #3a3a3e;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-light);
  font-family: 'EB Garamond', Georgia, serif;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  padding-bottom: 80px;
  transition: margin-left 0.3s ease;
}

.page.full {
  margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROLS PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.controls {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--panel-border);
  overflow-y: auto;
  padding: 16px 14px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #ccc;
  transition: transform 0.3s ease;
}

.controls.collapsed {
  transform: translateX(-280px);
}

.controls h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
}

.controls h2:first-child {
  margin-top: 0;
}

.controls label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #aaa;
  margin: 6px 0 2px;
}

.controls label .val {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--highlight);
  font-size: 10px;
}

.controls input[type="range"] {
  width: 100%;
  accent-color: var(--highlight);
  height: 3px;
  margin: 2px 0 6px;
}

.controls select {
  width: 100%;
  background: var(--control-bg);
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  margin: 2px 0 6px;
}

.controls select optgroup {
  color: var(--highlight);
  font-weight: 600;
  font-style: normal;
  padding-top: 4px;
}

.controls select option {
  color: #ccc;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS & PRESETS
   ═══════════════════════════════════════════════════════════════════════════ */
.preset-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.preset-btn {
  background: var(--control-bg);
  color: #aaa;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  background: var(--control-hover);
  color: #fff;
}

.preset-btn.active {
  background: var(--highlight);
  color: #1a1a1e;
  border-color: var(--highlight);
}

.replay-btn {
  width: 100%;
  margin-top: 12px;
  padding: 7px;
  background: var(--highlight);
  color: #1a1a1e;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.replay-btn:hover {
  background: #f0d68a;
}

.toggle-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: #222226ee;
  color: var(--highlight);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: left 0.3s ease;
}

body.playground .controls:not(.collapsed) ~ .toggle-btn {
  left: 292px;
}

.fullpage-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1001;
  background: #222226ee;
  color: var(--highlight);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: all 0.3s ease;
}

.fullpage-btn:hover {
  background: var(--control-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FULLPAGE MODE
   ═══════════════════════════════════════════════════════════════════════════ */
body.fullpage .controls,
body.fullpage .prompt-bar {
  transform: translateX(-100vw);
  opacity: 0;
  pointer-events: none;
}

body.fullpage .toggle-btn {
  left: 12px !important;
}

body.fullpage .page {
  margin-left: 0;
}

body.fullpage .fullpage-btn {
  background: var(--highlight);
  color: #1a1a1e;
  border-color: var(--highlight);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROMPT BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.prompt-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-border);
  padding: 10px 16px 10px 296px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: padding-left 0.3s ease;
}

.prompt-bar.full {
  padding-left: 16px;
}

.prompt-text {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #999;
  max-height: 60px;
  overflow-y: auto;
}

.copy-btn {
  background: var(--highlight);
  color: #1a1a1e;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: #f0d68a;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 48px;
  display: flex;
  gap: 32px;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: var(--bg-light);
  backdrop-filter: blur(8px);
}

.site-nav .brand {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.5s cubic-bezier(0, 0, 0.2, 1);
}

.site-nav .brand.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-nav a {
  text-decoration: none;
  font-size: 16px;
  color: var(--text-dark);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.4s cubic-bezier(0, 0, 0.2, 1);
  position: relative;
}

.site-nav a.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-nav .source-link {
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.4s cubic-bezier(0, 0, 0.2, 1);
}

.site-nav .source-link.visible {
  opacity: 0.7;
  transform: translateY(0);
}

.site-nav .source-link:hover {
  opacity: 1;
}

p.body.mission {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.87;
  line-height: 1.6;
}

.site-nav a:not(.brand):not(.source-link)::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.site-nav a:not(.brand):hover::after {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT SECTIONS
   ═══════════════════════════════════════════════════════════════════════════ */
section {
  padding: 32px 56px;
  max-width: 780px;
  margin: 0 auto;
}

.hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 80px;
  font-weight: 400;
  letter-spacing: -1px;
  margin-bottom: 20px;
  color: var(--text-dark);
  opacity: 0;
}

.hero h1.visible {
  opacity: 1;
}

.hero p {
  font-size: 20px;
  max-width: 500px;
  color: #666;
  opacity: 0;
}

.hero p.visible {
  opacity: 1;
}

.shape-hero-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
  opacity: 0;
  transition: opacity 700ms cubic-bezier(0,0,0.2,1);
}

.shape-hero-wrap.visible {
  opacity: 1;
}

#shape-canvas {
  pointer-events: auto;
  z-index: -1;
}

h2 {
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 24px;
  color: var(--accent);
}

p.body {
  font-size: 18px;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--text-dark);
  opacity: 0.87;
}

.divider {
  width: 60px;
  height: 1px;
  margin: 16px auto;
  background: var(--accent);
  opacity: 0.27;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}

.card {
  display: block;
  text-decoration: none;
  background: rgba(42, 42, 42, 0.03);
  border: 1px solid rgba(107, 91, 62, 0.1);
  border-radius: 8px;
  padding: 28px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
}

.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--accent);
}

.card p {
  font-size: 15px;
  color: var(--text-dark);
  opacity: 0.6;
}

footer {
  text-align: center;
  padding: 40px;
  font-size: 14px;
  color: var(--text-dark);
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CTA BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.cta-btn {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg-light);
  text-decoration: none;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  border-radius: 6px;
  transition: background 0.2s ease;
  opacity: 0;
}

.cta-btn:hover {
  background: #7d6b4a;
}

.cta-btn.visible {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
}

.reveal.visible {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE MODE (default)
   ═══════════════════════════════════════════════════════════════════════════ */
.controls,
.prompt-bar,
.toggle-btn,
.fullpage-btn {
  display: none;
}

.page {
  margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLAYGROUND MODE (activated via Ctrl+. / Cmd+.)
   ═══════════════════════════════════════════════════════════════════════════ */
body.playground .controls {
  display: block;
}

body.playground .prompt-bar {
  display: flex;
}

body.playground .toggle-btn,
body.playground .fullpage-btn {
  display: block;
}

body.playground .page {
  margin-left: 280px;
}

body.playground .controls.collapsed ~ .page {
  margin-left: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE (basic responsiveness)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px 20px;
    gap: 12px;
  }

  .site-nav .brand {
    width: 100%;
    text-align: center;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    font-size: 16px;
  }

  section {
    padding: 24px 20px;
  }

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

  .cta-btn {
    font-size: 16px;
    padding: 12px 24px;
  }
}
