/* にほんごクエスト 紹介サイト
   - 外部フォント / 外部ライブラリは読み込まない
   - 配色はすべて :root のトークン経由。ダークテーマは prefers-color-scheme で上書き */

:root {
  color-scheme: light;

  --cream: #fff8f0;
  --cream-deep: #fff1e0;
  --paper: #ffffff;
  --sumi: #2a211c;
  --sumi-soft: #5d5048;
  --sumi-faint: #8c7d73;
  --fox: #e8763a;
  --fox-deep: #c25a24;
  --sakura: #f2a6b8;
  --ai: #3e7c8c;
  --matcha: #6f9e6a;
  --line: rgba(42, 33, 28, 0.12);
  --line-soft: rgba(42, 33, 28, 0.07);
  --shadow: 0 18px 50px -24px rgba(42, 33, 28, 0.45);
  --shadow-soft: 0 10px 30px -18px rgba(42, 33, 28, 0.4);

  --bg: var(--cream);
  --bg-alt: var(--cream-deep);
  --surface: var(--paper);
  --text: var(--sumi);
  --text-soft: var(--sumi-soft);
  --text-faint: var(--sumi-faint);
  --accent: var(--fox);
  --accent-deep: var(--fox-deep);

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 20px;
  --radius-lg: 32px;

  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

:root[lang="ko"] {
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", "Helvetica Neue", sans-serif;
}
:root[lang="zh-Hans"] {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
}
:root[lang="en"] {
  --font: var(--font-en);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1613;
    --bg-alt: #241d19;
    --surface: #2a221d;
    --text: #f6ece2;
    --text-soft: #cdbcae;
    --text-faint: #9d8b7d;
    --accent: #ff9256;
    --accent-deep: #ffb183;
    --line: rgba(246, 236, 226, 0.16);
    --line-soft: rgba(246, 236, 226, 0.09);
    --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.8);
    --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 12px 0;
  z-index: 200;
}
.skip:focus { left: 0; }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 見出しの共通パーツ ---------- */

.eyebrow {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 90px;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::before {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  max-width: 90px;
}

.display {
  font-size: clamp(30px, 6.2vw, 56px);
  line-height: 1.32;
  letter-spacing: 0.005em;
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
}
.display span { display: block; }

.lede {
  color: var(--text-soft);
  font-size: clamp(15px, 1.9vw, 17px);
  margin: 20px 0 0;
  max-width: 46em;
}

/* ---------- ヘッダー ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--line-soft); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
}

.site-nav { margin-inline-start: auto; }
.site-nav ul {
  display: flex;
  gap: clamp(12px, 2.2vw, 26px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 2px;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line-soft);
}
.lang-switch a {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-faint);
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.lang-switch a[aria-current="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease;
}
.header-cta:hover { background: var(--accent-deep); transform: translateY(-1px); }
.header-cta[aria-disabled="true"] {
  background: var(--line);
  color: var(--text-faint);
  pointer-events: none;
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .lang-switch { margin-inline-start: auto; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }
}

/* ---------- ヒーロー ---------- */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px);
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}
.hero::before {
  width: 420px; height: 420px;
  background: color-mix(in srgb, var(--sakura) 60%, transparent);
  top: -140px; inset-inline-start: -120px;
}
.hero::after {
  width: 460px; height: 460px;
  background: color-mix(in srgb, var(--fox) 36%, transparent);
  bottom: -200px; inset-inline-end: -140px;
}
.hero > .wrap { position: relative; }

.hero-grid > * { min-width: 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 { font-size: clamp(34px, 7.4vw, 64px); }

.hero-lead {
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: clamp(15px, 2vw, 18px);
}
.hero-lead span { display: block; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.cta {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 34px;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 90%, black);
  transition: transform 0.22s ease, background 0.22s ease;
}
.cta:hover { background: var(--accent-deep); transform: translateY(-2px); }
.cta strong { font-size: 17px; font-weight: 800; line-height: 1.4; }
.cta small { font-size: 12px; opacity: 0.88; line-height: 1.4; }
.cta[aria-disabled="true"] {
  background: var(--line);
  color: var(--text-faint);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.cta-note { font-size: 12px; color: var(--text-faint); margin: 0; }

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  text-decoration: none;
}
.scroll-hint::after { content: "↓"; }

/* ---------- 端末モック ---------- */

.device {
  display: block;
  position: relative;
  margin-inline: auto;
  width: min(300px, 74vw);
  aspect-ratio: 1206 / 2622;
  background: #16110e;
  border-radius: 44px;
  padding: 9px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.device::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 33%;
  height: 20px;
  border-radius: 999px;
  background: #16110e;
  z-index: 2;
}
.device img,
.device video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 36px;
  background: var(--bg-alt);
  display: block;
}
.device--sm { width: min(248px, 56vw); }

.device-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  display: block;
  /* 幅は中の端末モックに合わせる。100% にすると横スクロールの
     1スライドが画面幅いっぱいになり、隣のスクショが完全に画面外へ出てしまう。 */
  width: max-content;
}

