/* ============================================================================
 * HanMadi marketing site — pre-launch landing.
 *
 * Tokens mirror lib/core/theme/colors.dart (Palette C "Aurora") so the web
 * surface stays in lockstep with the app. If the app palette changes, update
 * both files.
 * ============================================================================ */

:root {
  /* Aurora — light */
  --primary: #A695E0;
  --primary-strong: #8A78D2;
  --secondary: #8FA8E5;
  --accent: #F4B89A;
  --bg: #FBF7F4;
  --bg-alt: #F4EDF8;
  --surface: #FFFFFF;
  --ink: #1C1838;
  --ink-soft: #3B3560;
  --muted: #7E789C;
  --hairline: rgba(28, 24, 56, 0.08);
  --success: #7BC2A4;
  --error: #D87E96;

  /* Brand gradient stops */
  --g1: #A695E0;
  --g2: #C8AEE8;
  --g3: #F2B8C0;
  --g4: #F8D2A8;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-cta: 0 10px 30px -12px rgba(166, 149, 224, 0.55);
  --shadow-soft: 0 8px 28px -16px rgba(28, 24, 56, 0.18);

  --font-ja: "LINE Seed JP", "Noto Sans JP", "Hiragino Kaku Gothic ProN",
             "Yu Gothic", system-ui, sans-serif;
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #C4B5F2;
    --primary-strong: #D8C8FA;
    --secondary: #A8BCEE;
    --accent: #FFCAA8;
    --bg: #161226;
    --bg-alt: #1E1A36;
    --surface: #231E3C;
    --ink: #F0E8F8;
    --ink-soft: #D2C8E8;
    --muted: #A89FC4;
    --hairline: rgba(255, 255, 255, 0.08);

    --g1: #C4B5F2;
    --g2: #D8B8F0;
    --g3: #FFB8C8;
    --g4: #FFD2A8;

    --shadow-cta: 0 10px 30px -12px rgba(196, 181, 242, 0.45);
    --shadow-soft: 0 8px 28px -18px rgba(0, 0, 0, 0.6);
  }
}

/* ── Reset / base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-feature-settings: "palt" 1;
  letter-spacing: -0.01em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[data-lang="en"] body { font-family: var(--font-en); }

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

.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;
}

/* ── Aurora background blobs ─────────────────────────────────────────────── */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none;
}
.aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.aurora .blob-1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--g1), transparent 65%);
  animation: drift1 28s ease-in-out infinite alternate;
}
.aurora .blob-2 {
  width: 480px; height: 480px;
  top: 10%; right: -160px;
  background: radial-gradient(circle at 70% 40%, var(--g3), transparent 65%);
  animation: drift2 34s ease-in-out infinite alternate;
}
.aurora .blob-3 {
  width: 600px; height: 600px;
  bottom: -260px; left: 20%;
  background: radial-gradient(circle at 50% 50%, var(--g4), transparent 65%);
  opacity: 0.42;
  animation: drift3 40s ease-in-out infinite alternate;
}
@media (prefers-color-scheme: dark) {
  .aurora .blob { opacity: 0.35; }
  .aurora .blob-3 { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora .blob { animation: none; }
}
@keyframes drift1 {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(40px, 60px, 0) scale(1.08); }
}
@keyframes drift2 {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(-60px, 40px, 0) scale(1.05); }
}
@keyframes drift3 {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(50px, -40px, 0) scale(1.06); }
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 20px max(20px, env(safe-area-inset-left));
  max-width: 1080px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
}
.brand img {
  width: 36px; height: 36px;
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lang-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--hairline);
  border-radius: var(--radius-pill);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 160ms ease, color 160ms ease;
}
.lang-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left));
}

.hero {
  padding: 56px 0 64px;
  max-width: 720px;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
@media (prefers-color-scheme: dark) {
  .eyebrow { background: rgba(196,181,242,0.12); color: var(--primary-strong); }
}

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--ink);
}
.hero-title span[hidden] { display: none; }

.hero-sub {
  margin: 0 0 32px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 560px;
  letter-spacing: -0.01em;
}

/* ── Signup form ─────────────────────────────────────────────────────────── */
.signup {
  display: flex;
  gap: 8px;
  max-width: 480px;
  flex-wrap: wrap;
}
.signup input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.signup input[type="email"]::placeholder { color: var(--muted); }
.signup input[type="email"]:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(166,149,224,0.18);
}

.cta {
  position: relative;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-pill);
  color: #1C1838;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg,
    var(--g1) 0%, var(--g2) 35%, var(--g3) 70%, var(--g4) 100%);
  box-shadow: var(--shadow-cta);
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.cta:hover { filter: brightness(1.04); }
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: 0.7; cursor: progress; }

.cta-spinner {
  display: none;
  width: 16px; height: 16px;
  margin-left: 8px;
  vertical-align: -3px;
  border: 2px solid rgba(28,24,56,0.25);
  border-top-color: #1C1838;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}
.cta.is-loading .cta-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-hint {
  flex-basis: 100%;
  margin: 12px 2px 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.form-hint.is-error { color: var(--error); }
.form-hint.is-success { color: var(--ink-soft); }

/* ── Bullets ─────────────────────────────────────────────────────────────── */
.bullets { padding: 24px 0 80px; }
.bullets ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.bullets li {
  display: flex;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.bullets h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.bullets p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.bullets span[hidden] { display: none; }

.dot {
  flex: 0 0 auto;
  width: 12px; height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  box-shadow: 0 4px 12px -4px rgba(166,149,224,0.6);
}
.dot-2 { background: linear-gradient(135deg, var(--g2), var(--g3)); }
.dot-3 { background: linear-gradient(135deg, var(--g3), var(--g4)); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-left)) 32px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
}
.foot a { color: var(--muted); border-bottom: 1px solid transparent; }
.foot a:hover { color: var(--ink-soft); border-bottom-color: var(--hairline); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.4);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 50;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ── Hide language-inactive content via attribute ─────────────────────────── */
html[data-lang="ja"] [data-i18n$=".en"] { display: none; }
html[data-lang="en"] [data-i18n$=".ja"] { display: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .hero { padding: 32px 0 48px; }
  .bullets ul { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}
@media (max-width: 480px) {
  .topbar { padding-top: 16px; padding-bottom: 12px; }
  .brand-name { display: none; }
  .signup input[type="email"] { flex-basis: 100%; }
  .cta { width: 100%; }
}
