/* ========================================
   Niche Intel — Style System
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg: #030712;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);

  --text-primary: #ffffff;
  --text-body: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --accent: #7C30FF;
  --accent-light: #9B5CFF;
  --accent-dim: rgba(124, 48, 255, 0.15);
  --accent-glow: rgba(124, 48, 255, 0.3);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);     /* 11-12 */
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);    /* 13-14 */
  --text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);       /* 15-16 */
  --text-lg: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);        /* 17-18 */
  --text-xl: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);         /* 20-24 */
  --text-2xl: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);           /* 28-40 */
  --text-3xl: clamp(2.25rem, 1.8rem + 1.8vw, 3.5rem);         /* 36-56 */

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
a:hover {
  color: #fff;
}

code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--accent-light);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: var(--text-sm);
}
.skip-link:focus {
  top: 16px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ========================================
   HEADER
   ======================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease-out);
}
.header--scrolled {
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  text-decoration: none;
}
.logo:hover { color: var(--text-primary); }
.logo-text {
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

/* Desktop Nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav-link {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.2s var(--ease-out);
}
.nav-link:hover {
  color: var(--text-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav */
.nav-mobile {
  display: none;
  flex-direction: column;
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--border);
}
.nav-mobile.open {
  display: flex;
}
.nav-link-mobile {
  color: var(--text-body);
  font-size: var(--text-base);
  font-weight: 500;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.nav-link-mobile:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-sm {
  padding: 8px 18px;
  font-size: var(--text-xs);
}
.btn-lg {
  padding: 14px 32px;
  font-size: var(--text-base);
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  padding: clamp(var(--space-16), 10vw, var(--space-24)) 0 var(--space-12);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-dim);
  border: 1px solid rgba(124, 48, 255, 0.2);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto var(--space-8);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero-note {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.hero-image-wrap {
  margin-top: clamp(var(--space-10), 6vw, var(--space-16));
  position: relative;
  z-index: 1;
}

.hero-image-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(124, 48, 255, 0.1),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(124, 48, 255, 0.08);
}

.hero-image {
  width: 100%;
  height: auto;
}

.hide-mobile {
  display: inline;
}
@media (max-width: 640px) {
  .hide-mobile { display: none; }
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) 0;
}
.section--dark {
  background: var(--surface);
}
.section--cta {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.section--privacy {
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================
   FEATURES GRID
   ======================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: var(--space-4);
}

.feature-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========================================
   NICHE SCORE
   ======================================== */
.niche-score-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}

@media (max-width: 768px) {
  .niche-score-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.score-factors {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

@media (max-width: 768px) {
  .score-factors {
    justify-items: center;
  }
}

.score-factors li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-body);
}

.factor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.niche-score-visual {
  display: flex;
  justify-content: center;
}

.score-gauge {
  position: relative;
  width: 260px;
  text-align: center;
}

.gauge-svg {
  width: 100%;
  height: auto;
}

.gauge-fill {
  animation: fillGauge 2s var(--ease-out) forwards;
}

@keyframes fillGauge {
  from { stroke-dashoffset: 251; }
  to { stroke-dashoffset: 56; }
}

.score-value {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-number {
  font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.score-label {
  font-size: var(--text-lg);
  color: var(--text-faint);
  font-weight: 500;
}

.score-verdict {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-light);
  margin-top: -8px;
}

/* ========================================
   GENRE / MOOD PRESETS
   ======================================== */
.presets-wrap {
  max-width: 800px;
  margin: 0 auto;
}

.presets-group {
  margin-bottom: var(--space-8);
}
.presets-group:last-child {
  margin-bottom: 0;
}

.preset-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.presets-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-body);
  background: var(--surface);
  transition: all 0.2s var(--ease-out);
  cursor: default;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-dim);
}
.chip--genre {
  border-color: rgba(124, 48, 255, 0.15);
}
.chip--mood {
  border-color: rgba(20, 184, 166, 0.15);
}
.chip--mood:hover {
  border-color: #14B8A6;
  background: rgba(20, 184, 166, 0.1);
}

/* ========================================
   HOW IT WORKS
   ======================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

@media (max-width: 700px) {
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

.step-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(3, 7, 18, 0.5);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(124, 48, 255, 0.25);
  color: var(--accent-light);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-5);
}

.step-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.step-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================
   EXPORT
   ======================================== */
.export-layout {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-8), 4vw, var(--space-12));
}

@media (max-width: 600px) {
  .export-layout {
    flex-direction: column;
    text-align: center;
  }
  .export-layout .section-title,
  .export-layout .section-desc {
    text-align: center !important;
  }
}

.export-icon-wrap {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 4px;
}

/* ========================================
   PRIVACY POLICY
   ======================================== */
.privacy-content {
  max-width: 720px;
}

.privacy-meta {
  font-size: var(--text-sm);
  color: var(--text-faint);
  margin-bottom: var(--space-8);
}

.privacy-heading {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.privacy-text {
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.privacy-list {
  list-style: none;
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.privacy-list li {
  position: relative;
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: 1.7;
  padding: 2px 0;
}

.privacy-list li::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

.privacy-text a {
  color: var(--accent-light);
}
.privacy-text a:hover {
  color: #fff;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-faint);
  line-height: 1.6;
}

.footer-bottom a {
  color: var(--text-muted);
}
.footer-bottom a:hover {
  color: var(--text-primary);
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
.anim-fade {
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease-out);
}
.anim-fade.visible {
  opacity: 1;
}

/* Stagger for grid children */
.features-grid .anim-fade:nth-child(1) { transition-delay: 0ms; }
.features-grid .anim-fade:nth-child(2) { transition-delay: 50ms; }
.features-grid .anim-fade:nth-child(3) { transition-delay: 100ms; }
.features-grid .anim-fade:nth-child(4) { transition-delay: 150ms; }
.features-grid .anim-fade:nth-child(5) { transition-delay: 200ms; }
.features-grid .anim-fade:nth-child(6) { transition-delay: 250ms; }
.features-grid .anim-fade:nth-child(7) { transition-delay: 300ms; }
.features-grid .anim-fade:nth-child(8) { transition-delay: 350ms; }
.features-grid .anim-fade:nth-child(9) { transition-delay: 400ms; }

.steps-grid .anim-fade:nth-child(1) { transition-delay: 0ms; }
.steps-grid .anim-fade:nth-child(2) { transition-delay: 80ms; }
.steps-grid .anim-fade:nth-child(3) { transition-delay: 160ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .anim-fade {
    opacity: 1;
    transition: none;
  }
  .gauge-fill {
    animation: none;
    stroke-dashoffset: 56;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   FOCUS STATES
   ======================================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========================================
   SELECTION
   ======================================== */
::selection {
  background: var(--accent);
  color: #fff;
}