.hero-device { display: flex; justify-content: center; }
.hero-badge {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ---------- レベル帯 ---------- */

.strip {
  border-block: 1px solid var(--line-soft);
  background: var(--bg-alt);
  padding: clamp(40px, 6vw, 68px) 0;
}
.strip-head { text-align: center; }
.strip-head .display { font-size: clamp(24px, 4.2vw, 38px); }
.strip-lead { color: var(--text-faint); font-size: 13px; margin: 16px 0 0; }

.strip-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2.4vw, 26px);
  margin-top: 26px;
  font-weight: 800;
  font-size: clamp(16px, 2.6vw, 22px);
}
.strip-items li { list-style: none; }
.strip-items .sep { color: var(--line); font-weight: 400; }

/* ---------- セクション共通 ---------- */

.section { padding: clamp(56px, 9vw, 112px) 0; }
section[id] { scroll-margin-top: 84px; }
.section--alt { background: var(--bg-alt); }

.statement { text-align: center; }
.statement .lede { margin-inline: auto; text-align: start; }
@media (min-width: 720px) { .statement .lede { text-align: center; } }

.feature > * { min-width: 0; }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.feature--reverse .feature-media { order: -1; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature--reverse .feature-media { order: 0; }
}

.feature-num {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.feature h2 { font-size: clamp(26px, 4.6vw, 42px); }
.feature p { color: var(--text-soft); margin: 20px 0 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--text-soft);
}

.note {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.7;
}

/* 複数スクショの横スクロール */
.shots {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: 6px;
  scrollbar-width: none;
  /* 収まるときは中央寄せ、あふれるときは 100% で止めて横スクロールに切り替える。
     justify-content: center だとあふれた時に先頭へスクロールできなくなる。 */
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}
.shots::-webkit-scrollbar { display: none; }
.shots > * { scroll-snap-align: start; flex: 0 0 auto; }
/* デスクトップでは横スクロールをやめ、並べた枚数が必ず収まるグリッドにする。
   flex のままだと 248px × 2 + 余白がコンテナ(480px)に入りきらず、左右が切れていた。 */
@media (min-width: 901px) {
  .shots {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    overflow: visible;
    scroll-snap-type: none;
  }
  .shots > * { width: 100%; }
  .shots .device { width: 100%; max-width: 300px; }
  .shots .device--sm { max-width: 248px; }
}

.shots-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-faint);
  margin: 14px 0 0;
}
.shots-hint::after { content: "→"; }
@media (min-width: 901px) { .shots-hint { display: none; } }

.media-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  margin: 12px 0 0;
  line-height: 1.7;
}

/* ---------- 機能チップ ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.chips a {
  display: inline-flex;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-soft);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.chips a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
}

/* ---------- レベルカード ---------- */

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 44px;
}
.level-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-soft);
}
.level-card .no {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.level-card .kicker { font-size: 12px; color: var(--text-faint); margin: 14px 0 6px; }
.level-card h3 { margin: 0; font-size: 24px; font-weight: 800; }
.level-card p { margin: 12px 0 0; font-size: 14px; color: var(--text-soft); }

/* ---------- FAQ ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; } }

.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 54px 20px 22px;
  font-weight: 700;
  font-size: 15px;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer {
  padding: 0 22px 22px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* ---------- 最終CTA ---------- */

.final {
  text-align: center;
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
}
.final .cta-row { justify-content: center; }
.final .lede { margin-inline: auto; }

/* ---------- フッター ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 44px 0 60px;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); }
.footer-brand img { width: 26px; height: 26px; border-radius: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-inline-start: auto; }
.footer-links a { color: var(--text-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.analytics-settings {
  border: 0;
  padding: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
}
.analytics-settings:hover { color: var(--accent); }
.analytics-consent {
  position: fixed;
  z-index: 150;
  inset-inline: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 640px;
  margin-inline: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 70dvh;
  overflow: auto;
}
.analytics-consent[hidden], .analytics-settings[hidden] { display: none; }
.analytics-consent h2 { font-size: 17px; margin: 0 0 8px; }
.analytics-consent p { font-size: 14px; line-height: 1.7; margin: 0 0 14px; }
.analytics-consent-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.analytics-consent-actions button {
  min-height: 44px;
  flex: 1;
  border: 1px solid var(--text-soft);
  border-radius: 8px;
  padding: 10px 18px;
  color: var(--text);
  background: var(--bg);
  font: inherit;
  cursor: pointer;
}
.analytics-consent-actions button:hover { background: var(--bg-alt); }
.footer-copy { width: 100%; margin: 0; }

/* ---------- ライトボックス ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 14, 10, 0.82);
  backdrop-filter: blur(6px);
}
.lightbox img {
  max-width: min(440px, 86vw);
  max-height: 86vh;
  width: auto;
  border-radius: 26px;
  box-shadow: 0 30px 80px -30px #000;
}
.lightbox button {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- プライバシーポリシー ---------- */

.doc { padding: clamp(44px, 7vw, 84px) 0 clamp(56px, 8vw, 96px); }
.doc-head { max-width: 44em; }
.doc h1 { font-size: clamp(28px, 5vw, 42px); margin: 0; font-weight: 800; }
.doc-updated { font-size: 13px; color: var(--text-faint); margin: 14px 0 0; }
.doc-intro { margin: 26px 0 0; color: var(--text-soft); max-width: 44em; }
.doc section { margin-top: 40px; max-width: 44em; }
.doc h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; }
.doc p { margin: 0 0 12px; color: var(--text-soft); font-size: 15px; }
.doc-back { display: inline-block; margin-top: 48px; font-weight: 700; color: var(--accent); text-decoration: none; }
.doc-contact { font-weight: 700; }
