:root {
  color-scheme: light;
  --ink: #20231f;
  --graphite: #62665d;
  --smoke: #8f8f8f;
  --hairline: rgba(0, 0, 0, .12);
  --whisper: rgba(0, 0, 0, .04);
  --ash: #e3e3d8;
  --paper: #eeeae2;
  --success: #176b43;
  --success-bg: #eef8f2;
  --danger: #a02d2d;
  --danger-bg: #fff3f2;
  font-family: Inter, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  width: min(1120px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; }
.text-button { border: 1px solid var(--hairline); border-radius: 999px; background: transparent; color: var(--graphite); padding: 8px 14px; font-size: 13px; font-weight: 500; transition: background .2s ease, color .2s ease; }
.text-button:hover, .text-button:focus-visible { background: var(--ash); color: var(--ink); }

main { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 96px; }
.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; }

.study-shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 56px; align-items: start; }
.controls { position: sticky; top: 24px; display: grid; gap: 32px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 0 0 24px; border-bottom: 1px solid var(--hairline); }
.summary div + div { border-left: 1px solid var(--hairline); }
.summary div { text-align: center; }
.summary span { display: block; font-size: 20px; line-height: 1; font-weight: 500; letter-spacing: -.03em; }
.summary small { display: block; margin-top: 8px; color: var(--smoke); font-size: 11px; }
.control-label { margin: 0 0 10px; color: var(--smoke); font-size: 12px; font-weight: 500; }
.segmented { display: grid; gap: 4px; }
.segment { width: 100%; border: 0; border-radius: 6px; background: transparent; color: var(--graphite); padding: 10px 12px; text-align: left; font-size: 14px; font-weight: 500; transition: background .2s ease, color .2s ease; }
.segment:hover { background: var(--whisper); color: var(--ink); }
.segment.active { background: var(--ash); color: var(--ink); }
.review-toggle { display: flex; gap: 10px; align-items: center; color: var(--graphite); font-size: 13px; }
.review-toggle input { width: 16px; height: 16px; accent-color: var(--ink); }

