:root {
  --bg: #f8f3e8;
  --surface: #fffdf8;
  --ink: #173f42;
  --text: #2c4142;
  --muted: #647474;
  --line: #d9dfd9;
  --teal: #1e6667;
  --teal-dark: #124a4c;
  --orange: #d9753b;
  --orange-dark: #b85b29;
  --blue-soft: #e3efec;
  --danger: #a93f35;
  --shadow: 0 18px 48px rgba(25, 65, 65, 0.1);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); line-height: 1.75; }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--teal); border-radius: 50%; font-size: 17px; }
.app-topbar { max-width: 1180px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: space-between; }
.app-topbar .brand { color: white; }
.app-topbar .brand-mark { color: var(--teal-dark); background: var(--surface); }
.about-link { color: #d6e5e2; font-size: 14px; font-weight: 700; text-underline-offset: 5px; }

.hero {
  max-width: 1180px;
  min-height: 650px;
  margin: auto;
  padding: 80px 24px 90px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 70px;
  align-items: center;
}
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(40px, 5vw, 68px); line-height: 1.35; letter-spacing: -0.04em; }
.hero-copy > p { max-width: 650px; margin: 28px 0; font-size: 19px; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 34px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 58px; padding: 12px 28px; border-radius: 9px; text-decoration: none; font-size: 18px; font-weight: 800; }
.button-primary { color: white; background: var(--orange); box-shadow: 0 10px 24px rgba(217, 117, 59, 0.22); }
.button-primary:hover { background: var(--orange-dark); }
.text-link { color: var(--teal-dark); font-weight: 800; text-underline-offset: 5px; }
.hero-note { color: var(--muted); font-size: 14px !important; }

