/* ENTRAINIUM MANIFEST - PREMIUM DARK THEME */

:root {
  --bg: #0a0e14;
  --panel: #111822;
  --panel-hover: #1a2332;
  --text: #e6eef8;
  --muted: #9fb3c8;
  --brand: #aee8ff;
  --brand-2: #c5b3ff;
  --accent: #7dd3fc;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  
  --calm: #3b82f6;
  --clarity: #0ea5e9;
  --confidence: #f59e0b;
  --growth: #10b981;
  --love: #ec4899;
  --release: #a855f7;
  
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --header-h: 60px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

.nav-spacer {
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, rgba(10, 14, 20, 0.95), rgba(17, 24, 34, 0.92));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(174, 232, 255, 0.15);
  padding: 12px 0;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text {
  display: inline-block;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #0a0e14;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(174, 232, 255, 0.4);
}

.header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(174, 232, 255, 0.2);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(174, 232, 255, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a0e14;
  border: none;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(174, 232, 255, 0.5);
}

.btn-secondary {
  background: var(--panel);
  border-color: rgba(174, 232, 255, 0.2);
}

.btn-mode {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-mode.active {
  background: linear-gradient(135deg, rgba(174, 232, 255, 0.25), rgba(197, 179, 255, 0.2));
  border-color: var(--brand);
  color: var(--brand);
}

.hero {
  padding: 48px 0 32px;
  text-align: center;
}

.tag {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(174, 232, 255, 0.15), rgba(197, 179, 255, 0.1));
  border: 1px solid rgba(174, 232, 255, 0.25);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.subtitle {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}

section {
  padding: 40px 0;
}

h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 24px;
}

h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-hint {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.template-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.template-card {
  background: linear-gradient(135deg, rgba(17, 24, 34, 0.7), rgba(10, 14, 20, 0.5));
  border: 2px solid rgba(174, 232, 255, 0.15);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.template-card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(174, 232, 255, 0.3);
}

.template-card.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(174, 232, 255, 0.18), rgba(197, 179, 255, 0.12));
  box-shadow: 0 0 32px rgba(174, 232, 255, 0.4);
}

.template-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.template-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.template-duration {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.template-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.pack-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pack-select {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(174, 232, 255, 0.2);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.pack-select:hover {
  border-color: var(--brand);
}

.pack-select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

textarea {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(174, 232, 255, 0.2);
  background: rgba(10, 14, 20, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
  min-height: 200px;
  transition: all 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(174, 232, 255, 0.1);
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.editor-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.control-section {
  background: linear-gradient(135deg, rgba(17, 24, 34, 0.6), rgba(10, 14, 20, 0.4));
  border: 1px solid rgba(174, 232, 255, 0.12);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.mode-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.controls-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 20px;
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-block label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.control-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  min-width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(174, 232, 255, 0.15);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(174, 232, 255, 0.4);
  transition: transform 0.15s ease;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(174, 232, 255, 0.4);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}

.control-hint {
  font-size: 13px;
  color: var(--muted);
}

.options-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-height: 32px;
}

.option-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand);
}

.option-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: 28px;
}

.timeline-container {
  background: linear-gradient(135deg, rgba(17, 24, 34, 0.6), rgba(10, 14, 20, 0.4));
  border: 1px solid rgba(174, 232, 255, 0.12);
  border-radius: var(--radius);
  padding: 32px;
}

.timeline-bar {
  position: relative;
  height: 12px;
  background: rgba(174, 232, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s ease;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

footer {
  padding: 48px 0;
  border-top: 1px solid rgba(174, 232, 255, 0.1);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.disclaimer {
  margin-top: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-size: 13px;
}

.lightmod-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.lightmod-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.lightmod-consent {
  background: linear-gradient(145deg, #1a1f28, #12161d);
  border: 2px solid var(--danger);
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 90vw;
  box-shadow: 0 24px 64px rgba(248, 113, 113, 0.4);
}

.lightmod-consent h2 {
  color: var(--danger);
  margin-bottom: 20px;
  font-size: 28px;
}

.lightmod-consent p {
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.lightmod-consent p strong {
  color: var(--danger);
  font-weight: 700;
}

.consent-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
}

.consent-actions .btn {
  flex: 1;
  padding: 14px 24px;
  font-size: 15px;
}

.lightmod-frame {
  position: relative;
  width: min(900px, 90vw);
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(145deg, #0e131b, #0a0f16);
  border: 2px solid rgba(174, 232, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

.lightmod-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at center, hsl(180, 20%, 8%), hsl(180, 10%, 3%));
  border: 1px solid rgba(174, 232, 255, 0.15);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightmod-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4), 0 0 32px rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: none;
  will-change: opacity, transform;
}

.lightmod-text {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 
    0 0 30px rgba(255, 255, 255, 1),
    0 0 60px rgba(255, 255, 255, 0.8),
    0 0 90px rgba(255, 255, 255, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.9),
    0 2px 4px rgba(0, 0, 0, 1);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  max-width: 80%;
  line-height: 1.4;
  transition: none;
  will-change: opacity, transform;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.02em;
}

.lightmod-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(174, 232, 255, 0.3);
  background: linear-gradient(135deg, rgba(174, 232, 255, 0.15), rgba(197, 179, 255, 0.1));
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
}

.lightmod-close:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(174, 232, 255, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .lightmod-screen {
    transition: none !important;
  }
}

@media (max-width: 768px) {
  .nav-spacer {
    height: auto;
    min-height: 70px;
  }
  
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
  }
  
  .brand {
    font-size: 16px;
  }
  
  .brand-text {
    font-size: 14px;
  }
  
  .logo {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .header-controls {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .consent-actions {
    flex-direction: column;
  }
  
  .lightmod-text {
    font-size: 10px;
  }
}

@media (min-width: 769px) {
  .lightmod-text {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }
  
  #startLabel, #stopLabel {
    display: none;
  }
  
  #startBtn::after {
    content: '▶';
  }
  
  #stopBtn::after {
    content: '■';
  }
  
  .btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 32px;
  }
  
  .mode-buttons {
    width: 100%;
  }
  
  .btn-mode {
    flex: 1;
    font-size: 11px;
    padding: 6px 8px;
  }
  
  .editor-controls {
    flex-direction: column;
  }
  
  .editor-controls .btn {
    width: 100%;
  }
  
  .lightmod-text {
    font-size: 9px;
    max-width: 85%;
  }
}