.question-card { min-height: 520px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--paper); padding: clamp(24px, 5vw, 48px); }
.question-meta { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--smoke); font-size: 12px; font-weight: 500; }
.category-tag { color: var(--ink); }
.progress-track { height: 1px; background: var(--hairline); margin: 18px 0 36px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--ink); transition: width .25s ease; }
.question-card h2 { margin: 0 0 32px; max-width: 34em; font-size: clamp(22px, 3vw, 30px); line-height: 1.45; letter-spacing: -.025em; font-weight: 500; }
.choices { display: grid; border-top: 1px solid var(--hairline); }
.choice { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: center; width: 100%; min-height: 64px; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; background: transparent; color: var(--ink); text-align: left; font-size: 15px; line-height: 1.55; transition: background .2s ease; }
.choice:hover:not(:disabled), .choice.selected { background: var(--ash); }
.choice.correct { background: var(--success-bg); color: var(--success); }
.choice.incorrect { background: var(--danger-bg); color: var(--danger); }
.choice:disabled { cursor: default; }
.choice-key { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 600; }
.choice.selected .choice-key { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.feedback { margin-top: 32px; padding: 24px; border-radius: 6px; background: var(--ash); color: var(--graphite); font-size: 15px; line-height: 1.75; }
.feedback-result { margin: 0 0 8px; color: var(--ink); font-size: 18px; font-weight: 600; }
.feedback p { margin-top: 0; }
.feedback details { margin: 16px 0; }
.feedback summary { color: var(--ink); cursor: pointer; font-weight: 500; }
.feedback a { color: var(--ink); text-underline-offset: 3px; }
.reason { margin: 10px 0; font-size: 14px; }
.question-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.primary-button, .secondary-button { border-radius: 999px; padding: 11px 18px; font-size: 14px; font-weight: 500; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
.primary-button:disabled { opacity: .25; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--hairline); background: var(--paper); color: var(--ink); }
.secondary-button:hover { background: var(--ash); }
.empty-state { color: var(--graphite); text-align: center; padding: 72px 16px; }

footer { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 40px; border-top: 1px solid var(--hairline); color: var(--smoke); font-size: 12px; line-height: 1.7; }

@media (max-width: 760px) {
  .topbar, main, footer { width: min(100% - 32px, 1120px); }
  main { padding: 28px 0 64px; }
  .study-shell { grid-template-columns: 1fr; gap: 28px; }
  .controls { position: static; gap: 20px; }
  .summary { max-width: 340px; }
  .segmented { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .segment { width: auto; flex: 0 0 auto; border: 1px solid var(--hairline); border-radius: 999px; padding: 8px 12px; }
  .segment.active { border-color: var(--ink); }
  .question-card { min-height: 0; padding: 24px 18px; }
  .question-card h2 { font-size: 21px; }
  .choice { grid-template-columns: 30px 1fr; padding-inline: 6px; }
}

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

/* Shared site navigation */
.site-header { border-bottom: 1px solid var(--hairline); background: rgba(255,255,255,.96); }
.header-inner { width: min(1120px, calc(100% - 48px)); min-height: 76px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: center; }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a { color: var(--graphite); text-decoration: none; font-size: 13px; font-weight: 500; }
.main-nav a:hover, .main-nav a.current { color: var(--ink); }
.header-cta { justify-self: end; border-radius: 999px; background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none; font-size: 13px; font-weight: 500; }
.compact-header .text-button { justify-self: end; }

/* Landing page */
main.landing { width: 100%; max-width: none; padding: 0; }
.lp-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.lp-hero { padding: 72px 0 80px; background: #f6f5f4; border-bottom: 1px solid var(--hairline); }
.hero-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(430px, 1.08fr); gap: 76px; align-items: center; }
.lp-kicker { margin: 0 0 18px; color: var(--graphite); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.lp-hero h1 { margin: 0; max-width: 12ch; font-size: clamp(46px, 5vw, 68px); line-height: 1.08; letter-spacing: -.05em; font-weight: 500; }
.hero-description { max-width: 34rem; margin: 28px 0 0; color: var(--graphite); font-size: 17px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.button-dark, .button-light { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; }
.button-dark { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.button-light { color: var(--ink); border: 1px solid var(--hairline); background: var(--paper); }
.hero-facts { display: flex; gap: 0; margin: 40px 0 0; }
.hero-facts div { min-width: 96px; padding-right: 24px; }
.hero-facts div + div { padding-left: 24px; border-left: 1px solid var(--hairline); }
.hero-facts dt { font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.hero-facts dd { margin: 6px 0 0; color: var(--smoke); font-size: 11px; }

.preview-card { border: 1px solid var(--hairline); border-radius: 6px; background: var(--paper); padding: 30px; }
.preview-meta { display: flex; justify-content: space-between; color: var(--smoke); font-size: 11px; }
.preview-meta span:first-child { color: var(--ink); font-weight: 500; }
.preview-question { margin: 24px 0; padding: 26px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); font-size: 23px; line-height: 1.5; letter-spacing: -.02em; font-weight: 500; }
.preview-choices { display: grid; }
.preview-choices span { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: center; min-height: 52px; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.preview-choices b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--ink); border-radius: 50%; font-size: 10px; }
.preview-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; color: var(--smoke); font-size: 11px; }
.preview-button { border-radius: 999px; background: var(--ink); color: var(--paper); padding: 9px 14px; }

.lp-section { padding: 96px 0; }
.section-tinted { background: #f6f5f4; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-heading { margin-bottom: 44px; }
.section-number { margin: 0 0 14px; color: var(--smoke); font-size: 11px; letter-spacing: .08em; }
.section-heading h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.15; letter-spacing: -.04em; font-weight: 500; }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.text-link { color: var(--ink); text-underline-offset: 4px; font-size: 13px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hairline); }
.feature-grid article { padding: 28px 30px 12px 0; }
.feature-grid article + article { padding-left: 30px; border-left: 1px solid var(--hairline); }
.feature-grid article > span { color: var(--smoke); font-size: 11px; }
.feature-grid h3 { margin: 24px 0 12px; font-size: 22px; letter-spacing: -.02em; font-weight: 500; }
.feature-grid p { margin: 0; color: var(--graphite); font-size: 15px; line-height: 1.75; }

.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.topic-grid > a { position: relative; min-height: 250px; padding: 28px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--paper); color: var(--ink); text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.topic-grid > a:hover { transform: translateY(-3px); border-color: rgba(0,0,0,.35); }
.topic-count { color: var(--smoke); font-size: 11px; }
.topic-grid h3 { margin: 48px 0 14px; font-size: 26px; font-weight: 500; letter-spacing: -.03em; }
.topic-grid p { max-width: 16rem; margin: 0; color: var(--graphite); font-size: 14px; line-height: 1.65; }
.topic-arrow { position: absolute; right: 24px; bottom: 22px; font-size: 20px; }

.flow-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hairline); }
.flow-list li { display: grid; grid-template-columns: 72px 1fr; gap: 24px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--hairline); }
.flow-list li > span { color: var(--smoke); font-size: 12px; }
.flow-list h3 { margin: 0 0 6px; font-size: 20px; font-weight: 500; }
.flow-list p { margin: 0; color: var(--graphite); font-size: 14px; }

