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

:root {
  /* palette */
  --cream-2: #FCEFD0;
  --ink: #3A2E18;
  --text: #5C4A2A;
  --muted: #8a7444;
  --gold: #F0B53D;
  --rose: #FF7E9D;
  --mint: #5FD0BE;
  --sky: #7FB8FF;
  --border: #ECD9A8;
  /* phone frame */
  --dev-w: 264px;        /* phone width on desktop (hover zooms larger) */
  --dev-radius: 50px;    /* outer bezel corner */
  --screen-radius: 40px; /* inner screen corner */
  --bezel: 11px;         /* bezel thickness */
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { color: var(--ink); line-height: 1.22; letter-spacing: .5px; }
a { color: inherit; }

/* ---------- nav ---------- */
#nav {
  position: sticky; top: 0; z-index: 50; width: 100%;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid #EFE7D4;
  transition: box-shadow .2s ease, background .2s ease;
}
#nav.scrolled { background: rgba(255,255,255,.96); box-shadow: 0 4px 20px rgba(58,46,24,.08); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 12px 22px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; color: var(--ink); letter-spacing: 1px; text-decoration: none; }
.logo img { width: 38px; height: 38px; border-radius: 11px; }

/* ---------- language switcher ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--border); color: var(--ink);
  font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.lang-btn:hover { border-color: var(--rose); box-shadow: 0 4px 12px rgba(255,126,157,.18); }
.lang-btn .chev { transition: transform .2s ease; font-size: 11px; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 34px rgba(58,46,24,.16); padding: 6px; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease; z-index: 60;
}
.lang-menu.open { opacity: 1; visibility: visible; transform: none; }
.lang-menu li button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text);
  padding: 10px 14px; border-radius: 9px; transition: background .15s ease, color .15s ease;
}
.lang-menu li button:hover { background: #FFF1F4; color: var(--rose); }
.lang-menu li button.active { color: var(--rose); }
.lang-menu li button:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; background: #FFF1F4; }

/* ---------- store badges ---------- */
.badges { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.badges img { display: block; width: auto; transition: transform .2s ease; }
.badges a:hover img { transform: translateY(-3px); }
.badge-apple { height: 52px; }
.badge-google { height: 52px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 30px 0 70px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; align-items: center; }
.hero h1 { font-size: clamp(34px, 6.4vw, 60px); font-weight: 900; }
.hl { position: relative; color: var(--rose); white-space: nowrap; }
.hl svg { position: absolute; left: 0; right: 0; bottom: -14px; width: 100%; height: 16px; }
.type { display: inline-block; min-width: 2.3em; text-align: left; color: var(--ink); }
.caret { display: inline-block; width: 3px; height: .92em; background: var(--rose); margin-left: 3px; border-radius: 2px; vertical-align: -0.08em; animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.hero .sub { margin: 22px 0 30px; font-size: clamp(16px, 2.2vw, 19px); max-width: 30em; }
.hero .badges { margin-top: 8px; }

.stage { position: relative; display: grid; place-items: center; min-height: 420px; }
.hero-art { position: relative; z-index: 2; width: auto; max-width: 100%; max-height: 560px; height: auto; filter: drop-shadow(0 22px 26px rgba(58,46,24,.18)); }

/* floating language tiles around Hikari */
.tile {
  position: absolute; z-index: 3; display: grid; place-items: center;
  min-width: 50px; height: 50px; padding: 0 12px; border-radius: 15px;
  font-weight: 900; font-size: 20px; color: #fff;
  box-shadow: 0 10px 18px rgba(58,46,24,.16);
  animation: float 4.5s ease-in-out infinite;
}
.tile.t1 { top: 6%;  left: -2%;  background: var(--rose); transform: rotate(-10deg); animation-delay: .0s; }
.tile.t2 { top: 0%;  right: 6%;  background: var(--mint); transform: rotate(8deg);  animation-delay: .8s; }
.tile.t3 { top: 40%; right: -4%; background: var(--sky);  transform: rotate(-6deg); animation-delay: 1.5s; }
.tile.t4 { bottom: 10%; left: -4%; background: var(--gold); transform: rotate(7deg); animation-delay: .4s; }
.tile.t5 { bottom: 2%; right: 10%; background: var(--rose); transform: rotate(-8deg); animation-delay: 1.1s; font-size: 16px; }
/* tiles keep their rotation while floating */
.tile.t1 { --r: rotate(-10deg); } .tile.t2 { --r: rotate(8deg); } .tile.t3 { --r: rotate(-6deg); }
.tile.t4 { --r: rotate(7deg); } .tile.t5 { --r: rotate(-8deg); }

/* ---------- generic section ---------- */
section { position: relative; padding: 64px 0; }
.section-title { font-size: clamp(26px, 4.6vw, 40px); font-weight: 900; text-align: center; }

/* ---------- Hikari intro (simple) ---------- */
.hikari { text-align: center; }
.char-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0 22px; }
.char-tags span { background: #FFF1F4; color: var(--rose); font-weight: 700; font-size: 13px; padding: 5px 13px; border-radius: 999px; }
.char-intro { max-width: 32em; margin: 0 auto; font-size: 17px; color: var(--text); }

/* ---------- alternating feature rows ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 48px 0; }
.feature:nth-child(even) .feat-media { order: -1; }
.feat-text .num { font-weight: 900; color: var(--gold); font-size: 16px; letter-spacing: 2px; }
.feat-text h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 900; margin: 8px 0 12px; white-space: pre-line; }
.feat-text p { font-size: 17px; white-space: pre-line; }
/* ===== Phone frame: static CSS iPhone + slide-in entrance + hover zoom ===== */
/* phone column: slides in from its own side + fades in (one-shot, on scroll into view) */
.feature:nth-child(odd)  { --slide-x:  44px; } /* media on right → enter from right */
.feature:nth-child(even) { --slide-x: -44px; } /* media on left  → enter from left  */
.feat-media {
  display: grid; place-items: center; position: relative;
  opacity: 0; transform: translateX(var(--slide-x, 44px));
  transition: opacity .7s ease .04s, transform .8s cubic-bezier(.2,.8,.2,1) .04s;
}
.feature.in .feat-media { opacity: 1; transform: none; }

/* the device — static, flat */
.device {
  position: relative; z-index: 2;
  width: var(--dev-w); max-width: 80%;
  padding: var(--bezel); border-radius: var(--dev-radius);
  background: linear-gradient(150deg, #fffdf6 0%, #efe2c2 40%, #cdb98a 100%);
  box-shadow:
     0 0 0 1px rgba(255,255,255,.7) inset,
     0 1px 0 rgba(255,255,255,.9) inset,
     0 0 0 1.5px #d9c184,
     0 26px 52px rgba(58,46,24,.20);
  transform-origin: center; transition: transform .4s cubic-bezier(.2,.8,.2,1);
}

/* hover: gently zoom the phone larger — only when actually over the phone (desktop pointers) */
@media (hover: hover) and (pointer: fine) {
  .device:hover { transform: scale(1.3); }
}

/* glass screen that crops the screenshot (status bar + island are baked into the shot) */
.device-screen {
  position: relative; overflow: hidden;
  border-radius: var(--screen-radius);
  background: #0b0b0d; box-shadow: 0 0 0 2px #1a1814 inset; line-height: 0;
}
.phone { display: block; width: 100%; height: auto; border: 0; border-radius: 0; background: var(--cream-2); }

/* faint static diagonal glass sheen */
.device-sheen {
  position: absolute; z-index: 3; inset: var(--bezel);
  border-radius: var(--screen-radius); pointer-events: none;
  background: linear-gradient(125deg,
     rgba(255,255,255,0) 38%, rgba(255,255,255,.14) 50%, rgba(255,255,255,0) 62%);
  mix-blend-mode: screen; opacity: .85;
}

/* bigger frame on small screens too */
@media (max-width: 820px) {
  .device { width: 300px; max-width: 84%; }
}

/* ---------- footer ---------- */
footer { padding: 40px 22px 56px; text-align: center; border-top: 1px solid var(--border); }
.copyright { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.footer-links a { color: #8a6f33; font-weight: 600; font-size: 14px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-social { margin-top: 16px; }
.legal { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ---------- animations ---------- */
@keyframes float { 0%,100% { transform: translateY(0) var(--r,); } 50% { transform: translateY(-16px) var(--r,); } }
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .sub { margin-left: auto; margin-right: auto; }
  .hero .badges { justify-content: center; }
  .stage { order: -1; max-width: 380px; margin: 0 auto 10px; }
  .feature { grid-template-columns: 1fr; gap: 22px; text-align: center; }
  .feature:nth-child(even) .feat-media { order: 0; }
  .feat-text p { margin-left: auto; margin-right: auto; max-width: 30em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .feat-media { opacity: 1 !important; transform: none !important; transition: none !important; }
  .device { transition: none !important; }
}
