/* assets/css/home.css — home page (animated greeting chorus, live numbers, story, listen, languages, design)
   All motion is CSS transforms/opacity (GPU-cheap) driven by assets/js/home.js; no WebGL. */

body { overflow-x: clip; }                    /* 100vw stage must not cause sideways scroll */
.home-v3.minimal-canvas { padding-top: 0; }

/* ── Dark stage behind hero + numbers + story ─────────────────────────── */
.home-stage {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background:
    var(--ndop-dark) repeat,
    linear-gradient(160deg, #0b1410 0%, #0c1711 45%, #11281e 100%);
}
.home-stage > section { position: relative; z-index: 1; }
.home-stage .hero-v2 { background: transparent; }

/* ── Greeting chorus (right half of the hero) ─────────────────────────── */
.hero-voices {
  position: relative;
  min-height: 520px;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  width: 100%;
  justify-self: center;
}
/* threads from the logo to each bubble; the live one carries a moving signal */
.voice-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.voice-links line {
  stroke: rgba(242,201,53,.18);
  stroke-width: .25;
  stroke-dasharray: 1.2 1.6;
  vector-effect: non-scaling-stroke;
  stroke-width: 1.2;
  transition: stroke .4s ease;
}
.voice-links line.is-live {
  stroke: rgba(242,201,53,.85);
  animation: signal 1.1s linear infinite;
}
@keyframes signal { to { stroke-dashoffset: -11; } }

/* the logo, broadcasting: rings swell out like sound waves */
.voice-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 132px; height: 132px;
  margin: -66px 0 0 -66px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1d3a2c, #0b1410 70%);
  box-shadow: 0 0 0 1px rgba(242,201,53,.35), 0 0 60px rgba(201,154,30,.25), inset 0 0 30px rgba(0,0,0,.5);
}
.voice-core img { width: 84px; height: 84px; position: relative; z-index: 1; animation: corePulse 2.4s ease-in-out infinite; }
.voice-core .ripple {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(242,201,53,.55);
  animation: ripple 3.6s cubic-bezier(.2,.6,.3,1) infinite;
}
.voice-core .ripple:nth-child(2) { animation-delay: 1.2s; border-color: rgba(0,166,125,.5); }
.voice-core .ripple:nth-child(3) { animation-delay: 2.4s; border-color: rgba(206,17,38,.45); }
@keyframes ripple {
  0%   { transform: scale(1);   opacity: .9; }
  100% { transform: scale(2.9); opacity: 0; }
}
@keyframes corePulse { 50% { transform: scale(1.06); filter: drop-shadow(0 0 14px rgba(242,201,53,.55)); } }

