:root {
  --navy-950: #0f1f33;
  --navy-900: #1d3a5f;
  --navy-850: #234368;
  --navy-800: #27476f;
  --navy-700: #345880;
  --steel-300: #a9bfd6;
  --steel-200: #c7d6e6;
  --paper: #ede3c8;
  --paper-dim: #d9cca3;
  --ochre: #d9c08a;
  --ochre-dark: #b89a5c;
  --vermillion: #c0392b;
  --vermillion-dark: #8e2a20;
  --line: rgba(237, 227, 200, 0.18);
  --line-dark: rgba(15, 31, 51, 0.16);
  --shadow: 0 18px 44px rgba(9, 18, 30, 0.35);
  --body-font: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --display: "Shippori Mincho B1", "Noto Serif JP", serif;
  --label: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--navy-950); color: var(--paper); }
body { margin: 0; font-family: var(--body-font); line-height: 1.85; background: var(--navy-950); color: var(--paper); }
a { color: inherit; }
img { max-width: 100%; display: block; }

.site-header, .site-footer {
  background: var(--navy-950);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 5vw, 56px);
}
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 3px solid var(--vermillion); }
.brand { font-family: var(--display); font-size: 1.55rem; font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
nav { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--label); font-size: 0.92rem; }
nav a, .site-footer a { text-underline-offset: 0.28em; text-decoration-color: var(--ochre-dark); }

main { min-height: 70vh; }
.hero, .page-hero, .result-hero, .quiz-shell, .catalog-shell, .shortlist, .packing-group, .content-page, .notfound {
  padding: clamp(34px, 7vw, 86px) clamp(18px, 5vw, 56px);
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(100deg, rgba(15,31,51,0.86), rgba(15,31,51,0.62) 55%, rgba(15,31,51,0.86)),
    url('/images/hero-texture.jpg') center / cover no-repeat,
    linear-gradient(160deg, var(--navy-900), var(--navy-950) 70%);
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 220px, rgba(192, 57, 43, 0.16) 220px 221px);
}
.hero h1, .page-hero h1, .result-hero h1, .notfound h1 {
  font-family: var(--display);
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  line-height: 1.15;
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}
.hero p, .page-hero p, .result-hero p { max-width: 640px; font-size: 1.06rem; color: var(--steel-200); }
.hero h1 .reading, .page-hero h1 .reading, .result-hero h1 .reading, .notfound h1 .reading {
  display: block;
  font-family: var(--label);
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ochre);
  margin-top: 10px;
}
.hero .eyebrow, .page-hero .eyebrow, .result-hero .eyebrow { color: var(--ochre); }

.map-sign {
  background: var(--navy-850);
  border: 1px solid rgba(217, 192, 138, 0.4);
  border-radius: 4px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.map-sign::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(217, 192, 138, 0.35);
  pointer-events: none;
}
.map-sign small { font-family: var(--label); color: var(--steel-300); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; }
.map-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border: 3px solid var(--vermillion);
  border-radius: 50%;
  color: var(--vermillion);
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 14px 0;
  transform: rotate(-6deg);
}
.map-sign p { color: var(--steel-200); font-size: 0.98rem; margin: 10px 0 0; }

.cta-row, .buy-links, .quiz-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button, .buy-links a, .quiz-actions button {
  border: 1px solid var(--vermillion);
  background: var(--vermillion);
  color: var(--paper);
  border-radius: 3px;
  padding: 12px 20px;
  font-family: var(--label);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.96rem;
}
.button.secondary, .quiz-actions button.secondary { background: transparent; color: var(--paper); border-color: var(--ochre-dark); }
.button:hover, .buy-links a:hover, .quiz-actions button:hover:not(:disabled) { background: var(--vermillion-dark); border-color: var(--vermillion-dark); }
.button:focus-visible, .buy-links a:focus-visible, .quiz-actions button:focus-visible, .q-option:focus-visible, nav a:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}
.quiz-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

.section-head p, .eyebrow, .q-kicker {
  margin: 0 0 8px;
  font-family: var(--label);
  color: var(--ochre);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-head h2, .content-page h2, .catalog-group h2, .packing-group h2, .odometer h2 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4.4vw, 2.9rem);
  line-height: 1.25;
  color: var(--paper);
}
.catalog-shell, .packing-group { border-top: 1px solid var(--line); }

.category-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.category-strip div { padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--navy-900); }
.category-strip strong { display: block; font-family: var(--display); font-size: 1.12rem; color: var(--paper); }
.category-strip span { color: var(--steel-300); font-size: 0.9rem; }
.category-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; border: 1px solid var(--ochre-dark); margin-bottom: 10px; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card {
  background: var(--navy-900);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-image { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--paper), var(--paper-dim)); display: grid; place-items: center; }
