:root {
  /* --- Theme accent (swap these two lines to retheme) --- */
  /* 紅 brand red (matches the book interior + cover) */ --accent: #b33a2b; --accent-hover: #8f2c1f;
  /* alternates — 藍 indigo: #35506b / #2a4153  ·  抹茶 matcha: #6f7f4e / #5e6d40  ·  墨 sumi: #3a3a36 / #24241f */

  --paper:      #f7f4ec;   /* washi / kinari off-white */
  --paper-card: #fffdf7;   /* slightly brighter for inputs */
  --ink:        #23241f;   /* sumi ink */
  --ink-soft:   #6f6f64;   /* muted */
  --hair:       rgba(35, 36, 31, 0.14);

  --serif: "Noto Serif JP", Georgia, "Yu Mincho", serif;
  --sans:  "Noto Sans JP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(900px 480px at 50% -6%, #fffdf8 0%, rgba(255,253,248,0) 70%);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 9vh 28px 56px;
}

/* ---- Masthead ---- */
.masthead { text-align: center; }

.kicker {
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 1.8rem;
  display: inline-flex;
  align-items: center;
}
.kicker [lang="ja"] { letter-spacing: 0.12em; font-weight: 500; }
.kicker-dot { margin: 0 0.7em; opacity: 0.5; }

.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 8.5vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
  color: var(--ink);
}

.subtitle {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 3vw, 1.18rem);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 30ch;
}

/* ---- Cover (hero image) ---- */
.cover {
  display: block;
  width: min(300px, 72%);
  height: auto;
  margin: 0.6rem auto 0;
  border-radius: 6px;
  border: 1px solid rgba(35, 36, 31, 0.08);
  box-shadow: 0 18px 44px rgba(35, 36, 31, 0.20),
              0 4px 12px rgba(35, 36, 31, 0.10);
}

/* ---- Demo (open, hairline-framed — no heavy box) ---- */
.demo { margin: 3rem 0 0; }

.demo-card {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 2.2rem 0;
}

.demo-row { text-align: center; }

.demo-label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.demo-label--jp { color: var(--accent); }

.demo-line {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 4vw, 1.45rem);
  margin: 0;
  transition: opacity 0.45s ease;
  color: var(--ink);
}
.demo-line { color: var(--ink-soft); }            /* English line: quieter */
.demo-line--jp { color: var(--ink); font-weight: 500; }

/* Actual Japanese (kana/kanji) — the payoff line */
.demo-jp, .demo-romaji { transition: opacity 0.45s ease; }
.demo-jp {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  color: var(--ink);
  line-height: 2;
  margin: 1rem 0 0;
}
.demo-jp ruby rt {
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 400;
  color: var(--ink-soft);   /* readings: soft helper text */
  letter-spacing: 0.04em;
}
.demo-jp .verb rt { color: inherit; }  /* the verb's reading shares the red */
.demo-romaji {
  font-family: Georgia, "Times New Roman", serif;  /* Latin italic with proper macron glyphs */
  font-style: italic;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin: 0.35rem 0 0;
}

.verb {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
}

.demo-arrow {
  text-align: center;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
  margin: 1rem 0;
  opacity: 0.7;
}

.is-fading { opacity: 0; }

.demo-caption {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
  padding: 2.4rem 0;   /* equal above/below -> centered between the two hairlines */
}
.nowrap { white-space: nowrap; }

/* ---- Brand bar ---- */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2.6rem;
}
.brand-logo { width: 40px; height: auto; display: block; }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand-name em { color: var(--accent); font-style: normal; }

/* ---- Hook ---- */
.hook {
  text-align: center;
  margin: 2.6rem auto 0;
  max-width: 32ch;
}
.hook h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 6.4vw, 2.5rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  color: var(--ink);
}
.hook p {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: #3a3b34;
  max-width: 46ch;
  margin: 0 auto;
}
.hook strong { font-weight: 600; color: var(--ink); }
.hook em { color: var(--ink); font-style: italic; }

