/* ========================================
   NiHaWa Website — Apple-inspired Design
   ======================================== */

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

:root {
  /* Colors */
  --color-warm-white: #FAFAF8;
  --color-ink: #1D1D1F;
  --color-ink-muted: #86868B;
  --color-deep: #0A0A0A;
  --color-deep-footer: #050505;
  --color-accent: #E84D3D;
  --color-gold: #C8A96E;
  --color-glass-border: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --section-padding: 140px 0;
  --content-max: 1080px;
  --gutter: 24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-deep);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Container --- */
.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--gutter);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #fff;
}

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-menu-btn.active span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-menu-btn.active span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  padding: 16px var(--gutter) 24px;
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.3s ease;
}

.nav-mobile a:hover {
  color: #fff;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-deep);
  padding: 120px var(--gutter) 80px;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 780px;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--color-ink-muted);
  line-height: 1.4;
  margin-bottom: 40px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 500;
  color: #2997ff;
  transition: color 0.3s ease;
}

.hero-cta:hover {
  color: #5eb8ff;
}

.hero-cta svg {
  animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Phone Mockup */
.hero-preview {
  margin-top: 64px;
  position: relative;
  z-index: 2;
}

.phone-mockup {
  width: 280px;
  height: 560px;
  border-radius: 40px;
  background: #1a1a1e;
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 120px rgba(232, 77, 61, 0.08);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(180deg, #1e1e24 0%, #16161a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 16px 32px;
  overflow: hidden;
}

/* Waveform */
.phone-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}

.phone-waveform span {
  width: 3px;
  border-radius: 2px;
  background: var(--color-accent);
  animation: wave 1.2s ease-in-out infinite;
}

.phone-waveform span:nth-child(1) { height: 8px; animation-delay: 0s; }
.phone-waveform span:nth-child(2) { height: 16px; animation-delay: 0.08s; }
.phone-waveform span:nth-child(3) { height: 24px; animation-delay: 0.16s; }
.phone-waveform span:nth-child(4) { height: 32px; animation-delay: 0.24s; }
.phone-waveform span:nth-child(5) { height: 20px; animation-delay: 0.32s; }
.phone-waveform span:nth-child(6) { height: 28px; animation-delay: 0.4s; }
.phone-waveform span:nth-child(7) { height: 14px; animation-delay: 0.48s; }
.phone-waveform span:nth-child(8) { height: 22px; animation-delay: 0.56s; }
.phone-waveform span:nth-child(9) { height: 30px; animation-delay: 0.64s; }
.phone-waveform span:nth-child(10) { height: 18px; animation-delay: 0.72s; }
.phone-waveform span:nth-child(11) { height: 26px; animation-delay: 0.8s; }
.phone-waveform span:nth-child(12) { height: 12px; animation-delay: 0.88s; }
.phone-waveform span:nth-child(13) { height: 20px; animation-delay: 0.96s; }
.phone-waveform span:nth-child(14) { height: 28px; animation-delay: 1.04s; }
.phone-waveform span:nth-child(15) { height: 16px; animation-delay: 1.12s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); opacity: 0.6; }
  50% { transform: scaleY(1.8); opacity: 1; }
}

/* Conversation bubbles */
.phone-conversation {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 400;
  max-width: 85%;
}

.phone-bubble-ai {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.phone-bubble-user {
  background: var(--color-accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Mic button */
.phone-mic {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-mic-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  animation: mic-pulse 2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.2; }
}

.phone-mic-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* Tone bar */
.phone-tone-bar {
  display: flex;
  gap: 8px;
}

.tone {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.tone-correct {
  background: rgba(88, 204, 2, 0.15);
  color: #58cc02;
}

.tone-wrong {
  background: rgba(232, 77, 61, 0.15);
  color: #E84D3D;
  text-decoration: line-through;
}

/* Hero gradient */
.hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent, var(--color-warm-white));
  pointer-events: none;
}

/* --- Features Section --- */
.features {
  background: var(--color-warm-white);
  padding: var(--section-padding);
}

.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--color-ink-muted);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 72px;
  line-height: 1.5;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-card {
  text-align: center;
  padding: 40px 32px 0;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
}

.feature-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 15px;
  color: var(--color-ink-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 32px;
}