.product-image img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-copy { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-meta, .spec-list { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--label); }
.product-meta span, .spec-list span, .maker-note {
  border: 1px solid var(--line);
  background: var(--navy-850);
  color: var(--steel-200);
  border-radius: 3px;
  padding: 3px 9px;
  font-size: 0.8rem;
}
.product-card h3 { font-family: var(--body-font); font-size: 1.02rem; line-height: 1.55; margin: 0; color: var(--paper); }
.product-card p { margin: 0; color: var(--steel-200); }
.buy-links { margin-top: auto; }
.buy-links a { flex: 1; text-align: center; padding: 9px 10px; }

.quiz-shell { max-width: 900px; margin: 0 auto; }
.route-line { height: 3px; background: var(--navy-800); position: relative; margin: 20px 0 4px; }
.route-fill { display: block; height: 100%; background: var(--vermillion); transition: width 0.3s ease; }
.route-waypoints { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 0 0 28px; font-family: var(--label); font-size: 0.82rem; color: var(--steel-300); }
.route-waypoints li { position: relative; padding-top: 14px; }
.route-waypoints li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--navy-950);
  border: 2px solid var(--ochre-dark);
}
.route-waypoints li.is-open { color: var(--ochre); }
.route-waypoints li.is-open::before { background: var(--vermillion); border-color: var(--vermillion); }

.q-card { background: var(--navy-900); border: 1px solid var(--line); border-radius: 4px; padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-family: var(--display); font-size: clamp(1.9rem, 5.4vw, 3.1rem); line-height: 1.3; margin-bottom: 10px; color: var(--paper); }
.q-card p { color: var(--steel-200); }
.q-helper { font-size: 0.88rem; color: var(--ochre); }
.q-options { display: grid; gap: 12px; margin-top: 22px; }
.q-option {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  background: var(--navy-850);
  color: var(--paper);
  border-radius: 4px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: var(--body-font);
}
.q-option:hover { border-color: var(--ochre-dark); }
.q-option:active { transform: translateY(1px); }
.q-option.is-selected { background: var(--navy-700); border-color: var(--vermillion); }
.option-mark { width: 16px; height: 16px; border: 2px solid var(--ochre-dark); border-radius: 50%; margin-top: 5px; }
.q-option.is-selected .option-mark { background: var(--vermillion); border-color: var(--vermillion); }
.q-option small { display: block; margin-top: 4px; color: var(--steel-300); font-family: var(--label); font-size: 0.85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.odometer {
  margin: 0 clamp(18px, 5vw, 56px) clamp(34px, 7vw, 86px);
  padding: clamp(22px, 5vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 22px;
  align-items: center;
  background: var(--navy-900);
  color: var(--paper);
  border-radius: 4px;
  border: 1px solid var(--ochre-dark);
}
.odo-face { background: var(--navy-950); border: 1px solid rgba(217,192,138,0.3); padding: 20px; text-align: right; }
.odo-face span { display: block; font-family: var(--mono); color: var(--vermillion); font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1; }
.odo-face small { font-family: var(--mono); color: var(--steel-300); }
.odo-caveat { grid-column: 1 / -1; margin: 0; padding: 12px 14px; background: rgba(192,57,43,0.14); border-left: 3px solid var(--vermillion); color: var(--steel-200); font-size: 0.92rem; }
.odometer.is-disabled { opacity: 0.72; border-color: var(--line); }
.odometer.is-disabled .odo-face span { color: var(--steel-300); }

.content-page { max-width: 860px; }
.content-page p, .content-page li { font-size: 1.02rem; color: var(--steel-200); }
.content-page h2 { margin-top: 40px; }
.notfound { min-height: 72vh; background: repeating-linear-gradient(135deg, var(--navy-900) 0 24px, var(--navy-950) 24px 48px); color: var(--paper); display: grid; place-items: center; }
.notfound-panel { max-width: 720px; background: var(--navy-900); border: 1px solid var(--vermillion); border-radius: 4px; padding: clamp(24px, 5vw, 48px); text-align: center; }
.notfound-image { width: 180px; margin: 0 auto 22px; }
.site-footer { align-items: flex-start; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; color: var(--steel-300); font-size: 0.88rem; }

.editor-figure { border-radius: 4px; overflow: hidden; border: 1px solid var(--line); margin: 24px 0; }

@media (max-width: 900px) {
  .hero, .odometer { grid-template-columns: 1fr; }
  .product-grid, .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header, .site-footer { display: block; }
  nav { margin-top: 12px; }
  .hero { min-height: auto; }
  .product-grid, .category-strip { grid-template-columns: 1fr; }
  .route-waypoints { font-size: 0.68rem; }
}
