/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,600;1,400&family=Yuji+Syuku&display=swap');

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

/* ── Tokens ── */
:root {
  --bg:           #F5F2ED;
  --bg-alt:       #ECE8E1;
  --bg-warm:      #F0E8DD;
  --text:         #2A2A2A;
  --accent:       #8F2518;
  --accent-hover: #6B1C12;
  --accent-soft:  #C23B22;
  --muted:        #525252;
  --border:       #DDD8D0;
  --card-bg:      #FEFDFB;
  --btn-text:     #FFFFFF;
  --focus-ring:   #8F2518;
  --font-display: 'Noto Serif', Georgia, serif;
  --font-kana:    'Yuji Syuku', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-w:  1080px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --radius:  12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #1A1918;
    --bg-alt:       #222120;
    --bg-warm:      #252220;
    --text:         #E8E4DE;
    --accent:       #E09478;
    --accent-hover: #EAB0A0;
    --accent-soft:  #D4513A;
    --muted:        #AAAAAA;
    --border:       #3A3835;
    --card-bg:      #2A2725;
    --btn-text:     #1A1918;
    --focus-ring:   #E09478;
  }
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--accent);
  color: var(--btn-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus { top: 0; }

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ── Section titles ── */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 50ch;
  margin: 0 auto var(--space-lg);
  line-height: 1.6;
}

/* ── Nav ── */
.site-nav {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-decoration: none;
}

.site-nav__brand:hover { color: var(--text); }

.site-nav__brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.site-nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  font-size: 0.95rem;
}

.site-nav__links a {
  color: var(--muted);
  transition: color 0.2s;
}

.site-nav__links a:hover { color: var(--text); }

/* ════════════════════════════════════════
   Hero
   ════════════════════════════════════════ */

.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero__text { flex: 1; }

.hero__eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-soft);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.hero__lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: var(--space-md);
  max-width: 44ch;
}

.hero__cta {
  display: inline-block;
  text-decoration: none;
}

.hero__cta img {
  height: 54px;
  transition: opacity 0.2s;
}

.hero__cta:hover img { opacity: 0.85; }

.hero__phone {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 320px);
}

.hero__phone img {
  border-radius: 24px;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.12));
}

/* Floating word illustrations */
.hero__float {
  position: absolute;
  z-index: 0;
  opacity: 0.18;
  pointer-events: none;
}

.hero__float--1 {
  width: clamp(80px, 12vw, 140px);
  top: 8%;
  right: 6%;
}

.hero__float--2 {
  width: clamp(70px, 10vw, 120px);
  bottom: 12%;
  left: 4%;
}

.hero__float--3 {
  width: clamp(60px, 8vw, 100px);
  bottom: 25%;
  right: 28%;
}

@media (max-width: 800px) {
  .hero { padding: var(--space-lg) 0; }

  .hero__inner {
    flex-direction: column;
    text-align: center;
  }

  .hero__lead { margin-left: auto; margin-right: auto; }

  .hero__phone {
    width: 220px;
    margin: 0 auto;
  }

  .hero__float { display: none; }
}

/* ════════════════════════════════════════
   Words showcase
   ════════════════════════════════════════ */

.words-section {
  padding: var(--space-xl) 0;
  background: var(--bg-warm);
}

.words-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.words-section__text { flex: 1; }

.words-section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: var(--space-sm);
}

.words-section__desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: var(--space-md);
  max-width: 44ch;
}

.words-section__stats {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.words-section__stats li {
  font-size: 0.9rem;
  color: var(--muted);
}

.words-section__stats strong {
  display: block;
  font-size: 1.6rem;
  font-family: var(--font-display);
  color: var(--accent-soft);
  font-weight: 400;
}

/* 3x3 illustration grid */
.words-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  flex: 0 0 auto;
  width: clamp(260px, 36vw, 400px);
}

.words-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: var(--space-sm);
  background: var(--card-bg);
  border-radius: var(--radius);
  transition: transform 0.2s;
}

.words-grid__item:hover {
  transform: translateY(-2px);
}

.words-grid__item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.words-grid__label {
  font-family: var(--font-kana);
  font-size: 1rem;
  color: var(--text);
}

@media (max-width: 800px) {
  .words-section__inner {
    flex-direction: column;
    text-align: center;
  }

  .words-section__stats { justify-content: center; }
  .words-section__desc { margin-left: auto; margin-right: auto; }

  .words-grid {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }
}

