/* ==========================================
   Hero Section
   ========================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(255, 107, 138, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(255, 179, 71, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero-cta .btn-primary { font-size: 1.05rem; padding: 1rem 2.25rem; }

/* ==========================================
   Audio Wave Visualizer
   ========================================== */
.wave-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 64px;
  margin: 2.5rem auto 0;
}

.wave-bar {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  animation: wavePulse 1.4s ease-in-out infinite;
  opacity: 0.75;
}

.wave-bar:nth-child(1)  { animation-delay: 0.0s;  height: 12px; }
.wave-bar:nth-child(2)  { animation-delay: 0.1s;  height: 20px; }
.wave-bar:nth-child(3)  { animation-delay: 0.2s;  height: 32px; }
.wave-bar:nth-child(4)  { animation-delay: 0.1s;  height: 44px; }
.wave-bar:nth-child(5)  { animation-delay: 0.0s;  height: 54px; }
.wave-bar:nth-child(6)  { animation-delay: 0.15s; height: 44px; }
.wave-bar:nth-child(7)  { animation-delay: 0.25s; height: 58px; }
.wave-bar:nth-child(8)  { animation-delay: 0.05s; height: 48px; }
.wave-bar:nth-child(9)  { animation-delay: 0.2s;  height: 38px; }
.wave-bar:nth-child(10) { animation-delay: 0.1s;  height: 54px; }
.wave-bar:nth-child(11) { animation-delay: 0.0s;  height: 44px; }
.wave-bar:nth-child(12) { animation-delay: 0.15s; height: 30px; }
.wave-bar:nth-child(13) { animation-delay: 0.25s; height: 18px; }
.wave-bar:nth-child(14) { animation-delay: 0.05s; height: 10px; }

@keyframes wavePulse {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50%       { transform: scaleY(1);   opacity: 0.9; }
}

/* ==========================================
   How It Works
   ========================================== */
.how-it-works {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color var(--transition), transform var(--transition);
}

.step-card:hover {
  border-color: rgba(255, 107, 138, 0.4);
  transform: translateY(-4px);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ==========================================
   Emotions Section
   ========================================== */
.emotions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.emotion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
  cursor: default;
}

.emotion-card:hover {
  border-color: rgba(255, 107, 138, 0.45);
  background: var(--bg-card2);
  transform: translateY(-4px);
}

.emotion-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  line-height: 1;
}

.emotion-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.emotion-kr {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   CTA Section
   ========================================== */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.08) 0%, rgba(255, 179, 71, 0.05) 100%);
  border-top: 1px solid var(--border);
}

.cta-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.cta-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.ad-slot {
  margin: 0 auto 2rem;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   Responsive (index)
   ========================================== */
@media (max-width: 600px) {
  .steps-grid    { grid-template-columns: 1fr; }
  .emotions-grid { grid-template-columns: repeat(2, 1fr); }
  .wave-bar      { width: 3px; }
}

@media (max-width: 360px) {
  .emotions-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   Analyze Page — Layout
   ========================================== */
.analyze-page {
  padding-top: 68px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.analyze-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.analyze-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  margin-bottom: 1rem;
}

.analyze-back:hover { color: var(--text); }

.analyze-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.analyze-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.analyze-body {
  flex: 1;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================
   Analyze Page — Panel
   ========================================== */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ==========================================
   Waveform Canvas
   ========================================== */
.waveform-canvas {
  display: block;
  width: 100%;
  height: 80px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.record-timer {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   Record Button
   ========================================== */
.record-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.record-ring {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-ring::before,
.record-ring::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.record-ring::before { width: 100%; height: 100%; }
.record-ring::after  { width: 130%; height: 130%; top: -15%; left: -15%; }

.record-ring.active::before,
.record-ring.active::after {
  opacity: 1;
  animation: ringPulse 1.8s ease-out infinite;
}

.record-ring.active::after {
  animation-delay: 0.5s;
}

@keyframes ringPulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}

.record-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 24px var(--primary-glow);
  position: relative;
  z-index: 1;
}

.record-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px var(--primary-glow);
}

.record-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.4);
}

.record-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* ==========================================
   Analyze Action
   ========================================== */
.analyze-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn-analyze {
  padding: 0.85rem 2.25rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-analyze:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.record-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================
   Result — Gauge
   ========================================== */
.result-panel {
  text-align: center;
  border-color: rgba(255, 107, 138, 0.25);
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.gauge-canvas {
  max-width: 100%;
}

.gauge-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: -0.25rem;
}

/* ==========================================
   Result — Score Bars
   ========================================== */
.score-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.score-row {
  display: grid;
  grid-template-columns: 48px 1fr 44px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.score-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.positive-color { color: #ff6b8a; }
.negative-color { color: #94a3b8; }

.bar-track {
  background: var(--bg-card2);
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.05s linear;
}

.positive-fill {
  background: linear-gradient(90deg, #ff6b8a, #ffb347);
}

.negative-fill {
  background: linear-gradient(90deg, #475569, #64748b);
}

.score-pct {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   Result — AI Comment
   ========================================== */
.ai-comment {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(255,107,138,0.08), rgba(255,179,71,0.05));
  border: 1px solid rgba(255, 107, 138, 0.2);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.ai-comment-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.ai-comment-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

/* ==========================================
   Retry Button
   ========================================== */
.btn-retry {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition);
}

.btn-retry:hover {
  border-color: var(--primary);
  background: rgba(255, 107, 138, 0.08);
}

/* ==========================================
   Utilities
   ========================================== */
.hidden { display: none !important; }

/* ==========================================
   Responsive (analyze)
   ========================================== */
@media (max-width: 480px) {
  .panel           { padding: 1.5rem; }
  .record-btn      { width: 74px; height: 74px; font-size: 1.9rem; }
  .record-ring     { width: 96px; height: 96px; }
  .score-row       { grid-template-columns: 44px 1fr 40px; }
  .gauge-canvas    { width: 220px; height: 136px; }
}