/* Feature preview cards */
.feature-preview {
  margin: 32px -32px 0;
}

.preview-card {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-speaking {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.preview-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 60px;
}

.preview-wave span {
  width: 4px;
  border-radius: 2px;
  background: var(--color-accent);
  opacity: 0.7;
}

.preview-wave span:nth-child(odd) { height: 20px; }
.preview-wave span:nth-child(even) { height: 36px; }
.preview-wave span:nth-child(3n) { height: 44px; }
.preview-wave span:nth-child(5n) { height: 28px; }

.preview-listening {
  background: linear-gradient(135deg, #1a1a2e 0%, #162447 100%);
  padding: 0 32px;
}

.speed-bars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speed-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.speed-bar span {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  width: 40px;
  text-align: right;
}

.bar-fill {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.bar-fill::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
}

.bar-fill.slow::after {
  width: 35%;
  background: #2997ff;
}

.bar-fill.medium::after {
  width: 65%;
  background: #58cc02;
}

.bar-fill.natural::after {
  width: 100%;
  background: var(--color-accent);
}

.preview-culture {
  background: linear-gradient(135deg, #2d1b1b 0%, #1a1a2e 100%);
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px;
}

.culture-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.culture-tag {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(200, 169, 110, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(200, 169, 110, 0.2);
}

/* --- Why NiHaWa Section --- */
.why {
  background: var(--color-deep);
  padding: var(--section-padding);
}

.why .section-title {
  color: #fff;
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-bottom: 80px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  flex: 1;
  min-width: 160px;
}

.stat-number {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 15px;
  color: var(--color-ink-muted);
  line-height: 1.5;
}

.stat-divider {
  width: 1px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
}

.why-quotes {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.why-quote {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.why-quote:nth-child(2) {
  color: rgba(255, 255, 255, 0.6);
}

.why-quote:nth-child(3) {
  color: rgba(255, 255, 255, 0.4);
}

/* --- CTA Section --- */
.cta {
  background: var(--color-warm-white);
  padding: var(--section-padding);
  text-align: center;
}

.store-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-radius: 12px;
  background: var(--color-ink);
  color: #fff;
  transition: opacity 0.3s ease;
}

.store-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.store-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.store-btn-small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}

.store-btn-big {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- Footer --- */
.footer {
  background: var(--color-deep-footer);
  padding: 40px var(--gutter);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--color-ink-muted);
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-size: 13px;
  color: var(--color-ink-muted);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #fff;
}

/* --- Scroll Animations --- */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.feature-card.animate-in:nth-child(2) {
  transition-delay: 0.12s;
}

.feature-card.animate-in:nth-child(3) {
  transition-delay: 0.24s;
}

.why-quote.animate-in:nth-child(2) {
  transition-delay: 0.15s;
}

.why-quote.animate-in:nth-child(3) {
  transition-delay: 0.3s;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .phone-waveform span {
    animation: none;
  }

  .phone-mic-ring {
    animation: none;
  }

  .hero-cta svg {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-padding: 100px 0;
    --gutter: 20px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card:last-child {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
    --gutter: 20px;
  }

  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: flex;
  }

  .hero {
    padding: 100px var(--gutter) 60px;
  }

  .phone-mockup {
    width: 220px;
    height: 440px;
    border-radius: 32px;
  }

  .phone-screen {
    border-radius: 24px;
    padding: 30px 12px 24px;
  }

  .phone-waveform span {
    width: 2px;
  }

  .phone-waveform {
    gap: 2px;
  }

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

  .feature-card:last-child {
    grid-column: span 1;
    max-width: 100%;
  }

  .stats-row {
    flex-direction: column;
    gap: 40px;
  }

  .stat-divider {
    width: 60px;
    height: 1px;
  }

  .store-buttons {
    flex-direction: column;
    align-items: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
  }
}

/* Small mobile */
@media (max-width: 390px) {
  :root {
    --gutter: 16px;
  }

  .phone-mockup {
    width: 200px;
    height: 400px;
    border-radius: 28px;
  }

  .phone-screen {
    border-radius: 20px;
  }

  .phone-bubble {
    font-size: 12px;
    padding: 8px 12px;
  }

  .tone {
    font-size: 12px;
    padding: 3px 8px;
  }
}