/* bubbles */
.voice {
  position: absolute;
  left: var(--x); top: var(--y);
  translate: -50% -50%;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  max-width: 190px;
  padding: .6rem .95rem .55rem;
  border-radius: 16px;
  border: 1px solid rgba(242,201,53,.28);
  background: rgba(17,38,29,.78);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  animation: bob 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.75s);
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, scale .35s cubic-bezier(.34,1.56,.64,1);
}
/* speech-bubble tail pointing back to the logo */
.voice::after {
  content: '';
  position: absolute; left: 50%; bottom: -6px;
  width: 12px; height: 12px; margin-left: -6px;
  background: inherit;
  border-right: 1px solid rgba(242,201,53,.28);
  border-bottom: 1px solid rgba(242,201,53,.28);
  transform: rotate(45deg);
}
.voice-text { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; line-height: 1.2; text-align: center; }
.voice-lang { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(239,231,214,.6); }
.voice:hover, .voice:focus-visible { border-color: rgba(242,201,53,.7); outline: none; }
.voice.is-speaking, .voice.is-playing {
  scale: 1.12;
  z-index: 2;
  background: linear-gradient(135deg, #f2c935, #c99a1e);
  border-color: #f2c935;
  color: var(--forest);
  box-shadow: 0 12px 40px rgba(201,154,30,.45), 0 0 0 6px rgba(242,201,53,.12);
}
.voice.is-speaking .voice-lang, .voice.is-playing .voice-lang { color: rgba(11,20,16,.7); }
.voice.is-playing { background: linear-gradient(135deg, #00a67d, #007a5e); border-color: #00a67d; color: #fff; }
.voice.is-playing .voice-lang { color: rgba(255,255,255,.8); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* tiny equaliser: wakes up while a bubble speaks */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.eq i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; opacity: .7; }
.voice.is-speaking .eq i, .voice.is-playing .eq i { animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s !important; }
.eq i:nth-child(3) { animation-delay: -.45s !important; }
.eq i:nth-child(4) { animation-delay: -.6s !important; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }

.voice-hint {
  position: absolute; left: 50%; bottom: -1.2rem; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .85rem; border-radius: 999px;
  font-size: .78rem; color: rgba(239,231,214,.7);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .hero-voices { min-height: 0; max-width: 440px; margin: 1.5rem auto 1rem; }
  .voice { max-width: 140px; padding: .45rem .7rem .4rem; }
  .voice-text { font-size: .86rem; }
  .voice-lang { font-size: .6rem; }
  .voice-core { width: 96px; height: 96px; margin: -48px 0 0 -48px; }
  .voice-core img { width: 60px; height: 60px; }
}
@media (max-width: 480px) {
  .voice:nth-of-type(n+7) { display: none; }   /* six bubbles fit a phone */
  .voice-links line:nth-child(n+7) { display: none; }
}

/* ── Scroll reveal (only once JS is running, so no-JS visitors see everything) ── */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}
.js-motion [data-reveal].is-revealed { opacity: 1; transform: none; }
.js-motion .home-numbers [data-reveal]:nth-child(2),
.js-motion .story-grid [data-reveal]:nth-child(2) { transition-delay: .12s; }
.js-motion .home-numbers [data-reveal]:nth-child(3),
.js-motion .story-grid [data-reveal]:nth-child(3) { transition-delay: .24s; }
.js-motion .home-numbers [data-reveal]:nth-child(4) { transition-delay: .36s; }

/* ── Story: three cards instead of the old full-screen camera stops ───── */
.home-story { padding: 3rem 0 7rem; }
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.story-step { display: flex; }
.story-panel {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%;
  padding: 2rem 1.8rem 1.8rem;
  border-radius: 1.25rem;
  color: #efe7d6;
  background: rgba(12,22,17,.6);
  border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease;
}
/* Toghu stitch across the top of each card */
.story-panel::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: var(--toghu) repeat-x center / auto 10px;
  opacity: .85;
}
.story-panel:hover { transform: translateY(-6px); border-color: rgba(242,201,53,.4); }
.story-panel p { flex: 1; color: rgba(239,231,214,.78); margin-bottom: 1.3rem; }
.story-panel h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  margin-bottom: .7rem;
  color: #fff;
}
.story-kicker {
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f2c935;
  margin: .4rem 0 .6rem;
}
.story-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.story-link {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600; font-size: .9rem;
  text-decoration: none;
  color: #0d1912;
  background: linear-gradient(135deg, #f2c935, #c99a1e);
  transition: transform .2s ease, box-shadow .2s ease;
}
.story-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,154,30,.35); color: #0d1912; }
.story-link.is-ghost { background: rgba(255,255,255,.08); color: #efe7d6; border: 1px solid rgba(255,255,255,.18); }
.story-link.is-ghost:hover { color: #fff; box-shadow: none; }
@media (max-width: 991.98px) {
  .story-grid { grid-template-columns: 1fr; padding: 0 1.25rem; }
}

/* the bottom wave gently rolls */
.hero-wave-bottom .wave-a { animation: wave 9s ease-in-out infinite; transform-origin: center bottom; }
@keyframes wave { 50% { transform: scaleY(1.35); } }

@media (prefers-reduced-motion: reduce) {
  .voice, .voice-core img, .voice-core .ripple, .voice-links line.is-live, .hero-wave-bottom .wave-a { animation: none !important; }
  .voice-core .ripple { display: none; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero-v3 { padding: 6.5rem 0 6rem; }
.hero-v3-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 2rem;
  align-items: center;
}

/* quick translate: one line on desktop, stacked on phones */
.quick-translate {
  display: flex;
  align-items: stretch;
  gap: .4rem;
  max-width: 560px;
  margin: 1.8rem 0 1.2rem;
  padding: .4rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.quick-translate input,
.quick-translate select {
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 1rem;
}
.quick-translate input { flex: 1; min-width: 0; padding: .7rem .9rem; }
.quick-translate input::placeholder { color: rgba(239,231,214, .5); }
.quick-translate select {
  max-width: 150px;
  padding: 0 .6rem;
  border-left: 1px solid rgba(255, 255, 255, .14);
  cursor: pointer;
}
.quick-translate select option { color: #0d1912; }
.quick-translate button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.2rem;
  border: 0;
  border-radius: .75rem;
  font-weight: 700;
  color: #0d1912;
  background: linear-gradient(135deg, #fcd116, #f3b31b);
  transition: transform .2s ease, box-shadow .2s ease;
}
.quick-translate button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(252, 209, 22, .3); }
.quick-translate:focus-within { border-color: rgba(252, 209, 22, .55); }

.hero-v3-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.hero-v3-links a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: rgba(239,231,214, .8);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
}
.hero-v3-links a:hover { color: #fcd116; }

/* ── Live numbers (inside the dark stage) ─────────────────────────────── */
.home-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.home-numbers .num {
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.home-numbers strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  line-height: 1.1;
  color: #fff;
}
.home-numbers span { color: rgba(239,231,214, .65); font-size: .9rem; }

/* ── Listen now ───────────────────────────────────────────────────────── */
.listen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.listen-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.2rem;
  text-align: left;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(10,90,69, .1);
  box-shadow: 0 8px 26px rgba(17,38,29, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.listen-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(17,38,29, .1); }
.listen-card.is-playing { border-color: var(--cm-green); }
.listen-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--cm-green), #009d71);
}
.listen-card.is-playing .listen-play { animation: listenPulse 1.2s ease-in-out infinite; }
@keyframes listenPulse { 50% { box-shadow: 0 0 0 8px rgba(0, 122, 94, .15); } }
.listen-text strong { display: block; font-size: 1.05rem; color: #11261d; }
.listen-text small { color: #6b7790; }

/* ── Languages ────────────────────────────────────────────────────────── */
.lang-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  max-width: 1000px;
  margin: 0 auto;
}
.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .95rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  color: #0a5a45;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(10,90,69, .14);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.lang-chip i { font-size: .72rem; color: var(--cm-green); }
.lang-chip:hover { background: #0a5a45; color: #fff; transform: translateY(-2px); }
.lang-chip:hover i { color: #fcd116; }

/* ── Design Studio showcase ───────────────────────────────────────────── */
.design-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #f4f1ff 0%, #fff8e6 100%);
  border: 1px solid rgba(201,154,30, .12);
}
.design-copy p { color: #4b5568; font-size: 1.05rem; }
.design-points { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; }
.design-points li { display: flex; align-items: center; gap: .7rem; padding: .35rem 0; color: #1d2b23; }
.design-points i { width: 1.4rem; color: #c99a1e; }
.design-cta { color: #fff; background: linear-gradient(135deg, #c99a1e, #a855f7); border: 0; }
.design-cta:hover { color: #fff; filter: brightness(1.08); }
.product-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.product-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.2rem .6rem;
  border-radius: 1rem;
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: #1d2b23;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 6px 20px rgba(17,38,29, .06);
  transition: transform .2s ease;
}
.product-tile:hover { transform: translateY(-3px); color: #c99a1e; }
.product-icon { font-size: 1.6rem; color: #c99a1e; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .hero-v3 { padding: 4.5rem 0 4rem; }
  .hero-v3-inner { grid-template-columns: 1fr; padding: 0 1.25rem; }
  .hero-voices { order: 2; }   /* chorus sits under the copy on tablets and phones */
  .hero-v3-copy { text-align: center; }
  .quick-translate { margin-left: auto; margin-right: auto; }
  .hero-v3-links { justify-content: center; }
  .design-showcase { grid-template-columns: 1fr; padding: 1.5rem; gap: 2rem; }
}
@media (max-width: 575.98px) {
  .quick-translate { flex-wrap: wrap; }
  .quick-translate input { flex-basis: 100%; }
  .quick-translate select { flex: 1; max-width: none; border-left: 0; }
  .home-numbers { padding: 0 1.25rem 1.5rem; grid-template-columns: 1fr 1fr; }
  .home-numbers strong { font-size: 1.5rem; }
  .product-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ── Word of the day (home) ───────────────────────── */
.wotd {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem;
  background: #fff; border: 1px solid var(--sand); border-radius: 20px;
  padding: 1.2rem 1.4rem; box-shadow: 0 10px 30px rgba(11,20,16,.06);
  position: relative; overflow: hidden;
}
.wotd::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: var(--toghu) repeat-x center / auto 6px; }
.wotd-label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dk); }
.wotd-text { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--forest-2); line-height: 1.15; text-decoration: none; display: block; }
.wotd-meaning { color: var(--text-soft); }
.wotd-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
@media (max-width: 640px) {
  .wotd { grid-template-columns: auto 1fr; }
  .wotd-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.wotd-play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--gold-grad); color: var(--forest); display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 6px 18px rgba(201,154,30,.4); transition: transform .15s; }
.wotd-play:hover { transform: scale(1.07); }
.wotd-play.is-playing { background: var(--cm-green); color: #fff; }
.wotd-wrap { max-width: 980px; margin: 0 auto; padding: 2.2rem 1rem 0; }
