/* ===== Hanasu2 landing page ===== */

:root {
  --bg: #14110b;
  --bg-alt: #1a1610;
  --fg: #f7f3ea;
  --fg-muted: #b0a691;
  --amber: #fbbf24;
  --amber-deep: #f59e0b;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== Hero ===== */

.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* CSS fallback if WebGL never draws */
  background:
    radial-gradient(90rem 40rem at 80% -10%, rgba(245, 158, 11, 0.28), transparent 60%),
    radial-gradient(60rem 30rem at 10% 110%, rgba(180, 100, 15, 0.22), transparent 60%),
    var(--bg);
}

.hero-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 48px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-menu {
  position: relative;
}

.lang-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-toggle svg {
  width: 19px;
  height: 19px;
}

.lang-toggle:hover {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  background: #201b12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 10;
}

.lang-dropdown .lang-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--fg);
  background: none;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-dropdown .lang-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.lang-dropdown .lang-btn[aria-pressed="true"] {
  color: var(--amber);
  font-weight: 600;
}

.topbar-cta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--amber);
  color: #1a1200;
  transition: transform 0.2s ease, background 0.2s ease;
}

.topbar-cta:hover {
  background: var(--amber-deep);
  transform: translateY(-1px);
}

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(48px, 8vh, 96px) 24px 24px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
}

.hero-eyebrow .num {
  font-weight: 700;
  font-size: 1.35em;
  color: var(--fg);
}

.hero-title .accent {
  color: var(--amber);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  text-wrap: balance;
}

.hero-sub {
  max-width: 34em;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--fg-muted);
  margin-bottom: 36px;
  text-wrap: pretty;
}

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

.app-store-link {
  display: inline-block;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.app-store-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.app-store-badge {
  height: 48px;
  width: auto;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* Floating chat bubbles */

.hero-bubbles {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 24px clamp(40px, 7vh, 72px);
}

.bubble {
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 20px;
  max-width: 30em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bubble-in 0.7s ease both;
}

.bubble-character {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  align-self: center;
  transform-origin: bottom left;
  animation-delay: 0.3s;
}

.bubble-user {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.25);
  animation-delay: 1.1s;
}

.bubble-tutor {
  background: rgba(251, 191, 36, 0.92);
  color: #241a02;
  font-weight: 500;
  animation-delay: 1.9s;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Sections ===== */

.section {
  position: relative;
  padding: clamp(72px, 12vh, 128px) clamp(20px, 6vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
}

.section-alt {
  max-width: none;
  background: var(--bg-alt);
}

.section-alt > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.section-eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  text-align: center;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: clamp(40px, 6vh, 64px);
  text-wrap: balance;
}

/* Two AIs */

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

.duo-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 40px);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.duo-card:hover {
  border-color: rgba(251, 191, 36, 0.35);
  transform: translateY(-3px);
}

.duo-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.duo-icon svg { width: 26px; height: 26px; }

.duo-icon-character {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.duo-icon-tutor {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}

.duo-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.duo-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber);
  margin: 2px 0 12px;
}

.duo-card:nth-child(2) .duo-tag { color: #93c5fd; }

.duo-card p:last-child { color: var(--fg-muted); }

/* Steps */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(24px, 4vw, 40px);
  counter-reset: step;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 16px;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p { color: var(--fg-muted); }

/* Features */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

.feature {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 26px 28px;
  transition: border-color 0.3s ease;
}

.feature:hover { border-color: rgba(251, 191, 36, 0.3); }

.feature h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature p {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

/* Languages */

.lang-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
}

.lang-chips li {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-border);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.lang-chips li:hover {
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--amber);
}

/* Final CTA */

.final-cta {
  text-align: center;
  overflow: hidden;
}

.final-cta .section-title { margin-bottom: 16px; }

.final-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(40rem 22rem at 50% 110%, rgba(245, 158, 11, 0.18), transparent 70%);
  pointer-events: none;
}

.final-sub {
  position: relative;
  color: var(--fg-muted);
  margin-bottom: 36px;
}

.final-cta .app-store-link { position: relative; }

/* Footer */

.footer {
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.footer a:hover { color: var(--fg); }

.footer .lang-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.footer .lang-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.footer .lang-btn:hover {
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--fg);
}

.footer .lang-btn[aria-pressed="true"] {
  border-color: var(--amber);
  color: var(--amber);
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Responsive */

.br-desktop { display: none; }

@media (min-width: 700px) {
  .br-desktop { display: inline; }

  .hero-bubbles {
    align-items: flex-start;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }

  .bubble-user { align-self: flex-end; }
}

@media (max-width: 480px) {
  .app-store-badge { height: 52px; }
  .topbar-cta { padding: 10px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .duo-card:hover, .app-store-link:hover, .topbar-cta:hover { transform: none; }
}