/* ---- Feature blocks ---- */
.features { margin: 0; }
.feature {
  border-top: 1px solid var(--hair);
  padding: 2.6rem 0;
}
/* last feature has no bottom border — the signup's top hairline is the divider */
.feature-label {
  display: block;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.feature-label[lang="ja"] { letter-spacing: 0.12em; }
.feature h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 4.6vw, 1.7rem);
  text-align: center;
  margin: 0 0 0.9rem;
  color: var(--ink);
}
.feature p {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.75;
  color: #3a3b34;
  max-width: 48ch;
  margin: 0 auto;
  text-align: center;
}
.feature em { color: var(--ink); font-style: italic; }
.feature-cta {
  display: block;
  text-align: center;
  margin-top: 1.3rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.feature-cta:hover { text-decoration: underline; }

/* ---- Animated hero scene ---- */
.hero-stage {
  display: block;
  width: min(440px, 100%);
  aspect-ratio: 16 / 10;     /* reserves height so the animation never shifts layout */
  height: auto;
  margin: 1.7rem auto 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--hair);
  overflow: hidden;
  background: #e9edf1;
}
.hero-svg { display: block; width: 100%; height: 100%; }
.hero-svg .sign { font-family: var(--serif); font-size: 11px; fill: #2c3e50; text-anchor: middle; }
.hero-svg .lyr { opacity: 0; transition: opacity 0.5s ease; }
.hero-svg .lyr.show { opacity: 1; }
.hero-svg .l-cup { transform-box: fill-box; transform-origin: 50% 100%; }
.hero-svg.drinking .l-cup { animation: hero-drink 1.6s ease-in-out forwards; }
@keyframes hero-drink {
  0%   { transform: translate(0,0) rotate(0); }
  28%  { transform: translate(-46px,-18px) rotate(0); }
  52%  { transform: translate(-46px,-18px) rotate(-28deg); }
  78%  { transform: translate(-46px,-18px) rotate(0); }
  100% { transform: translate(0,0) rotate(0); }
}

.hero-sentence {
  text-align: center;
  max-width: 440px;
  margin: 0.2rem auto 0;
  /* the three lines below reserve their own height, so no layout shift */
}
.hero-en {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0;
  min-height: 1.6rem;
}
.hero-en .w { opacity: 0; transition: opacity 0.5s ease; }
.hero-en .w.show { opacity: 1; }
.hero-ja {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  line-height: 1.7;
  margin: 0.35rem 0 0;
  min-height: 2rem;
}
.hero-ja ruby rt {
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.hero-ja .verb rt { color: inherit; }
.hero-reveal { opacity: 0; transition: opacity 0.6s ease; }
.hero-reveal.show { opacity: 1; }
.hero-romaji {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0;
  min-height: 1.2rem;
}

/* ---- Pitch ---- */
.pitch {
  max-width: 54ch;
  margin: 2.8rem auto;
  font-family: var(--serif);
  font-size: 1.04rem;
  line-height: 1.8;
  color: #3a3b34;
}
.pitch p { margin: 0 0 1.1rem; }
.pitch strong { font-weight: 600; color: var(--ink); }
.pitch em { color: var(--ink); }

/* ---- Signup (open + hairline, airy) ---- */
.signup {
  border-top: 1px solid var(--hair);
  padding: 2.6rem 0 0.5rem;
  margin: 0;   /* the border-top divides; no extra margin, so the last feature stays centered */
  text-align: center;
}
.signup h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.signup-sub {
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
  font-size: 0.96rem;
}

.field {
  display: flex;
  gap: 10px;
  max-width: 430px;
  margin: 0 auto;
}

#email {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--hair);
  background: var(--paper-card);
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#email::placeholder { color: #a6a69a; }
#email:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

#submit-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.97rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.05s ease;
  white-space: nowrap;
}
#submit-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
#submit-btn:active { transform: translateY(1px); }
#submit-btn:disabled { opacity: 0.55; cursor: default; }

.hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }

.form-msg {
  min-height: 1.2em;
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.form-msg.ok  { color: var(--accent); }
.form-msg.err { color: #b06a4f; }

.privacy {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 1.3rem 0 0;
}

/* ---- Footer ---- */
.foot {
  text-align: center;
  margin-top: 3.6rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.92rem;
}
.foot [lang="ja"] { color: var(--ink); }
.foot-sep { margin: 0 0.3rem; opacity: 0.4; }
.foot-copy {
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  margin-top: 0.9rem;
  color: #9a9a8e;
}

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

@media (max-width: 480px) {
  .field { flex-direction: column; }
  #submit-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-line, .demo-jp, .demo-romaji { transition: none; }
  .hero-svg .lyr, .hero-reveal, .hero-en .w { transition: none; }
}
