:root {
  --ink: #2f2a24;
  --muted: #746c61;
  --paper: #f7f3ea;
  --card: #fffdf7;
  --line: #dfd7c9;
  --accent: #71624b;
  --accent-dark: #4f4638;
  --accent-soft: #ece4d6;
  --sage-soft: #e9eee5;
  --shadow: 0 14px 38px rgba(73, 64, 48, 0.08);
  --font-body: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Serif", "Noto Serif JP", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(225, 214, 199, 0.8);
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(14px);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
}

.language-switcher {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.language-switcher button {
  min-width: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.language-switcher button:disabled {
  cursor: wait;
}

.language-switcher button.is-active {
  background: var(--accent-dark);
  color: white;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--accent-dark);
  font-size: 14px;
}

.nav-links {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 10px 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent-dark);
}

.hero {
  display: grid;
  min-height: 62vh;
  align-items: center;
  padding: clamp(64px, 10vw, 120px) clamp(18px, 5vw, 64px);
  background: linear-gradient(180deg, #fbf8f1 0%, var(--paper) 100%);
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.contact-card span {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.028em;
}

h3 {
  font-size: 18px;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button,
.contact-card {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.button.primary {
  background: var(--accent-dark);
  color: white;
  box-shadow: var(--shadow);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.button:hover,
.contact-card:hover {
  transform: translateY(-2px);
}

.detail-panel,
.audience-panel,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.purpose-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 620px;
  margin-top: 28px;
}

.purpose-list span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.72);
  font-size: 14px;
  font-weight: 700;
}

.section {
  padding: clamp(54px, 7vw, 86px) clamp(18px, 5vw, 64px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading p {
  color: var(--muted);
}

.quiz-section {
  background: #eee7db;
}

.quiz-shell {
  max-width: 1180px;
  min-height: 610px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.quiz-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(30px, 7vw, 90px);
  min-height: 500px;
  align-items: center;
}

.quiz-intro-copy {
  max-width: 620px;
}

.quiz-intro-copy > p:not(.eyebrow),
.quiz-results-heading > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.quiz-intro-actions,
.quiz-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.quiz-intro-actions > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.quiz-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.quiz-button.secondary {
  border: 1px solid var(--line);
}

.quiz-compass-art {
  display: grid;
  place-items: center;
  min-height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, #f8f3e8 0 45%, transparent 46%),
    repeating-radial-gradient(circle, transparent 0 44px, rgba(113, 98, 75, 0.1) 45px 46px);
}

.compass-circle {
  position: relative;
  width: min(330px, 75vw);
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.compass-circle::before,
.compass-circle::after {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(113, 98, 75, 0.3);
  content: "";
  transform: rotate(45deg);
}

.compass-circle::after {
  inset: 29%;
  border-radius: 50%;
  transform: none;
}

.compass-circle span {
  position: absolute;
  z-index: 1;
  padding: 4px 8px;
  background: var(--card);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 14px;
}

.compass-north {
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
}

.compass-east {
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
}

.compass-south {
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
}

.compass-west {
  top: 50%;
  left: -22px;
  transform: translateY(-50%);
}

.compass-circle i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 15%;
  height: 47%;
  background: linear-gradient(to bottom, var(--accent-dark) 0 50%, #cdbfa9 50%);
  clip-path: polygon(50% 0, 100% 50%, 62% 50%, 62% 100%, 38% 100%, 38% 50%, 0 50%);
  transform: translate(-50%, -50%) rotate(28deg);
  transform-origin: center;
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.quiz-progress-row .eyebrow {
  flex: 0 0 auto;
  margin: 0;
}

.quiz-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.quiz-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-dark);
  transition: width 220ms ease;
}

.quiz-question {
  padding-top: clamp(34px, 6vw, 62px);
}

.quiz-question h2 {
  max-width: 720px;
  margin-bottom: 28px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.quiz-choice {
  position: relative;
  display: flex;
  min-height: 230px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fbf8f1;
  color: var(--ink);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.quiz-choice:hover {
  border-color: #baa98e;
  transform: translateY(-3px);
}

.quiz-choice.is-selected {
  border-color: var(--accent-dark);
  background: var(--sage-soft);
  box-shadow: 0 0 0 3px rgba(113, 98, 75, 0.13);
}

.quiz-choice strong {
  max-width: 190px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
}

.quiz-illustration {
  display: grid;
  width: 112px;
  height: 112px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
}

.quiz-illustration svg {
  width: 82px;
  height: 82px;
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiz-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: transparent;
  font-weight: 900;
  place-items: center;
}

.quiz-choice.is-selected .quiz-check {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: white;
}

.quiz-prompt {
  min-height: 24px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.quiz-results-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.quiz-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.quiz-result-card {
  position: relative;
  min-height: 390px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fbf8f1;
}

.quiz-result-1 {
  background: var(--sage-soft);
}

.quiz-result-3 {
  background: #eee5dc;
}

.quiz-result-number {
  position: absolute;
  top: 8px;
  right: 18px;
  color: rgba(113, 98, 75, 0.09);
  font-family: var(--font-display);
  font-size: 78px;
  line-height: 1;
}

.quiz-result-card .eyebrow {
  position: relative;
  max-width: 75%;
}

.quiz-result-card h3 {
  position: relative;
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.18;
}

.quiz-result-japanese,
.quiz-match-reason {
  color: var(--muted);
}

.quiz-match-reason {
  margin: 22px 0;
}

.quiz-learn-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.quiz-helper {
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.search-panel {
  max-width: 760px;
  margin: 0 0 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.72);
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.search-row input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(113, 98, 75, 0.14);
}

.search-row button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.6);
}

.sake-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
}

.sake-card {
  width: 100%;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sake-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(113, 98, 75, 0.14);
}

.sake-card h3 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.15;
}

.sake-card p {
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.detail-section {
  background: #f1eadf;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.detail-panel,
.audience-panel {
  padding: clamp(22px, 4vw, 34px);
}

.japanese-name {
  color: var(--muted);
  font-family: "Noto Serif JP", var(--font-display);
  font-size: 18px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.spec {
  padding: 14px;
  border-radius: 18px;
  background: var(--sage-soft);
}

.spec span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.spec strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  white-space: pre-line;
}

.note-block {
  padding-top: 8px;
}

.story-block {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--accent-soft);
}

.story-block h3 {
  margin-bottom: 8px;
}

.story-block p {
  margin-bottom: 0;
  color: var(--muted);
}

.tasting-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.tasting-list div {
  padding: 16px;
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: #fffaf1;
}

.tasting-list dt {
  color: var(--accent-dark);
  font-weight: 900;
}

.tasting-list dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.audience-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.audience-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 10px 13px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.audience-tab.is-active {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: white;
}

.audience-content {
  min-height: 300px;
  padding: 20px;
  border-radius: 22px;
  background: #fffaf1;
}

.audience-content p {
  color: var(--muted);
  font-size: 18px;
}

.contact-section {
  background: var(--accent-dark);
  color: white;
}

.contact-section .eyebrow,
.contact-section .section-heading p {
  color: #f0d9b7;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
}

.contact-card span {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.contact-card small {
  color: var(--muted);
}

.contact-helper {
  min-height: 24px;
  margin: 18px 0 0;
  color: #f0d9b7;
  font-size: 14px;
}

.site-footer {
  padding: 22px clamp(18px, 5vw, 64px);
  border-top: 1px solid rgba(223, 215, 201, 0.7);
  background: #efe8dc;
}

.site-footer p {
  max-width: 960px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 980px) {
  .hero,
  .detail-layout,
  .quiz-intro {
    grid-template-columns: 1fr;
  }

  .sake-grid,
  .contact-grid,
  .quiz-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-compass-art {
    min-height: 300px;
  }

  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .sake-grid,
  .contact-grid,
  .quiz-options,
  .quiz-results-grid,
  .spec-grid,
  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row {
    display: grid;
  }

  .quiz-shell {
    min-height: 0;
    padding: 22px 16px;
    border-radius: 24px;
  }

  .quiz-choice {
    min-height: 172px;
    flex-direction: row;
    gap: 18px;
    justify-content: flex-start;
    text-align: left;
  }

  .quiz-illustration {
    width: 86px;
    height: 86px;
    margin: 0;
    flex: 0 0 86px;
  }

  .quiz-illustration svg {
    width: 62px;
    height: 62px;
  }

  .quiz-progress-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .quiz-controls,
  .quiz-result-actions {
    flex-direction: column-reverse;
  }

  .quiz-controls .button,
  .quiz-result-actions .button {
    width: 100%;
  }
}

/* Multi-page photographic redesign */
:root {
  --vermillion: #a8462d;
  --gold: #d7a755;
  --shadow: 0 18px 50px rgba(58, 45, 29, 0.12);
}

.nav-links a.is-current {
  color: var(--vermillion);
}

.button.light {
  background: #fffdf8;
  color: var(--accent-dark);
  box-shadow: 0 14px 34px rgba(20, 12, 8, 0.24);
}

.button.glass {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  backdrop-filter: blur(12px);
}

.home-hero {
  position: relative;
  display: grid;
  height: clamp(740px, 84svh, 820px);
  min-height: 740px;
  overflow: hidden;
  align-items: center;
  color: white;
}

.home-hero-photo,
.home-hero-overlay {
  position: absolute;
  inset: 0;
}

.home-hero-photo {
  background-image: url("assets/quiz/home-atmosphere.webp");
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
}

.home-hero-overlay {
  background:
    linear-gradient(90deg, rgba(24, 17, 12, 0.84) 0%, rgba(35, 22, 14, 0.56) 48%, rgba(24, 17, 12, 0.18) 100%),
    linear-gradient(0deg, rgba(20, 12, 8, 0.55), transparent 55%);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  width: min(960px, 82vw);
  max-width: 960px;
  padding: clamp(62px, 7vw, 92px) clamp(20px, 7vw, 92px);
}

.home-hero .eyebrow,
.home-hero .hero-text {
  color: #f4dfbd;
}

.home-hero h1 {
  max-width: 900px;
  font-size: clamp(38px, 4.8vw, 64px);
  text-wrap: balance;
}

html[lang="zh-Hans"] .home-hero h1,
html[lang="ja"] .home-hero h1 {
  font-size: clamp(38px, 4.5vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

body.is-language-updating *,
body.is-language-updating *::before,
body.is-language-updating *::after {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

.quiz-intro.is-language-static,
.quiz-question.is-language-static,
.quiz-results-view.is-language-static,
.quiz-results-view.is-language-static *,
.quiz-results-view.is-language-static *::before,
.quiz-results-view.is-language-static *::after {
  animation: none !important;
}

.home-paths {
  background: linear-gradient(180deg, #f7f3ea, #efe5d7);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.path-card {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 30px;
  color: white;
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateZ(0);
}

.path-card img,
.path-card-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.path-card img {
  object-fit: cover;
  transition: transform 500ms ease;
}

.path-card:hover img {
  transform: scale(1.05);
}

.path-card-overlay {
  background: linear-gradient(0deg, rgba(23, 14, 9, 0.88), rgba(23, 14, 9, 0.05) 72%);
}

.path-card-copy {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  padding: clamp(24px, 4vw, 42px);
  flex-direction: column;
  align-items: flex-start;
}

.path-card-copy small {
  margin-bottom: 8px;
  color: #f3d6a6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.path-card-copy strong {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.path-card-copy > span {
  max-width: 480px;
  margin: 12px 0 22px;
  color: rgba(255, 255, 255, 0.84);
}

.path-card-copy b {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.library-page-hero {
  display: flex;
  min-height: 360px;
  padding: clamp(70px, 9vw, 116px) clamp(18px, 7vw, 92px);
  background:
    linear-gradient(90deg, rgba(250, 246, 237, 0.97), rgba(250, 246, 237, 0.67)),
    url("assets/quiz/occasion-learn.webp") center 42% / cover;
  flex-direction: column;
  justify-content: center;
}

.library-page-hero h1 {
  max-width: 760px;
  min-height: 1.2em;
  text-wrap: balance;
}

.library-page-hero > p:last-child {
  max-width: 650px;
  min-height: 3.2em;
  color: var(--muted);
  font-size: 19px;
}

html[lang="zh-Hans"] .library-page-hero h1,
html[lang="ja"] .library-page-hero h1,
html[lang="zh-Hans"] .section-heading h2,
html[lang="ja"] .section-heading h2,
html[lang="zh-Hans"] .quiz-shell h2,
html[lang="ja"] .quiz-shell h2 {
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.learning-roadmap .section-heading,
.library-section > .section-heading {
  min-height: 180px;
}

.quiz-section {
  padding: clamp(22px, 5vw, 58px);
  background:
    radial-gradient(circle at 12% 18%, rgba(215, 167, 85, 0.28), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(168, 70, 45, 0.18), transparent 30%),
    #eadfce;
}

.quiz-page-main,
.quiz-page .quiz-section {
  min-height: calc(100vh - 142px);
}

.quiz-shell {
  min-height: 680px;
  border-radius: 34px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 26px 80px rgba(69, 47, 27, 0.17);
}

.quiz-intro-copy h2 {
  display: flex;
  min-height: 2.45em;
  align-items: flex-end;
}

.quiz-intro-copy > p:not(.eyebrow) {
  min-height: 5.2em;
}

.quiz-intro-photo {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(54, 33, 20, 0.2);
}

.quiz-intro-photo img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.quiz-intro-photo span {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(26, 17, 12, 0.58);
  color: white;
  font-family: var(--font-display);
  text-align: center;
  backdrop-filter: blur(12px);
}

.quiz-question {
  animation: quiz-arrive 520ms ease both;
  transition: opacity 520ms ease, transform 520ms ease, filter 520ms ease;
}

.quiz-question.is-leaving {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-18px) scale(0.985);
}

@keyframes quiz-arrive {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-question-heading {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  min-height: 112px;
  align-items: start;
}

.quiz-question h2 {
  max-width: 760px;
  justify-self: center;
  text-align: center;
  text-wrap: balance;
}

.quiz-back-link {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.quiz-choice {
  height: 260px;
  min-height: 260px;
  padding: 0;
  background: #2f251e;
  color: white;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.quiz-choice:disabled {
  cursor: default;
}

.quiz-choice.is-selected {
  border-color: white;
  background: #2f251e;
  box-shadow: 0 0 0 4px var(--gold), 0 16px 36px rgba(50, 33, 20, 0.26);
  transform: translateY(-4px) scale(1.015);
}

.quiz-choice strong {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 88px;
  max-width: 90%;
  padding: 20px;
  align-items: flex-end;
  color: white;
  font-size: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.quiz-photo,
.quiz-choice-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.quiz-photo {
  object-fit: cover;
  transition: transform 420ms ease, filter 220ms ease;
}

.quiz-choice:hover .quiz-photo,
.quiz-choice.is-selected .quiz-photo {
  transform: scale(1.06);
}

.quiz-choice-shade {
  z-index: 1;
  background: linear-gradient(0deg, rgba(18, 10, 6, 0.84), rgba(18, 10, 6, 0.04) 72%);
}

.quiz-check {
  z-index: 3;
}

.quiz-choice.is-selected .quiz-check {
  border-color: white;
  background: var(--vermillion);
}

.quiz-prompt {
  text-align: center;
}

.quiz-multi-controls {
  display: flex;
  min-height: 58px;
  margin-top: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.quiz-multi-controls .quiz-prompt {
  min-height: 0;
  margin: 0;
  text-align: left;
}

.quiz-multi-controls .quiz-button {
  min-width: 150px;
}

.quiz-result-card {
  box-shadow: 0 10px 28px rgba(63, 45, 29, 0.08);
}

.quiz-options-experience {
  max-width: 860px;
  margin-right: auto;
  margin-left: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-question {
  animation-duration: 820ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-duration: 760ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-question.is-leaving {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(-8px) scale(0.992);
}

.quiz-results-view {
  animation: results-reveal 1100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-results-heading {
  min-height: 180px;
  animation: result-item-reveal 900ms 140ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-results-grid {
  grid-auto-rows: 1fr;
}

.quiz-result-card {
  display: flex;
  height: 100%;
  min-height: 430px;
  flex-direction: column;
  animation: result-item-reveal 950ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-result-card h3 {
  min-height: 3.55em;
}

.quiz-result-japanese {
  min-height: 3.2em;
}

.quiz-match-reason {
  min-height: 5.2em;
}

.quiz-learn-link {
  margin-top: auto;
  align-self: flex-start;
}

.quiz-result-card:nth-child(1) {
  animation-delay: 280ms;
}

.quiz-result-card:nth-child(2) {
  animation-delay: 440ms;
}

.quiz-result-card:nth-child(3) {
  animation-delay: 600ms;
}

.quiz-result-actions,
.quiz-results-view .quiz-helper {
  animation: result-item-reveal 900ms 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes results-reveal {
  from {
    opacity: 0;
    filter: blur(7px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes result-item-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sake-card {
  display: flex;
  height: 100%;
  min-height: 470px;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.sake-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(63, 45, 29, 0.12);
}

.sake-card-photo {
  position: relative;
  display: block;
  height: 250px;
  min-height: 250px;
  overflow: hidden;
  flex: 0 0 250px;
  border-bottom: 1px solid var(--line);
  background: #f8f4ec;
}

.sake-card-copy {
  display: flex;
  padding: 20px;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.sake-card-copy .eyebrow {
  display: block;
}

.sake-card-title {
  min-height: 2.3em;
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.sake-card-japanese {
  min-height: 1.65em;
  color: var(--muted);
}

.preparing-badge {
  display: inline-flex;
  margin-top: 12px;
  padding: 5px 9px;
  border: 1px solid #d7c7a9;
  border-radius: 999px;
  background: #f6eddc;
  color: #6b573a;
  font-size: 11px;
  font-weight: 800;
}

.sake-card-copy .pill-row {
  margin-top: auto;
  padding-top: 16px;
}

.sake-photo-composition {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
  isolation: isolate;
  background: #f8f4ec;
}

.sake-photo-composition-card {
  height: 250px;
  min-height: 250px;
}

.sake-photo-composition::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.08), rgba(255, 253, 248, 0.42)),
    linear-gradient(0deg, rgba(255, 253, 248, 0.12), transparent 55%);
  content: "";
  pointer-events: none;
}

.sake-photo-background {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: 155%;
  height: 155%;
  object-fit: contain;
  opacity: 0.85;
  filter: blur(1.5px) saturate(0.82);
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) rotate(22deg) scale(1.08);
}

.sake-front-bottle-matte {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: clamp(150px, 44%, 205px);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 253, 248, 1) 0%,
    rgba(255, 253, 248, 0.98) 48%,
    rgba(255, 253, 248, 0.78) 68%,
    rgba(255, 253, 248, 0) 100%
  );
  transform: translateX(-50%);
}

.sake-side-name {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  color: #211d18;
  font-family: "Noto Serif JP", var(--font-display);
  font-weight: 600;
}

.sake-side-name-label {
  top: 50%;
  left: 20px;
  display: flex;
  width: 84px;
  height: 204px;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  transform: translateY(-50%);
  flex-direction: row-reverse;
}

.sake-label-column {
  display: block;
  max-height: 204px;
  font-size: 19px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-orientation: mixed;
  white-space: pre;
  writing-mode: vertical-rl;
}

.sake-side-name-brewery {
  top: 50%;
  right: 20px;
  display: flex;
  width: 30px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform: translateY(-50%);
  flex-direction: column;
  font-size: 23px;
  letter-spacing: 0;
  line-height: 1;
}

.sake-product-photo {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  padding: 17px;
  object-fit: contain;
  background: transparent;
  filter:
    contrast(1.08)
    saturate(1.05)
    drop-shadow(0 10px 12px rgba(47, 42, 36, 0.12));
  mix-blend-mode: multiply;
}

.sake-photo-composition-detail .sake-photo-background {
  width: 190%;
  height: 190%;
  object-fit: cover;
  object-position: center 62%;
  opacity: 0.85;
  transform: translate(-46%, -50%) rotate(22deg) scale(1.12);
}

.sake-photo-composition-detail .sake-product-photo {
  padding: 20px;
  object-fit: contain;
}

.sake-photo-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  color: var(--muted);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.placeholder-bottle {
  position: relative;
  width: 54px;
  height: 126px;
  margin-bottom: 12px;
  border: 2px solid #9d8d77;
  border-radius: 13px 13px 18px 18px;
  background: rgba(255, 255, 255, 0.38);
}

.placeholder-bottle::before {
  position: absolute;
  top: -26px;
  left: 15px;
  width: 20px;
  height: 28px;
  border: 2px solid #9d8d77;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: rgba(255, 255, 255, 0.38);
  content: "";
}

.placeholder-bottle::after {
  position: absolute;
  top: 44px;
  right: 8px;
  left: 8px;
  height: 37px;
  border: 1px solid #b9a990;
  background: rgba(255, 253, 247, 0.7);
  content: "";
}

.selected-sake-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.selected-photo-frame {
  height: 270px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8f4ec;
}

.sake-photo-placeholder-detail .placeholder-bottle {
  width: 68px;
  height: 158px;
}

.sake-photo-placeholder-detail .placeholder-bottle::before {
  left: 20px;
  width: 24px;
}

.learning-roadmap {
  background: #efe6d8;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
}

.knowledge-card {
  position: relative;
  height: 100%;
  min-height: 360px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 12px 32px rgba(73, 55, 36, 0.08);
}

.knowledge-card h3 {
  position: relative;
  max-width: 85%;
  font-size: 25px;
}

.knowledge-card > p:not(.eyebrow) {
  position: relative;
  color: var(--muted);
}

.knowledge-number {
  position: absolute;
  top: 8px;
  right: 18px;
  color: rgba(113, 98, 75, 0.08);
  font-family: var(--font-display);
  font-size: 82px;
  line-height: 1;
}

.future-badge {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.member-card {
  background: var(--accent-dark);
  color: white;
}

.member-card .eyebrow,
.member-card > p:not(.eyebrow) {
  color: #ead8bc;
}

.member-card .knowledge-number {
  color: rgba(255, 255, 255, 0.08);
}

.member-badge {
  background: #f0d6a5;
  color: #4a3826;
}

@media (max-width: 980px) {
  .nav-links {
    flex-wrap: wrap;
  }

  .home-hero {
    height: 780px;
    min-height: 780px;
  }

  .home-hero-copy {
    width: min(880px, 92vw);
  }

  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-card {
    min-height: 330px;
  }

  .quiz-intro-photo,
  .quiz-intro-photo img {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .home-hero {
    height: 850px;
    min-height: 850px;
    align-items: end;
  }

  .home-hero-copy {
    width: 100%;
    padding: 62px 20px 54px;
  }

  .home-hero h1 {
    font-size: clamp(35px, 10.5vw, 44px);
    line-height: 1.12;
  }

  html[lang="zh-Hans"] .home-hero h1,
  html[lang="ja"] .home-hero h1 {
    font-size: clamp(34px, 9.5vw, 42px);
    line-height: 1.28;
  }

  .home-hero .hero-text {
    font-size: 17px;
  }

  .library-page-hero {
    min-height: 410px;
  }

  .learning-roadmap .section-heading,
  .library-section > .section-heading {
    min-height: 0;
  }

  .path-grid {
    grid-template-columns: 1fr;
  }

  .path-card {
    min-height: 440px;
  }

  .quiz-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .quiz-choice {
    height: 210px;
    min-height: 190px;
    flex-direction: column;
    justify-content: flex-end;
  }

  .quiz-choice strong {
    min-height: 76px;
    padding: 14px;
    font-size: 16px;
  }

  .quiz-question-heading {
    grid-template-columns: 1fr;
    min-height: 132px;
  }

  .quiz-question-heading .quiz-back-link {
    margin-bottom: 12px;
  }

  .quiz-question h2 {
    justify-self: start;
    text-align: left;
  }

  .quiz-intro-copy h2,
  .quiz-intro-copy > p:not(.eyebrow),
  .quiz-results-heading {
    min-height: 0;
  }

  .quiz-multi-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .quiz-multi-controls .quiz-prompt {
    text-align: center;
  }

  .quiz-intro-photo,
  .quiz-intro-photo img {
    min-height: 290px;
  }

  .selected-sake-header {
    grid-template-columns: 1fr;
  }

  .selected-photo-frame {
    height: min(100vw, 420px);
    min-height: 320px;
  }

  .sake-card {
    height: 100%;
    min-height: 460px;
  }

  .audience-content {
    min-height: 250px;
  }
}

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