.lp-cta { padding: 72px 0; background: var(--ink); color: var(--paper); }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; }
.cta-inner p { margin: 0 0 10px; color: #a9a9a9; font-size: 12px; }
.cta-inner h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -.04em; }
.cta-inner > a { display: inline-flex; align-items: center; gap: 36px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; color: var(--paper); padding: 14px 18px; text-decoration: none; font-size: 14px; }

/* Content pages */
main.content-page { width: min(960px, calc(100% - 48px)); min-height: calc(100vh - 220px); padding: 72px 0 112px; }
.page-heading { padding-bottom: 48px; border-bottom: 1px solid var(--hairline); }
.page-heading > p:first-child { margin: 0 0 18px; color: var(--smoke); font-size: 11px; letter-spacing: .12em; }
.page-heading h1 { margin: 0; font-size: clamp(42px, 6vw, 64px); line-height: 1.05; font-weight: 500; letter-spacing: -.05em; }
.page-heading h1 + p { max-width: 40rem; margin: 24px 0 0; color: var(--graphite); font-size: 16px; line-height: 1.7; }
.topic-detail { display: grid; gap: 0; }
.topic-detail article { padding: 48px 0; border-bottom: 1px solid var(--hairline); }
.topic-detail-head { display: grid; grid-template-columns: 56px 1fr; gap: 20px; align-items: start; }
.topic-detail-head > span { color: var(--smoke); font-size: 12px; }
.topic-detail h2 { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -.035em; }
.topic-detail h2 + p { margin: 8px 0 0; color: var(--smoke); font-size: 12px; }
.topic-detail article > p { margin: 24px 0 18px 76px; color: var(--graphite); line-height: 1.7; }
.topic-detail ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px 76px; padding: 0; list-style: none; }
.topic-detail li { padding: 7px 11px; border: 1px solid var(--hairline); border-radius: 999px; font-size: 12px; }
.topic-detail article > a { margin-left: 76px; color: var(--ink); text-underline-offset: 4px; font-size: 14px; }

.fact-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 48px 0 0; border: 1px solid var(--hairline); border-radius: 6px; }
.fact-row div { padding: 24px; }
.fact-row div + div { border-left: 1px solid var(--hairline); }
.fact-row strong, .fact-row span { display: block; }
.fact-row strong { font-size: 22px; font-weight: 500; }
.fact-row span { margin-top: 8px; color: var(--smoke); font-size: 11px; }
.guide-block, .policy-page > section { max-width: 760px; padding: 48px 0; border-bottom: 1px solid var(--hairline); }
.guide-block h2, .policy-page h2 { margin: 0 0 18px; font-size: 26px; font-weight: 500; letter-spacing: -.025em; }
.guide-block > p, .policy-page section p { color: var(--graphite); font-size: 16px; line-height: 1.8; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.source-links a { border: 1px solid var(--hairline); border-radius: 999px; color: var(--ink); padding: 9px 13px; text-decoration: none; font-size: 12px; }
.guide-steps { display: grid; gap: 0; margin: 24px 0 30px; padding: 0; list-style: none; border-top: 1px solid var(--hairline); }
.guide-steps li { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--hairline); }
.guide-steps b { font-weight: 500; }
.guide-steps span { color: var(--graphite); line-height: 1.6; }