.hero-visual { min-height: 500px; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--blue-soft); border-radius: 34px; padding: 38px; }
.hero-visual::before, .hero-visual::after { content: ""; position: absolute; border: 1px solid rgba(30, 102, 103, 0.18); border-radius: 50%; }
.hero-visual::before { width: 360px; height: 360px; top: -150px; right: -120px; }
.hero-visual::after { width: 260px; height: 260px; bottom: -140px; left: -80px; }
.hero-demo { position: relative; z-index: 2; width: min(100%, 360px); padding: 28px; background: var(--surface); border: 1px solid rgba(23, 63, 66, 0.12); border-radius: 20px; box-shadow: var(--shadow); }
.hero-demo-top { display: flex; align-items: center; gap: 9px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 800; }
.hero-demo-logo { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--teal); border-radius: 50%; font-size: 13px; }
.hero-demo-date { margin: 22px 0 5px; color: var(--muted); font-size: 13px; }
.hero-demo h2 { margin: 0 0 24px; font-size: 34px; line-height: 1.4; }
.hero-demo-list { display: grid; gap: 9px; }
.hero-demo-list span { padding: 12px 14px; color: white; border-radius: 8px; font-size: 15px; font-weight: 800; }
.mini-good { background: #3c785b; }
.mini-concern { background: #a66d27; }
.mini-talk { background: #356987; }
.hero-demo-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

.section { max-width: 1180px; margin: auto; padding: 110px 24px; }
.section-heading { max-width: 850px; margin-bottom: 60px; }
.section-heading.compact { margin-bottom: 48px; }
.section-label { margin: 0 0 10px; color: var(--orange); font-size: 15px !important; font-weight: 800; letter-spacing: 0.08em; }
h2 { margin: 0 0 20px; color: var(--ink); font-size: clamp(34px, 4vw, 52px); line-height: 1.4; letter-spacing: -0.035em; }
.section-heading p, .safety-copy p { font-size: 18px; max-width: 730px; }
.problem { border-top: 1px solid var(--line); }
.voices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.voices blockquote { margin: 0; padding: 40px 34px; background: var(--surface); color: var(--ink); font-size: 21px; font-weight: 700; }
.voices cite { display: block; margin-top: 22px; color: var(--muted); font-size: 14px; font-style: normal; font-weight: 500; }

.demo-section { max-width: none; padding-left: max(24px, calc((100vw - 1180px) / 2)); padding-right: max(24px, calc((100vw - 1180px) / 2)); background: var(--teal-dark); color: white; }
.demo-section-top { min-height: 100vh; padding-top: 20px; padding-bottom: 30px; }
.demo-intro { max-width: 820px; margin-bottom: 50px; }
.demo-intro h1, .demo-intro h2 { margin: 0 0 18px; color: white; font-size: clamp(34px, 4vw, 52px); line-height: 1.35; letter-spacing: -0.035em; }
.demo-intro p { color: #d6e5e2; font-size: 18px; }
.demo-shell { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.demo-main, .history-panel { background: var(--surface); color: var(--text); border-radius: 20px; box-shadow: var(--shadow); }
.demo-main { padding: clamp(22px, 4vw, 46px); }
.demo-question { text-align: center; }
.demo-date { margin: 0; color: var(--muted); font-size: 15px; }
.demo-question h2, .demo-question h3 { margin: 8px 0 18px; color: var(--ink); font-size: clamp(28px, 4vw, 42px); }
.speak-button, .small-speak-button { border: 0; color: var(--teal-dark); background: var(--blue-soft); font-weight: 800; border-radius: 9px; }
.speak-button { padding: 13px 22px; font-size: 18px; }
.small-speak-button { min-width: 110px; padding: 10px 14px; }
.speech-status { min-height: 28px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.checkin-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0; }
.training-options { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.training-options .training-choice { min-width: 0; padding: 16px 14px; line-height: 1.5; overflow-wrap: anywhere; }
.checkin-button { min-height: 86px; border: 0; border-radius: 12px; color: white; font-size: clamp(19px, 2vw, 24px); font-weight: 800; transition: transform 0.15s ease, filter 0.15s ease; }
.checkin-button:hover, .checkin-button:focus-visible { transform: translateY(-2px); filter: brightness(1.05); }
.training-progress { margin: 0 0 6px; color: var(--teal); font-size: 14px; font-weight: 800; }
.genre-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 4px; }
.genre-button { min-height: 92px; padding: 15px; text-align: left; color: var(--ink); background: var(--blue-soft); border: 1px solid #c8dcda; border-radius: 11px; }
.genre-button:hover, .genre-button:focus-visible { border-color: var(--teal); transform: translateY(-2px); }
.genre-button strong, .genre-button span { display: block; }
.genre-button strong { font-size: 19px; }
.genre-button span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.genre-button strong .genre-icon { display: inline-block; margin: 0 8px 0 0; color: inherit; font-size: 20px; vertical-align: -1px; }
.genre-button-random { grid-column: 1 / -1; min-height: 78px; color: white; background: var(--teal); border-color: var(--teal); text-align: center; }
.genre-button-random span { color: #e6f2f0; }
.genre-button-random strong .genre-icon { color: inherit; }
.training-choice { background: var(--teal); }
.training-choice:disabled { cursor: default; opacity: 0.72; transform: none; }
.training-choice.answer-correct { background: #347554; opacity: 1; outline: 4px solid rgba(52, 117, 84, 0.18); }
.training-choice.answer-wrong { background: #a34b42; opacity: 1; }
.training-feedback { margin-top: 18px; padding: 15px 18px; border-radius: 10px; font-size: 17px; font-weight: 700; }
.feedback-success { color: #23563d; background: #e1f0e6; }
.feedback-retry { color: #704522; background: #f6ead9; }
.next-question-button { width: 100%; margin-top: 14px; padding: 14px 18px; border: 0; border-radius: 10px; color: white; background: var(--orange); font-size: 18px; font-weight: 800; }
.change-genre-button { width: 100%; margin-top: 9px; padding: 11px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; font-size: 15px; font-weight: 700; }
.good { background: #3c785b; }
.concern { background: #a66d27; }
.talk { background: #356987; }
.help { background: var(--danger); }
.daily-topic { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding-top: 28px; border-top: 1px solid var(--line); }
.daily-topic span { color: var(--teal); font-size: 14px; font-weight: 800; }
.daily-topic p { margin: 4px 0 0; color: var(--ink); font-size: 21px; font-weight: 700; }
.daily-topic small { display: block; max-width: 560px; margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.history-panel { padding: 28px; }
.history-panel h2, .history-panel h3 { margin: 0 0 20px; color: var(--ink); font-size: 22px; }
.history-list { min-height: 160px; }
.history-item { padding: 13px 0; border-top: 1px solid var(--line); }
.history-item strong { display: block; color: var(--ink); }
.history-item time { color: var(--muted); font-size: 13px; }
.history-empty { color: var(--muted); }
.clear-button { width: 100%; margin-top: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); }
.emergency-note { padding: 16px 20px; margin: 22px 0 0; background: #fff1e8; color: #73332d; border-radius: 10px; font-weight: 700; }
.learn-more-link { display: block; width: fit-content; margin: 34px auto 0; color: #d6e5e2; font-size: 15px; font-weight: 700; text-underline-offset: 5px; }
.back-to-top { position: fixed; z-index: 30; right: 18px; bottom: 18px; padding: 11px 16px; color: white; background: var(--orange); border-radius: 999px; box-shadow: 0 8px 24px rgba(23, 63, 66, 0.22); font-size: 14px; font-weight: 800; text-decoration: none; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity 0.2s ease, transform 0.2s ease; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 70px 1fr; gap: 30px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.steps strong { color: var(--orange); font-size: 38px; line-height: 1; }
.steps h3 { margin: 0 0 5px; color: var(--ink); font-size: 24px; }
.steps p { margin: 0; color: var(--muted); }

.safety { max-width: none; padding-left: max(24px, calc((100vw - 1180px) / 2)); padding-right: max(24px, calc((100vw - 1180px) / 2)); background: #e5eeeb; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 90px; align-items: start; }
.safety-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid #bccdca; }
.safety-list li { padding: 21px 0 21px 36px; border-bottom: 1px solid #bccdca; position: relative; }
.safety-list li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); }
.safety-list strong { display: block; color: var(--ink); font-size: 18px; }
.safety-list span { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.safety-note { margin-top: 28px; padding: 16px 18px; color: #684138; background: rgba(255, 253, 248, 0.75); border-left: 4px solid var(--orange); font-size: 14px !important; }

.home-guide { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; align-items: start; }
.home-guide h2 { font-size: clamp(32px, 4vw, 46px); }
.guide-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.guide-columns div { padding: 30px; background: var(--surface); }
.guide-columns h3 { margin-top: 0; color: var(--ink); }
.guide-columns p { margin-bottom: 0; color: var(--muted); }

.faq { max-width: 900px; }
.faq details { border-top: 1px solid var(--line); padding: 22px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; color: var(--ink); font-size: 19px; font-weight: 800; }
.faq details p { color: var(--muted); }
.final-cta { padding: 100px 24px; text-align: center; background: var(--teal); color: white; }
.final-cta h2 { color: white; }
.final-cta p { margin-bottom: 32px; font-size: 18px; }
.final-top-link { color: white; }
footer { padding: 36px 24px; text-align: center; color: #d6e5e2; background: #0d393b; }
footer p { margin: 3px 0; font-size: 13px; }
footer .copyright { margin-top: 18px; color: #9eb9b6; font-size: 11px; letter-spacing: 0.04em; }

@media (max-width: 900px) {
  nav a:not(.nav-cta) { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 55px; gap: 45px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .hero-visual { min-height: 460px; max-width: 520px; width: 100%; margin: auto; }
  .voices, .demo-shell, .safety, .home-guide { grid-template-columns: 1fr; }
  .safety, .home-guide { gap: 45px; }
}

@media (max-width: 600px) {
  .app-topbar { margin-bottom: 10px; }
  .app-topbar .brand { font-size: 16px; }
  .app-topbar .brand-mark { width: 32px; height: 32px; font-size: 13px; }
  .about-link { font-size: 12px; }
  .demo-section-top { padding: 10px 10px 20px; }
  .demo-section-top .demo-shell { gap: 12px; }
  .demo-section-top .demo-main { padding: 14px; border-radius: 15px; }
  .demo-section-top .demo-date { font-size: 12px; }
  .demo-section-top .demo-question h2 { margin: 2px 0 8px; font-size: 25px; line-height: 1.3; }
  .demo-section-top .speak-button { padding: 8px 15px; font-size: 16px; }
  .demo-section-top .speech-status { min-height: 20px; margin-top: 6px; font-size: 11px; line-height: 1.4; }
  .demo-section-top .checkin-options { gap: 8px; margin: 14px 0; }
  .demo-section-top .genre-options { gap: 8px; margin: 12px 0 2px; }
  .demo-section-top .genre-button { min-height: 61px; padding: 8px 10px; }
  .demo-section-top .genre-button strong { font-size: 16px; }
  .demo-section-top .genre-button span { font-size: 10px; line-height: 1.35; }
  .demo-section-top .checkin-button { min-height: 57px; font-size: 19px; border-radius: 9px; }
  .demo-section-top .training-feedback { margin-top: 10px; padding: 10px 12px; font-size: 14px; }
  .demo-section-top .next-question-button { margin-top: 9px; padding: 11px; font-size: 16px; }
  .demo-section-top .daily-topic { padding-top: 13px; gap: 8px; }
  .demo-section-top .daily-topic p { font-size: 16px; line-height: 1.5; }
  .demo-section-top .daily-topic small { display: none; }
  .demo-section-top .small-speak-button { padding: 8px; font-size: 14px; }
  .demo-section-top .history-panel { padding: 20px; }
  .demo-section-top .learn-more-link { margin-top: 18px; }
  .hero { padding: 48px 16px; }
  .section { padding: 48px 16px; }
  .section-heading, .section-heading.compact { margin-bottom: 30px; }
  .safety, .home-guide { gap: 30px; }
  .final-cta { padding: 56px 16px; }
  footer { padding: 26px 16px; }
  .hero h1 { font-size: 38px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .text-link { text-align: center; }
  .hero-visual { min-height: 430px; padding: 20px; border-radius: 24px; }
  .hero-demo { padding: 22px; }
  .hero-demo h2 { font-size: 30px; }
  .voices { grid-template-columns: 1fr; }
  .checkin-options, .training-options { grid-template-columns: 1fr; }
  .checkin-button { min-height: 74px; }
  .daily-topic { align-items: stretch; flex-direction: column; }
  .small-speak-button { width: 100%; }
  .guide-columns { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