/* ════════════════════════════════════════
   Quiz methods
   ════════════════════════════════════════ */

.methods-section {
  padding: var(--space-xl) 0;
}

.methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.method-card {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.method-card__kana {
  font-family: var(--font-kana);
  font-size: 2.2rem;
  color: var(--accent-soft);
  display: block;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.method-card__title {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.method-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 800px) {
  .methods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .methods-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ════════════════════════════════════════
   Smart learning (SRS)
   ════════════════════════════════════════ */

.smart-section {
  padding: var(--space-xl) 0;
  background: var(--bg-alt);
}

.smart-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-direction: row-reverse;
}

.smart-section__text { flex: 1; }

.smart-section__title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: var(--space-sm);
}

.smart-section__desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 44ch;
}

.smart-section__media {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 320px);
}

.smart-section__media img {
  border-radius: 24px;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,0.10));
}

@media (max-width: 800px) {
  .smart-section__inner {
    flex-direction: column;
    text-align: center;
  }

  .smart-section__desc { margin-left: auto; margin-right: auto; }

  .smart-section__media {
    width: 220px;
    margin: 0 auto;
  }
}

/* ════════════════════════════════════════
   Progress & Stamps
   ════════════════════════════════════════ */

.progress-section {
  padding: var(--space-xl) 0;
}

.progress-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.progress-card {
  text-align: center;
  padding: var(--space-md);
}

.progress-card__number {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  color: var(--accent-soft);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.progress-card__label {
  font-size: 0.95rem;
  line-height: 1.4;
}

.progress-card__sub {
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  .progress-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ════════════════════════════════════════
   Platform strip
   ════════════════════════════════════════ */

.platform-strip {
  padding: var(--space-lg) 0;
  background: var(--bg-warm);
  text-align: center;
}

.platform-strip__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.platform-strip__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: var(--space-xs);
}

.platform-strip__desc {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.platform-strip__features {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.platform-strip__features span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ════════════════════════════════════════
   Closing CTA
   ════════════════════════════════════════ */

.cta-section {
  padding: var(--space-xl) 0;
  text-align: center;
}

.cta-section__illustration {
  width: clamp(100px, 12vw, 160px);
  height: auto;
  margin: 0 auto var(--space-md);
}

.cta-section__title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin-bottom: var(--space-xs);
}

.cta-section__desc {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.cta-section__badge {
  display: inline-block;
  text-decoration: none;
}

.cta-section__badge img {
  height: 54px;
  transition: opacity 0.2s;
}

.cta-section__badge:hover img { opacity: 0.85; }

/* ════════════════════════════════════════
   Footer
   ════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-md) 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  list-style: none;
  margin-bottom: var(--space-sm);
}

.site-footer__links a { color: var(--muted); }
.site-footer__links a:hover { color: var(--text); }

/* ════════════════════════════════════════
   Shared page styles (support, privacy)
   ════════════════════════════════════════ */

.page-content {
  padding: var(--space-lg) 0;
}

.page-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
}

.page-content h2 {
  font-size: 1.4rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.page-content p,
.page-content li {
  margin-bottom: var(--space-sm);
}

.page-content ul {
  padding-left: 1.5em;
}

/* ── Contact form ── */
.contact-form {
  max-width: 480px;
}

.form-group {
  margin-bottom: var(--space-sm);
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: var(--btn-text);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--btn-text);
}

.form-status {
  margin-top: var(--space-sm);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.form-status--success {
  background: #E8F5E9;
  color: #2E7D32;
  display: block;
}

.form-status--error {
  background: #FFEBEE;
  color: #B71C1C;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .form-status--success {
    background: #1B3A1E;
    color: #A5D6A7;
  }
  .form-status--error {
    background: #3A1B1B;
    color: #F5B0B0;
  }
}

/* ── Responsive tweaks ── */
@media (min-width: 421px) and (max-width: 800px) {
  .container,
  .hero__inner,
  .words-section__inner,
  .smart-section__inner {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (max-width: 420px) {
  .container,
  .hero__inner,
  .words-section__inner,
  .smart-section__inner {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .site-nav__brand { font-size: 1.1rem; }
  .site-nav__links { gap: var(--space-sm); }
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
