:root { --red: #c4202a; --ink: #1c1a16; --muted: #6b6258; --line: #d9d2c5; --paper: #f7f2e6; --card: #fffef9; --accent: #8a5a2e; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Outfit, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--red); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

.masthead { background: var(--card); border-bottom: 3px double var(--accent); }
.masthead-inner { max-width: 1140px; margin: 0 auto; padding: 20px 24px 16px; display: flex; align-items: center; gap: 20px; }
.seal { flex-shrink: 0; width: 64px; height: 64px; border: 2px solid var(--red); display: flex; align-items: center; justify-content: center; }
.seal img { width: 46px; height: auto; display: block; }
.nameplate { flex: 1; }
.nameplate .over { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.nameplate h2 { font-family: Fraunces, serif; font-size: 34px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.nameplate h2 span { color: var(--red); }
.nameplate .under { font-size: 12px; color: var(--muted); font-style: italic; font-family: Fraunces, serif; }
.mast-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mast-nav .nav { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.mast-nav .nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 12px; border-bottom: 2px solid transparent; }
.mast-nav .nav a:hover, .mast-nav .nav a.on { color: var(--ink); border-bottom-color: var(--red); }
.mast-nav .cta { background: var(--red); color: #fff; text-decoration: none; font: 700 13px/1 Outfit, sans-serif; padding: 10px 16px; }
.mast-nav .cta:hover { background: var(--ink); }

.col { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 48px; align-items: start; padding: 48px 0 0; }
.hero-copy { padding-top: 8px; }
.hero .place { font-size: 13px; text-transform: uppercase; letter-spacing: .18em; color: var(--red); font-weight: 700; margin-bottom: 16px; }
.hero h1 { font-family: Fraunces, serif; font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; margin-bottom: 18px; }
.hero h1 span { color: var(--red); }
.hero h1 em { font-style: italic; font-weight: 500; }
.hero .deck { font-family: Fraunces, serif; font-style: italic; font-size: 21px; color: var(--muted); max-width: 42ch; margin: 0 0 22px; line-height: 1.4; }
.hero .note { font-size: 14px; color: var(--muted); font-style: italic; }
.hero .intro-photo { position: sticky; top: 24px; }

.intro-photo { background: var(--ink); }
.intro-photo img { width: 100%; height: 400px; object-fit: cover; object-position: 50% 38%; display: block; }
.intro-photo .cap { padding: 18px 20px 16px; }
.intro-photo h2 { font-family: Fraunces, serif; font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 12px; }
.intro-photo .btn-cal { display: inline-block; background: var(--red); color: #fff; text-decoration: none; font: 700 15px/1 Outfit, sans-serif; padding: 14px 24px; }
.intro-photo .btn-cal:hover { background: #fff; color: var(--ink); }
.intro-photo .btn-cal:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.intro-photo .fine { font-size: 12px; color: #cbb892; font-style: italic; margin-top: 10px; }

.rule { margin: 56px 0; display: flex; align-items: center; gap: 14px; color: var(--accent); }
.rule::before, .rule::after { content: ""; flex: 1; border-top: 3px double var(--accent); }
.rule span { font-family: "Noto Serif JP", serif; font-size: 18px; color: var(--red); }

.promise { list-style: none; margin-bottom: 18px; }
.promise li { font-size: 15.5px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.promise li::before { content: "— "; color: var(--red); font-weight: 700; }

.links { padding: 0 0 56px; }
.links-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.links-grid .link-card { grid-column: span 2; }
.links-grid .link-card:nth-child(4),
.links-grid .link-card:nth-child(5) { grid-column: span 3; }
.link-card { border: 1px solid var(--line); background: var(--card); padding: 22px; text-decoration: none; color: var(--ink); display: block; border-radius: 6px; }
.link-card:hover { border-color: var(--red); }
.link-card .kanji { font-family: "Noto Serif JP", serif; font-size: 22px; color: var(--red); display: block; margin-bottom: 6px; }
.link-card h3 { font-family: Fraunces, serif; font-size: 19px; margin-bottom: 6px; }
.link-card p { font-size: 13.5px; color: var(--muted); }

.safe { padding: 28px 24px; background: var(--ink); color: var(--paper); }
.safe-inner { max-width: 1140px; margin: 0 auto; display: flex; gap: 16px; align-items: flex-start; }
.safe .stamp { flex-shrink: 0; width: 48px; height: 48px; border: 2px solid var(--red); color: var(--red); font-family: "Noto Serif JP", serif; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; transform: rotate(-6deg); }
.safe p { font-size: 14px; color: #cbb892; }
.safe p strong { color: var(--red); }

.footer { border-top: 3px double var(--accent); padding: 28px 24px; text-align: center; font-size: 13px; color: var(--muted); background: var(--card); }
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--red); }

.exam-intro { margin-bottom: 14px; }
.download-all { margin: 18px 0 8px; }
.exam-group { margin: 36px 0 8px; }
.exam-group h2 { font-family: Fraunces, serif; font-size: 24px; margin-bottom: 6px; }
.exam-group .sub { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.track { padding: 14px 0; border-bottom: 1px solid var(--line); }
.track h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.track audio { width: 100%; height: 40px; }

.inner { max-width: 780px; margin: 0 auto; padding: 40px 24px 64px; }
.inner.wide { max-width: 1140px; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--red); font-weight: 700; margin-bottom: 10px; }
.page-title { font-family: Fraunces, serif; font-size: 40px; font-weight: 700; line-height: 1.1; margin-bottom: 12px; letter-spacing: -.01em; }
.lede { font-family: Fraunces, serif; font-style: italic; font-size: 20px; color: var(--muted); margin-bottom: 28px; line-height: 1.4; }

.essay-grid { display: grid; gap: 22px; }
.essay-card { display: grid; grid-template-columns: 180px 1fr; gap: 22px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); border-radius: 6px; overflow: hidden; }
.essay-card:hover { border-color: var(--red); }
.essay-card img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--paper); }
.essay-card .meta { padding: 18px 18px 18px 0; }
.essay-card time { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.essay-card h2 { font-family: Fraunces, serif; font-size: 22px; line-height: 1.2; margin: 6px 0 8px; }
.essay-card p { font-size: 14px; color: var(--muted); }

.article time { font-size: 13px; color: var(--muted); }
.article .hero-img { margin: 18px 0 28px; border: 1px solid var(--line); }
.article .hero-img img { width: 100%; display: block; }
.article h2 { font-family: Fraunces, serif; font-size: 24px; margin: 28px 0 10px; }
.article p { margin-bottom: 14px; }
.article ul, .article ol { margin: 0 0 16px 1.2em; }
.article li { margin: 6px 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0 24px; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article figure { margin: 16px 0 24px; }
.article .cta-row { margin-top: 36px; }
.article .cta-row a { display: inline-block; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 18px; }

.boards { display: grid; gap: 36px; }
.board { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; }
.board h2 { font-family: Fraunces, serif; font-size: 24px; margin-bottom: 6px; }
.board .kanji { font-family: "Noto Serif JP", serif; color: var(--red); margin-right: 8px; }
.board .sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.board ol { margin-left: 1.3em; }
.board li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .en { color: var(--muted); font-size: 14px; }

.about-photo { float: left; width: 220px; margin: 0 20px 12px 0; border: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; }
.about-grid img { width: 100%; height: 180px; object-fit: cover; display: block; border: 1px solid var(--line); }
.about-body { overflow: hidden; }
.about-body h2 { font-family: Fraunces, serif; font-size: 24px; margin: 28px 0 10px; clear: both; }
.about-body ul { margin: 0 0 16px 1.2em; }
.about-body p { margin-bottom: 14px; }

.about-carousel { clear: both; margin: 22px 0 8px; outline: none; max-width: 100%; }
.about-carousel:focus-visible { box-shadow: 0 0 0 2px var(--red); }
.about-carousel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  container-type: inline-size;
}
.about-carousel-track {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0;
  transition: transform .4s ease;
}
.about-carousel-slide {
  flex: 0 0 100cqw;
  width: 100cqw;
  max-width: 100cqw;
  height: 100%;
  overflow: hidden;
}
.about-carousel-slide img {
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  display: block;
}
.about-carousel-prev,
.about-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  background: rgba(28, 26, 22, .72);
  color: #fff;
  font: 500 28px/1 Fraunces, serif;
  cursor: pointer;
}
.about-carousel-prev { left: 8px; }
.about-carousel-next { right: 8px; }
.about-carousel-prev:hover,
.about-carousel-next:hover { background: var(--red); }
.about-carousel-prev:focus-visible,
.about-carousel-next:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.about-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  margin-top: 10px;
}
.about-carousel-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-carousel-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.about-carousel-dot[aria-current="true"]::after { background: var(--red); }
.about-carousel-dot:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) {
  .about-carousel-track { transition: none; }
}

.tools-wrap { max-width: 1000px; margin: 0 auto; padding: 24px 24px 48px; }
.tools-wrap .intro { max-width: 62ch; margin-bottom: 8px; }
.tools-wrap .place { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 22px 0 0; border-bottom: 2px solid var(--ink); }
.choices a { width: 100%; height: 100%; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; text-align: left; font: inherit; color: inherit; text-decoration: none; padding: 12px 14px 16px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.choices a:hover, .choices a:focus-visible { background: #faf7f2; outline: none; }
.choices a.on { border-bottom-color: var(--red); background: #faf7f2; }
.choices .kanji { font-family: "Noto Serif JP", serif; font-size: 20px; color: var(--red); line-height: 1; }
.choices h2 { font-size: 16px; font-weight: 700; line-height: 1.25; }
.choices .desc { font-size: 13px; color: #444; font-weight: 400; }
.choices .short { display: none; }
.stage { display: none; padding-top: 18px; }
body.is-open .stage { display: block; }
.tool-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tools-wrap .lede { font-family: Outfit, sans-serif; font-style: normal; font-size: 14px; color: #555; max-width: 62ch; margin-bottom: 14px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.field select { font: inherit; padding: 7px 8px; }
.btn { background: var(--red); color: #fff; border: 0; font: 700 14px/1 Outfit, sans-serif; padding: 10px 14px; cursor: pointer; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.combo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid #eee; }
.tech { font-family: "Noto Serif JP", serif; font-size: 15px; }
.into { font-size: 11px; color: var(--red); font-weight: 700; }
.empty { color: #777; font-size: 14px; }
.exam { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.exam-col h3 { font-size: 13px; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 8px; }
.exam-col ol { padding-left: 18px; font-size: 14px; }
.exam-col li { margin: 4px 0; }
#print-sheet { display: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: 36px; }
  .hero .intro-photo { position: static; }
  .intro-photo img { height: 280px; }
  .page-title { font-size: 32px; }
  .links-grid { grid-template-columns: 1fr; }
  .links-grid .link-card,
  .links-grid .link-card:nth-child(4),
  .links-grid .link-card:nth-child(5) { grid-column: auto; }
  .masthead-inner { flex-wrap: wrap; }
  .mast-nav { flex: 1 0 100%; align-items: flex-start; }
  .mast-nav .nav { width: 100%; max-width: 100%; justify-content: flex-start; }
  .mast-nav .nav a { padding: 6px 8px; }
  .about-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .nameplate h2 { font-size: 24px; }
  .mast-nav .nav a { padding: 6px 6px; font-size: 12px; }
  .essay-card { grid-template-columns: 1fr; }
  .essay-card img { height: 180px; }
  .essay-card .meta { padding: 16px; }
  .about-photo { float: none; width: 100%; margin: 0 0 16px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid img { height: 220px; }
  .about-carousel-viewport { aspect-ratio: auto; height: 280px; }
  .intro-photo .btn-cal { display: block; width: 100%; text-align: center; padding: 14px 18px; min-height: 44px; }
  .choices { position: sticky; top: 0; z-index: 8; background: var(--paper); box-shadow: 0 6px 12px rgba(0,0,0,.06); }
  .choices a { align-items: center; text-align: center; padding: 10px 6px 12px; min-height: 64px; gap: 4px; }
  .choices .desc { display: none; }
  .choices .full { display: none; }
  .choices .short { display: block; }
  .choices h2 { font-size: 12px; }
  .exam { grid-template-columns: 1fr; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .controls .field:last-of-type { grid-column: 1 / -1; }
  .field select { width: 100%; padding: 10px 8px; font-size: 16px; }
  .btn, .btn.ghost { width: 100%; grid-column: 1 / -1; padding: 12px 14px; min-height: 44px; }
}

@media print {
  @page { margin: 0.85in 1in; }
  .skip, .masthead, .safe, .footer, .choices { display: none !important; }
  body { background: #fff; color: #111; }
  .tools-wrap { display: none !important; }
  #print-sheet { display: block !important; padding: 0 0.35in; max-width: 100%; }
  .print-brand { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 18px; }
  .print-brand img { width: 72px; height: auto; }
  .print-name { font-size: 20px; font-weight: 700; }
  .print-url { font-size: 13px; color: #333; }
  .print-sheet h1 { font-size: 18px; margin: 0 0 14px; font-weight: 700; }
  .print-chains { list-style: none; padding: 0; margin: 0; }
  .print-chains li { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid #ddd; font-family: "Noto Serif JP", Georgia, serif; font-size: 15px; display: flex; gap: 14px; align-items: baseline; }
  .print-chains .n { flex: 0 0 2.4em; text-align: right; color: #666; font-family: Outfit, sans-serif; font-size: 13px; }
  .print-chains .into { color: #c4121a; font-size: 12px; font-weight: 700; padding: 0 8px; font-family: Outfit, sans-serif; }
  .print-exam { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .print-exam h2 { font-size: 13px; border-bottom: 1px solid #111; padding-bottom: 4px; margin-bottom: 8px; }
  .print-exam ol { padding-left: 1.2em; font-size: 12px; }
  .print-exam li { margin: 5px 0; break-inside: avoid; }
  .print-note { margin-top: 22px; font-size: 11px; color: #555; }
}
