/* Base: reset, type, layout helpers, buttons, nav, footer. */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--surface); color: var(--text); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
}
.skip:focus { top: var(--s-4); }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--pad), 780px); }
.center { text-align: center; }

.eyebrow {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-3);
}
.eyebrow-dark { color: var(--cyan); }

.h2 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extra);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
.h3 { font-size: var(--fs-xl); font-weight: var(--fw-extra); line-height: var(--lh-snug); margin-bottom: var(--s-3); }
.lead { font-size: var(--fs-lg); color: var(--text-2); margin-top: var(--s-4); }
.fine { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--s-4); }
.on-dark { color: var(--on-dark); }
.on-dark-2 { color: var(--on-dark-2); }

.ring-text {
  background: var(--ring);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  font: inherit; font-weight: var(--fw-bold); font-size: var(--fs-md);
  padding: 14px 22px; border-radius: var(--r-pill);
  border: 0; cursor: pointer; text-decoration: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 10px 18px; font-size: var(--fs-sm); }
.btn-primary { background: var(--primary); color: var(--on-dark); box-shadow: var(--shadow-float); margin-top: var(--s-5); }
.btn-primary:hover { background: var(--primary-pressed); }
.btn-ring { background: var(--create); color: var(--on-dark); box-shadow: 0 10px 30px var(--night-glow); }
.emi .btn-ring { margin-top: var(--s-5); }
.btn-ghost-dark {
  background: var(--on-dark-fill); color: var(--on-dark);
  border: 1px solid var(--on-dark-border); backdrop-filter: blur(8px);
}
.btn-ghost-dark:hover { background: var(--on-dark-border); }

.play-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); position: relative; flex: none;
}
.play-dot::after {
  content: ""; position: absolute; left: 10px; top: 7px;
  border-left: 9px solid var(--primary); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
[data-playing="true"] .play-dot::after {
  left: 8px; top: 8px; width: 10px; height: 10px; border: 0;
  background: linear-gradient(90deg, var(--primary) 0 35%, transparent 35% 65%, var(--primary) 65%);
}

/* Store badge */
.store {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 10px 22px 10px 18px; border-radius: var(--r-md);
  text-decoration: none; line-height: 1.1;
  transition: transform var(--t-fast) var(--ease);
}
.store svg { width: 26px; height: 26px; }
.store small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); opacity: 0.85; }
.store strong { font-size: var(--fs-lg); font-weight: var(--fw-extra); }
.store-dark { background: var(--surface); color: var(--navy); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.store[aria-disabled="true"] { cursor: default; }
.store:not([aria-disabled="true"]):hover { transform: translateY(-2px); }

/* Ticks list */
.ticks { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-3); }
.ticks li { position: relative; padding-inline-start: 34px; color: var(--text-2); }
.ticks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-xs); font-weight: var(--fw-extra);
  color: var(--on-dark); background: var(--ring-diag);
}
.ticks strong { color: var(--text); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding-inline: var(--pad); color: var(--on-dark);
  transition: background var(--t-med), color var(--t-med), box-shadow var(--t-med);
}
.nav.is-solid {
  background: rgba(255, 255, 255, 0.86); color: var(--text);
  backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--border);
}
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; font-weight: var(--fw-extra); font-size: var(--fs-lg); letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 50%; }
.brand-dot { color: var(--cyan); }
.nav.is-solid .brand-dot { color: var(--primary); }
.nav-links { display: flex; gap: var(--s-5); }
.nav-links a { text-decoration: none; font-weight: var(--fw-semibold); font-size: var(--fs-sm); opacity: 0.85; }
.nav-links a:hover { opacity: 1; }
.nav-end { display: flex; align-items: center; gap: var(--s-3); }
.lang-select {
  position: relative; display: flex; align-items: center; gap: var(--s-2);
  border: 1px solid currentColor; border-radius: var(--r-pill);
  padding: 4px 10px 4px 12px; opacity: 0.92; cursor: pointer;
}
.lang-flag { font-size: var(--fs-md); line-height: 1; }
.lang-select select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit;
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-bold); cursor: pointer;
  padding-right: 16px; max-width: 190px; text-overflow: ellipsis;
}
.lang-select::after {
  content: ""; position: absolute; right: 12px; top: 50%; translate: 0 -30%;
  border: 4px solid transparent; border-top-color: currentColor; pointer-events: none;
}
.lang-select select option { color: var(--text); background: var(--surface); }
.lang-select select:focus, .lang-select select:focus-visible { outline: none; }
.lang-select:has(select:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 3px; }
.lang-select { border-color: var(--on-dark-border); background: var(--on-dark-fill); }
.nav.is-solid .lang-select { border-color: var(--border); background: var(--surface); }
@media (max-width: 480px) { .lang-select select { max-width: 92px; } }

@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .nav-end .btn { display: none; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
/* With GSAP, it drives these (no CSS transition fighting it). */
.has-gsap .reveal { transition: none; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: var(--on-dark-2); padding: var(--s-8) 0 var(--s-6); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-6); }
.footer h3 { font-size: var(--fs-sm); color: var(--on-dark); margin-bottom: var(--s-3); }
.footer nav { display: grid; gap: var(--s-2); align-content: start; }
.footer nav a { text-decoration: none; font-size: var(--fs-sm); }
.footer nav a:hover { color: var(--on-dark); }
.brand-footer { color: var(--on-dark); margin-bottom: var(--s-3); }
.footer-copy { margin-top: var(--s-7); font-size: var(--fs-xs); color: var(--on-dark-3); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* Headlines break at phrase boundaries (Japanese, Chinese, Korean) and stay balanced. */
.h2, .h3, .hero-title, .b2b-title { text-wrap: balance; }
:lang(ja) :is(h1, h2, h3, .lead), :lang(zh) :is(h1, h2, h3, .lead), :lang(ko) :is(h1, h2, h3) { word-break: auto-phrase; }