.sitemap-list { display: grid; }
.sitemap-list > a { display: grid; grid-template-columns: 60px 1fr; gap: 24px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--hairline); color: var(--ink); text-decoration: none; }
.sitemap-list > a > span { color: var(--smoke); font-size: 12px; }
.sitemap-list strong, .sitemap-list small { display: block; }
.sitemap-list strong { font-size: 21px; font-weight: 500; }
.sitemap-list small { margin-top: 7px; color: var(--graphite); font-size: 13px; }
.error-page { display: grid; place-items: center; align-content: center; gap: 22px; min-height: 100vh; text-align: center; }
.error-page > span { color: var(--smoke); font-size: 12px; }
.error-page h1 { margin: 0; font-size: clamp(30px, 6vw, 52px); font-weight: 500; letter-spacing: -.04em; }

footer.site-footer { width: 100%; max-width: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); color: var(--smoke); }
.footer-inner { width: min(1120px, calc(100% - 48px)); min-height: 96px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer-inner p { margin: 0; max-width: 48rem; font-size: 11px; line-height: 1.7; }
.footer-inner nav { display: flex; gap: 18px; flex: 0 0 auto; }
.footer-inner a { color: var(--graphite); font-size: 11px; text-underline-offset: 3px; }

@media (max-width: 820px) {
  .header-inner { width: min(100% - 32px, 1120px); grid-template-columns: 1fr auto; min-height: 68px; }
  .main-nav { order: 3; grid-column: 1 / -1; gap: 18px; padding: 0 0 14px; overflow-x: auto; }
  .main-nav a { flex: 0 0 auto; }
  .header-cta, .compact-header .text-button { grid-column: 2; grid-row: 1; }
  .lp-shell, .footer-inner { width: min(100% - 32px, 1120px); }
  .lp-hero { padding: 48px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .lp-hero h1 { font-size: clamp(42px, 12vw, 58px); }
  .preview-card { padding: 20px; }
  .preview-question { font-size: 20px; }
  .lp-section { padding: 68px 0; }
  .feature-grid, .topic-grid { grid-template-columns: 1fr; }
  .feature-grid article, .feature-grid article + article { padding: 26px 0; border-left: 0; border-bottom: 1px solid var(--hairline); }
  .topic-grid > a { min-height: 210px; }
  .split-heading { align-items: start; flex-direction: column; }
  .cta-inner { align-items: flex-start; flex-direction: column; }
  main.content-page { width: min(100% - 32px, 960px); padding: 48px 0 80px; }
  .fact-row { grid-template-columns: repeat(2, 1fr); }
  .fact-row div:nth-child(3) { border-left: 0; border-top: 1px solid var(--hairline); }
  .fact-row div:nth-child(4) { border-top: 1px solid var(--hairline); }
  .guide-steps li { grid-template-columns: 1fr; gap: 6px; }
  .footer-inner { min-height: 0; padding: 24px 0 32px; align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .hero-facts div { min-width: 0; flex: 1; padding-right: 12px; }
  .hero-facts div + div { padding-left: 12px; }
  .preview-card { margin-inline: -4px; }
  .preview-choices span { align-items: start; padding: 12px 0; }
  .topic-detail-head { grid-template-columns: 38px 1fr; }
  .topic-detail article > p, .topic-detail ul, .topic-detail article > a { margin-left: 58px; }
  .fact-row strong { font-size: 18px; }
}

/* Shared editorial palette for study and information pages. */
.brand-mark { background: #586743; border-radius: 0; }
.question-card { background: #f5f2eb; border-radius: 0; }
.primary-button, .header-cta { background: #586743; border-radius: 0; }
.segment, .feedback { border-radius: 0; }
