/* ==========================================================================
   五丰有味 V3.1 · 归侨阿姨高级动态 2D 版
   品牌色：暖白 #FAF9F5 / 墨绿 #174638 / 暖金橙 #CDA45D / 灰豆绿 #91A68E
   ========================================================================== */

:root {
  --ivory: #faf9f5;
  --ivory-2: #f4f0e5;
  --ivory-3: #ece5d4;
  --paper: #fffefa;
  --green: #174638;
  --green-2: #1e5543;
  --green-deep: #0b2c22;
  --green-ink: #09251d;
  --gold: #cda45d;
  --gold-2: #e4c98f;
  --gold-soft: #f0e1c3;
  --sage: #91a68e;
  --sage-soft: #dfe7da;
  --ink: #192b24;
  --ink-soft: #40534a;
  --muted: #748078;
  --line: rgba(23, 70, 56, 0.13);
  --line-strong: rgba(23, 70, 56, 0.22);
  --danger: #a04b35;
  --amber: #b78335;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "Georgia", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif;
  --shadow-soft: 0 30px 70px -45px rgba(10, 45, 34, 0.5);
  --shadow-chat: 0 30px 80px -54px rgba(10, 45, 34, 0.55);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --header-h: 76px;
  --character-crossfade-ms: 400ms;
  --ease-out: cubic-bezier(0.22, 0.8, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 14px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
  background:
    radial-gradient(circle at 10% 12%, rgba(205, 164, 93, 0.11), transparent 28%),
    radial-gradient(circle at 92% 6%, rgba(145, 166, 142, 0.12), transparent 32%),
    radial-gradient(circle at 50% 96%, rgba(205, 164, 93, 0.08), transparent 36%);
}

::selection {
  background: rgba(205, 164, 93, 0.35);
  color: var(--green-deep);
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--green);
  color: var(--paper);
  font-size: 13px;
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 26px;
  padding: 0 clamp(20px, 4vw, 62px);
  background: rgba(250, 249, 245, 0.82);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(250, 249, 245, 0.94);
  border-bottom-color: var(--line);
  box-shadow: 0 16px 34px -30px rgba(10, 45, 34, 0.45);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 45%),
    var(--green);
  border: 1px solid rgba(205, 164, 93, 0.7);
  box-shadow: inset 0 0 0 3px rgba(250, 249, 245, 0.08);
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__text strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  white-space: nowrap;
}

.brand__text small {
  color: var(--muted);
  font-family: "Georgia", serif;
  font-size: 7.5px;
  letter-spacing: 0.19em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 38px);
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transform: translateX(-50%);
  transition: width 0.25s var(--ease-out);
}

.site-nav a:hover {
  color: var(--green);
}

.site-nav a:hover::after {
  width: 100%;
}

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

.header-place {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: var(--paper);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.header-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.header-cta:hover {
  background: transparent;
  color: var(--green);
}

.header-cta:hover svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Main experience
   -------------------------------------------------------------------------- */

.experience {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  width: 100%;
  max-width: 1660px;
  height: calc(100dvh - var(--header-h));
  min-height: 680px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 62px) 26px;
}

.experience__glow {
  position: absolute;
  z-index: -1;
  top: 4%;
  left: 2%;
  width: 46%;
  height: 66%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 164, 93, 0.13), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.dh-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.dh-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 52% 22%, rgba(229, 201, 143, 0.25), transparent 32%),
    radial-gradient(circle at 82% 74%, rgba(145, 166, 142, 0.24), transparent 38%),
    linear-gradient(145deg, #235c48 0%, #174638 40%, #0d3329 73%, #09271f 100%);
  box-shadow:
    0 34px 80px -50px rgba(8, 38, 29, 0.85),
    inset 0 0 0 1px rgba(229, 201, 143, 0.18);
}

.dh-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 12%;
  left: 50%;
  width: min(78%, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(238, 217, 171, 0.17), rgba(238, 217, 171, 0.03) 58%, transparent 69%);
  transform: translateX(-50%);
}

.dh-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 47%;
  background: linear-gradient(to top, rgba(5, 28, 21, 0.94) 0%, rgba(6, 30, 23, 0.58) 45%, transparent 100%);
  pointer-events: none;
}

.stage-ring {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 34%;
  border-radius: 50%;
  border: 1px solid rgba(205, 164, 93, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.stage-ring--one {
  width: 76%;
  aspect-ratio: 1;
}

.stage-ring--two {
  width: 94%;
  aspect-ratio: 1;
  border-style: dashed;
  border-color: rgba(205, 164, 93, 0.17);
  animation: slowSpin 70s linear infinite;
}

.stage-ring--three {
  top: 36%;
  width: 55%;
  aspect-ratio: 1;
  border-color: rgba(250, 249, 245, 0.08);
}

.stage-botanical {
  position: absolute;
  z-index: 1;
  color: rgba(205, 164, 93, 0.48);
  pointer-events: none;
}

.stage-botanical--left {
  left: -24px;
  bottom: 10%;
  width: 160px;
  height: 280px;
  opacity: 0.55;
  transform: rotate(-7deg);
}

.stage-botanical--left svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.stage-grain {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.7) 0.55px, transparent 0.55px),
    radial-gradient(rgba(0, 0, 0, 0.5) 0.55px, transparent 0.55px);
  background-size: 4px 4px, 5px 5px;
  background-position: 0 0, 2px 3px;
}

.stage-topline {
  position: absolute;
  z-index: 6;
  top: 18px;
  left: 20px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(250, 249, 245, 0.2);
  border-radius: 999px;
  background: rgba(7, 35, 27, 0.28);
  color: rgba(250, 249, 245, 0.92);
  font-size: 10px;
  letter-spacing: 0.12em;
  backdrop-filter: blur(12px);
}

.live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a9d5b4;
  box-shadow: 0 0 0 4px rgba(169, 213, 180, 0.12);
  animation: livePulse 2.8s ease-in-out infinite;
}

.stage-topline__right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(250, 249, 245, 0.1);
  color: rgba(250, 249, 245, 0.57);
  font-family: "Georgia", serif;
  font-size: 8px;
  letter-spacing: 0.15em;
}

.stage-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(250, 249, 245, 0.18);
  border-radius: 50%;
  background: rgba(7, 35, 27, 0.28);
  color: rgba(250, 249, 245, 0.92);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.stage-icon-btn svg {
  width: 15px;
  height: 15px;
}

.stage-icon-btn:hover {
  background: rgba(250, 249, 245, 0.14);
  border-color: rgba(229, 201, 143, 0.55);
  transform: translateY(-1px);
}

.stage-close-btn {
  display: none;
}

.character-viewport {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  perspective: 1000px;
  perspective-origin: 50% 42%;
}

/* 每一层只负责一种运动，避免多个动画争抢同一个 transform。 */
.character-breathing {
  position: absolute;
  inset: 0;
  transform-origin: 50% 88%;
  animation: characterBreathe 3.6s ease-in-out infinite;
  will-change: transform;
}

.character-parallax {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.character-gesture {
  position: absolute;
  inset: 0;
  transform-origin: 50% 78%;
  transition: transform 540ms cubic-bezier(0.22, 0.8, 0.3, 1);
  will-change: transform;
}

.character-expression {
  position: absolute;
  inset: 0;
}

:is(.character-layer, .character-gaze) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  pointer-events: none;
}

.character-gaze {
  z-index: 3;
}

.character-layer {
  opacity: 0;
  transition: opacity var(--character-crossfade-ms, 400ms) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
  filter: drop-shadow(0 18px 24px rgba(5, 25, 19, 0.18));
  user-select: none;
  -webkit-user-drag: none;
}

.character-layer.is-visible {
  opacity: 1;
}

.character-layered,
.character-head-motion,
.character-head {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.character-layered { z-index: 2; }
.character-layer--part { filter: none; transition: none; }
.dh-stage[data-layered] #characterLayerA { opacity: 0; }
.character-head-motion,
.character-head { transform-origin: 50% 31%; }

@media (prefers-reduced-motion: no-preference) {
  .dh-stage[data-speaking] .character-head {
    animation: characterSpeechNod 4.4s ease-in-out infinite;
  }
}

@keyframes characterSpeechNod {
  0%, 100% { transform: rotateX(0); }
  28% { transform: translateY(.28%) rotateX(-3deg) rotate(.65deg); }
  61% { transform: translateY(-.12%) rotateX(1deg) rotate(-.28deg); }
}

.character-layer.is-entering {
  filter: drop-shadow(0 18px 24px rgba(5, 25, 19, 0.18));
}

/* 旧图在淡出时轻微虚化：仍然是同一张真实表情图，但能显著削弱
   交叉淡化瞬间的“双脸/四只眼睛”观感。只持续 400ms，不作用于稳定画面。 */
.character-layer.is-leaving {
  filter: blur(2.2px) saturate(0.94) drop-shadow(0 18px 24px rgba(5, 25, 19, 0.18));
}

.character-shadow {
  position: absolute;
  z-index: 2;
  bottom: 5%;
  left: 50%;
  width: 56%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(2, 20, 15, 0.48), transparent 70%);
  filter: blur(6px);
  transform: translateX(-50%);
  pointer-events: none;
}

/* 情绪动作：动作幅度刻意小于“整图晃动”的阈值，呼吸层始终独立运行。 */
.dh-stage[data-state="idle"] .character-gesture {
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.dh-stage[data-state="thinking"] .character-gesture {
  transform: translate3d(0, 3px, 0) rotate(-0.55deg);
}

.dh-stage[data-state="uncertain"] .character-gesture {
  transform: translate3d(1px, 2px, 0) rotate(-0.65deg);
}

.dh-stage[data-state="talking"] .character-gesture {
  animation: characterTalk 5.4s ease-in-out infinite;
}

.dh-stage[data-state="welcome"] .character-gesture {
  animation: characterWelcome 1.5s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.dh-stage[data-state="happy"] .character-gesture {
  animation: characterHappy 620ms cubic-bezier(0.22, 0.9, 0.28, 1.12) both;
}

.dh-stage.dh-stage--eyes-only :is(.character-breathing, .character-gesture, .stage-sparkles i) {
  animation: none;
  transform: none;
}

.dh-stage.is-page-hidden .character-breathing,
.dh-stage.is-page-hidden .character-gesture {
  animation-play-state: paused;
}

.stage-sparkles {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.stage-sparkles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 14px rgba(229, 201, 143, 0.75);
  opacity: 0;
}

.stage-sparkles i:nth-child(1) {
  top: 25%;
  left: 17%;
}

.stage-sparkles i:nth-child(2) {
  top: 37%;
  right: 14%;
  width: 3px;
  height: 3px;
}

.stage-sparkles i:nth-child(3) {
  top: 48%;
  left: 9%;
  width: 3px;
  height: 3px;
}

.stage-sparkles i:nth-child(4) {
  top: 20%;
  right: 27%;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  transform: rotate(45deg);
}

.stage-sparkles i:nth-child(5) {
  top: 58%;
  right: 9%;
  width: 4px;
  height: 4px;
}

.dh-stage[data-state="welcome"] .stage-sparkles i,
.dh-stage[data-state="happy"] .stage-sparkles i {
  animation: sparkle 1.8s ease-in-out infinite;
}

.dh-stage[data-state="welcome"] .stage-sparkles i:nth-child(2),
.dh-stage[data-state="happy"] .stage-sparkles i:nth-child(2) {
  animation-delay: 0.25s;
}

.dh-stage[data-state="welcome"] .stage-sparkles i:nth-child(3),
.dh-stage[data-state="happy"] .stage-sparkles i:nth-child(3) {
  animation-delay: 0.55s;
}

.dh-stage[data-state="welcome"] .stage-sparkles i:nth-child(4),
.dh-stage[data-state="happy"] .stage-sparkles i:nth-child(4) {
  animation-delay: 0.8s;
}

.dh-stage[data-state="welcome"] .stage-sparkles i:nth-child(5),
.dh-stage[data-state="happy"] .stage-sparkles i:nth-child(5) {
  animation-delay: 1.05s;
}

.stage-hud {
  position: absolute;
  z-index: 5;
  left: 27px;
  right: 26px;
  bottom: 24px;
  pointer-events: none;
  isolation: isolate;
}

.stage-hud::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -38px;
  right: -38px;
  bottom: -34px;
  height: calc(100% + 94px);
  border-radius: 24px 24px 0 0;
  background: linear-gradient(
    to top,
    rgba(4, 25, 18, 0.9) 0%,
    rgba(4, 25, 18, 0.72) 36%,
    rgba(4, 25, 18, 0.32) 68%,
    transparent 100%
  );
  filter: blur(5px);
  opacity: 0.98;
}

.stage-kicker {
  margin: 0 0 8px;
  color: rgba(229, 201, 143, 0.92);
  font-size: 9.5px;
  letter-spacing: 0.28em;
}

.stage-hud h1 {
  margin: 0;
  max-width: 80%;
  color: #f8f2e4;
  font-family: var(--serif);
  font-size: clamp(31px, 3.2vw, 46px);
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 3px rgba(2, 20, 15, 0.5), 0 14px 34px rgba(2, 20, 15, 0.45);
}

.stage-hud h1 em {
  color: var(--gold-2);
  font-style: normal;
}

.stage-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  color: rgba(250, 249, 245, 0.74);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.stage-status strong {
  color: #fffdf7;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(229, 201, 143, 0.12);
  transition: background 0.25s ease;
}

.dh-stage[data-state="thinking"] .status-dot {
  background: #d8b46f;
  animation: livePulse 1.3s ease-in-out infinite;
}

.dh-stage[data-state="uncertain"] .status-dot {
  background: #d2b38a;
}

.dh-stage[data-state="talking"] .status-dot {
  background: #a9d5b4;
}

.status-sep {
  width: 1px;
  height: 10px;
  background: rgba(250, 249, 245, 0.25);
}

.tap-hint {
  position: absolute;
  z-index: 6;
  right: 22px;
  top: 62px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 235px;
  padding: 9px 13px;
  border: 1px solid rgba(250, 249, 245, 0.2);
  border-radius: 999px;
  background: rgba(7, 35, 27, 0.34);
  color: rgba(250, 249, 245, 0.82);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tap-hint:hover {
  background: rgba(250, 249, 245, 0.12);
  border-color: rgba(229, 201, 143, 0.5);
  transform: translateY(-2px);
}

.tap-hint__icon {
  color: var(--gold-2);
  font-size: 10px;
  animation: twinkle 2.6s ease-in-out infinite;
}

.speech-bars {
  position: absolute;
  z-index: 6;
  right: 24px;
  bottom: 70px;
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 21px;
}

.speech-bars i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 3px;
  background: var(--gold-2);
  animation: bar 1s ease-in-out infinite;
}

.speech-bars i:nth-child(2) {
  animation-delay: 0.12s;
}

.speech-bars i:nth-child(3) {
  animation-delay: 0.24s;
}

.speech-bars i:nth-child(4) {
  animation-delay: 0.36s;
}

.speech-bars i:nth-child(5) {
  animation-delay: 0.48s;
}

.dh-stage[data-state="talking"] .speech-bars {
  display: flex;
}

.dh-stage[data-state="thinking"] .speech-bars {
  display: none;
}

.stage-focus-bar {
  display: none;
}

/* --------------------------------------------------------------------------
   Chat
   -------------------------------------------------------------------------- */

.chat-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 70, 56, 0.12);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 4%, rgba(205, 164, 93, 0.09), transparent 28%),
    rgba(255, 254, 250, 0.9);
  box-shadow: var(--shadow-chat);
  backdrop-filter: blur(12px);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
}

.chat-head__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(205, 164, 93, 0.65);
  border-radius: 50%;
  background: var(--green);
  color: var(--gold-2);
  box-shadow: inset 0 0 0 3px rgba(250, 249, 245, 0.08);
}

.chat-avatar svg {
  width: 24px;
  height: 24px;
}

.chat-eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-family: "Georgia", serif;
  font-size: 7px;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.chat-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.chat-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.mode-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.mode-badge[data-mode="demo"] {
  border-color: rgba(183, 131, 53, 0.25);
  background: rgba(205, 164, 93, 0.1);
  color: #896227;
}

.mode-badge[data-mode="demo"] i {
  background: var(--amber);
}

.mode-badge[data-mode="deepseek"] {
  border-color: rgba(23, 70, 56, 0.18);
  background: rgba(145, 166, 142, 0.12);
  color: var(--green);
}

.mode-badge[data-mode="deepseek"] i {
  background: #5d9a70;
  box-shadow: 0 0 0 3px rgba(93, 154, 112, 0.13);
}

.mode-badge[data-mode="loading"] i {
  animation: livePulse 1.4s ease-in-out infinite;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.icon-text-btn:hover {
  background: rgba(23, 70, 56, 0.06);
  color: var(--green);
}

#autoRead[aria-pressed="true"], #focusChat[aria-expanded="true"] {
  background: var(--sage-soft);
  color: var(--green-deep);
}

.icon-text-btn svg {
  width: 13px;
  height: 13px;
}

.mode-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  margin: 0;
  padding: 9px 24px;
  border-bottom: 1px solid rgba(183, 131, 53, 0.18);
  background: rgba(205, 164, 93, 0.11);
  color: #79571f;
  font-size: 10.5px;
  line-height: 1.5;
}

.mode-notice__dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--amber);
}

.mode-notice p {
  margin: 0;
}

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 24px 8px;
  scroll-behavior: smooth;
  scrollbar-color: rgba(23, 70, 56, 0.25) transparent;
  scrollbar-width: thin;
}

.chat-log::-webkit-scrollbar {
  width: 6px;
}

.chat-log::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(23, 70, 56, 0.18);
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: rgba(116, 128, 120, 0.75);
  font-size: 9px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.day-divider::before,
.day-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 19px;
  animation: messageIn 0.34s var(--ease-out) both;
}

.message--user {
  flex-direction: row-reverse;
  padding-left: 14%;
}

.message__avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  margin-top: 2px;
  border: 1px solid rgba(205, 164, 93, 0.45);
  border-radius: 50%;
  background: var(--ivory-2);
  color: var(--gold);
}

.message__avatar svg {
  width: 17px;
  height: 17px;
}

.message__content {
  max-width: 86%;
  min-width: 0;
}

.message--user .message__content {
  max-width: 78%;
}

.bubble {
  padding: 12px 16px;
  border: 1px solid rgba(23, 70, 56, 0.1);
  border-radius: 4px 17px 17px 17px;
  background: #fffefa;
  box-shadow: 0 10px 24px -26px rgba(10, 45, 34, 0.4);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.bubble p {
  margin: 0 0 7px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble__text {
  white-space: pre-line;
}

.message__warning {
  flex: 1 0 100%;
  margin: 2px 0 0;
  padding: 6px 9px;
  border-left: 2px solid rgba(183, 131, 53, 0.55);
  background: rgba(205, 164, 93, 0.08);
  color: #7c5b27;
  font-size: 8.5px;
  line-height: 1.6;
}

.mode-mini {
  color: rgba(116, 128, 120, 0.7);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.bubble__question {
  color: var(--green);
  font-weight: 500;
}

.message--user .bubble {
  border: 0;
  border-radius: 17px 4px 17px 17px;
  background: var(--green);
  color: #fbf8ef;
  box-shadow: 0 14px 30px -24px rgba(9, 45, 33, 0.8);
}

.message--user .message__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 22px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.message--user .message__meta {
  justify-content: flex-end;
}

.message__time {
  color: rgba(116, 128, 120, 0.7);
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(23, 70, 56, 0.14);
  border-radius: 999px;
  background: rgba(145, 166, 142, 0.1);
  color: #4e725c;
  font-size: 8.5px;
  letter-spacing: 0.03em;
  cursor: default;
}

button.source-pill {
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

button.source-pill:hover {
  border-color: rgba(23, 70, 56, 0.3);
  background: rgba(145, 166, 142, 0.2);
}

.source-pill--verified {
  border-color: rgba(78, 114, 92, 0.25);
  background: rgba(145, 166, 142, 0.16);
  color: #3f6b51;
}

.source-pill--concept {
  border-color: rgba(183, 131, 53, 0.25);
  background: rgba(205, 164, 93, 0.1);
  color: #896227;
}

.source-pill--insufficient,
.source-pill--error {
  border-color: rgba(160, 75, 53, 0.22);
  background: rgba(160, 75, 53, 0.07);
  color: #91533f;
}

.source-pill--conversation {
  border-color: rgba(23, 70, 56, 0.12);
  background: rgba(23, 70, 56, 0.04);
  color: var(--muted);
}

.read-aloud {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.read-aloud:hover {
  color: var(--green);
}

.read-aloud svg {
  width: 12px;
  height: 12px;
}

.read-aloud.is-speaking {
  color: var(--green);
}

.read-aloud.is-speaking svg {
  animation: livePulse 1s ease-in-out infinite;
}

.message--error .bubble {
  border-color: rgba(160, 75, 53, 0.2);
  background: #fdf5ee;
}

.message--error .retry-question {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(160, 75, 53, 0.2);
  border-radius: 999px;
  background: transparent;
  color: #91533f;
  font-size: 10px;
  cursor: pointer;
}

.message--typing .bubble {
  padding: 15px 17px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 10px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
  animation: typing 1.25s ease-in-out infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.chat-context-card {
  margin: 2px 0 14px 41px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(23, 70, 56, 0.1);
  border-radius: 13px;
  background:
    radial-gradient(circle at 90% 10%, rgba(205, 164, 93, 0.1), transparent 40%),
    rgba(244, 240, 229, 0.52);
}

.chat-context-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.09em;
}

.context-verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4e725c;
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.context-verified i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #619d75;
}

.chat-context-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 11px;
  border-top: 1px solid rgba(23, 70, 56, 0.09);
  border-bottom: 1px solid rgba(23, 70, 56, 0.09);
}

.chat-context-card__stats > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 10px 8px 0;
  border-right: 1px solid rgba(23, 70, 56, 0.09);
}

.chat-context-card__stats > div:not(:first-child) {
  padding-left: 12px;
}

.chat-context-card__stats > div:last-child {
  border-right: 0;
}

.chat-context-card__stats strong {
  color: var(--green);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.chat-context-card__stats strong small {
  margin-left: 2px;
  color: var(--gold);
  font-size: 10px;
}

.chat-context-card__stats span {
  color: var(--muted);
  font-size: 8px;
}

.chat-context-card > p {
  margin: 8px 0 0;
  color: rgba(116, 128, 120, 0.74);
  font-size: 8px;
  line-height: 1.5;
}

.chat-topics {
  margin: 0 0 14px 41px;
}

.chat-topics__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.09em;
}

.chat-topics__head span:last-child {
  color: rgba(116, 128, 120, 0.55);
  font-size: 7.5px;
}

.chat-topics__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chat-topics__grid button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 70px;
  padding: 8px 9px 7px;
  border: 1px solid rgba(23, 70, 56, 0.11);
  border-radius: 11px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.chat-topics__grid button:hover {
  border-color: rgba(205, 164, 93, 0.55);
  background: #fffefa;
  transform: translateY(-2px);
}

.chat-topics__no {
  margin-bottom: 7px;
  color: var(--gold);
  font-family: "Georgia", serif;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.chat-topics__grid strong {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
}

.chat-topics__grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.chat-boundary-note {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px 41px;
  color: var(--muted);
}

.chat-boundary-note__line {
  width: 18px;
  height: 1px;
  flex: 0 0 18px;
  margin-top: 8px;
  background: var(--gold);
  opacity: 0.55;
}

.chat-boundary-note p {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.65;
}

.chat-boundary-note strong {
  color: var(--green);
  font-weight: 500;
}

@media (min-height: 981px) and (min-width: 761px) {
  .chat-boundary-note {
    display: flex;
  }
}

.prompt-area {
  flex: 0 0 auto;
  padding: 10px 24px 0;
  border-top: 1px solid rgba(23, 70, 56, 0.08);
  background: linear-gradient(to top, rgba(255, 254, 250, 0.96), rgba(255, 254, 250, 0.55));
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.prompt-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.11em;
}

.prompt-toggle {
  padding: 1px 0;
  border: 0;
  background: transparent;
  color: rgba(116, 128, 120, 0.75);
  font-size: 9px;
  cursor: pointer;
}

.prompt-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.prompt-rail::-webkit-scrollbar {
  display: none;
}

.prompt-chip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex: 0 0 auto;
  width: 184px;
  min-height: 49px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 249, 245, 0.62);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.prompt-chip:hover {
  border-color: rgba(205, 164, 93, 0.55);
  background: #fffefa;
  color: var(--green);
  transform: translateY(-2px);
}

.prompt-chip__no {
  flex: 0 0 auto;
  color: var(--gold);
  font-family: "Georgia", serif;
  font-size: 8px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.prompt-area.is-collapsed .prompt-rail {
  display: none;
}

.prompt-area.is-collapsed {
  padding-bottom: 0;
}

.composer {
  flex: 0 0 auto;
  padding: 8px 24px 15px;
  background: rgba(255, 254, 250, 0.85);
}

.composer__box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 14px;
  border: 1px solid rgba(23, 70, 56, 0.18);
  border-radius: 17px;
  background: #fffefa;
  box-shadow: 0 12px 28px -32px rgba(10, 45, 34, 0.5);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.composer__box:focus-within {
  border-color: rgba(23, 70, 56, 0.54);
  box-shadow: 0 0 0 4px rgba(23, 70, 56, 0.06);
}

.composer textarea {
  width: 100%;
  min-height: 37px;
  max-height: 118px;
  padding: 7px 0 5px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: rgba(116, 128, 120, 0.72);
}

.send-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: var(--paper);
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.send-btn svg {
  width: 20px;
  height: 20px;
  transform: translate(-1px, 1px);
}

.send-btn:hover:not(:disabled) {
  background: var(--green-2);
  transform: translateY(-1px);
}

.send-btn:disabled {
  background: rgba(23, 70, 56, 0.13);
  color: rgba(23, 70, 56, 0.35);
  cursor: not-allowed;
}

.send-btn.is-loading svg {
  display: none;
}

.send-btn.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(250, 249, 245, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.composer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 3px 0;
  color: rgba(116, 128, 120, 0.7);
  font-size: 8.5px;
  line-height: 1.5;
}

.composer__meta p {
  margin: 0;
}

.composer__policy {
  text-align: right;
}

.chat-focus-bar {
  display: none;
}

/* --------------------------------------------------------------------------
   Story
   -------------------------------------------------------------------------- */

.section {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(70px, 9vw, 128px) clamp(22px, 6vw, 92px);
}

.story-section.section {
  padding-bottom: clamp(24px, 4vw, 52px);
}

.archive-video.section {
  padding-block: 0 clamp(36px, 5vw, 66px);
}

.archive-video__frame {
  display: block;
  width: min(100%, 900px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin-inline: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--ivory-2);
  object-fit: contain;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.section-kicker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(205, 164, 93, 0.55);
  border-radius: 50%;
  font-family: "Georgia", serif;
  font-size: 8px;
  letter-spacing: 0;
}

.section-kicker--light {
  color: var(--gold-2);
}

.story-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: end;
  gap: clamp(32px, 6vw, 90px);
  margin-bottom: 54px;
}

.story-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 64px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.story-head h2 span {
  color: var(--gold);
}

.nowrap {
  white-space: nowrap;
}

.mobile-break {
  display: none;
}

.story-head p {
  max-width: 420px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.95;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.stat-card {
  min-height: 230px;
  padding: 25px 22px 24px;
  border-right: 1px solid var(--line);
  background: transparent;
  transition: background 0.28s ease;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card:hover {
  background: rgba(255, 254, 250, 0.65);
}

.stat-card strong {
  display: block;
  color: var(--green);
  font-family: var(--serif);
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card strong small {
  margin-left: 4px;
  color: var(--gold);
  font-size: 20px;
  letter-spacing: 0;
}

.stat-card > span {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.stat-card p {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.stat-card--gold {
  background: rgba(205, 164, 93, 0.08);
}

.stat-card--gold strong {
  color: var(--gold);
}

.stat-card--green {
  background: var(--green);
  color: var(--paper);
}

.stat-card--green strong,
.stat-card--green > span {
  color: var(--paper);
}

.stat-card--green p {
  color: rgba(250, 249, 245, 0.68);
}

.stat-card--green:hover {
  background: var(--green-2);
}

.story-quote {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 44px;
  padding: 24px 0 0;
}

.story-quote > svg {
  width: 34px;
  height: 34px;
  color: var(--sage);
}

.story-quote blockquote {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.7;
}

.story-quote p {
  margin: 0;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Gift
   -------------------------------------------------------------------------- */

.gift-section {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(36px, 5vw, 72px);
  max-width: 1520px;
  padding: clamp(58px, 7.5vw, 108px) clamp(30px, 6vw, 90px);
  border-radius: 38px;
  background:
    radial-gradient(circle at 84% 17%, rgba(205, 164, 93, 0.18), transparent 30%),
    radial-gradient(circle at 10% 86%, rgba(145, 166, 142, 0.17), transparent 33%),
    linear-gradient(145deg, #1a4f3d 0%, #123d30 50%, #0a2a21 100%);
  color: var(--paper);
  box-shadow: 0 40px 90px -60px rgba(9, 37, 29, 0.85);
  overflow: hidden;
}

.gift-copy h2 {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(34px, 3.75vw, 58px);
  font-weight: 500;
  line-height: 1.25;
}

.gift-copy h2 span {
  color: var(--gold-2);
}

.gift-copy > p {
  max-width: 460px;
  margin: 0;
  color: rgba(250, 249, 245, 0.7);
  font-size: 13.5px;
  line-height: 1.95;
}

.gift-notes {
  display: grid;
  gap: 0;
  margin: 30px 0 27px;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(250, 249, 245, 0.14);
}

.gift-notes li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(250, 249, 245, 0.14);
  color: rgba(250, 249, 245, 0.73);
  font-size: 11.5px;
  line-height: 1.7;
}

.gift-notes li span {
  color: var(--gold-2);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.gift-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 480px;
  padding: 12px 14px;
  border: 1px solid rgba(205, 164, 93, 0.22);
  border-radius: 10px;
  background: rgba(205, 164, 93, 0.07);
}

.gift-status span {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--gold);
  color: var(--green-deep);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.gift-status p {
  margin: 0;
  color: rgba(250, 249, 245, 0.58);
  font-size: 9.5px;
  line-height: 1.6;
}

.gift-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

.gift-orbit {
  position: absolute;
  border: 1px solid rgba(205, 164, 93, 0.22);
  border-radius: 50%;
}

.gift-orbit--one {
  width: 82%;
  aspect-ratio: 1;
  border-style: dashed;
  animation: slowSpin 80s linear infinite reverse;
}

.gift-orbit--two {
  width: 61%;
  aspect-ratio: 1;
}

.gift-box {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  height: auto;
  overflow: visible;
  animation: giftFloat 7s ease-in-out infinite;
}

.gift-tag {
  position: absolute;
  z-index: 3;
  right: 3%;
  bottom: 9%;
  padding: 10px 12px;
  border: 1px solid rgba(250, 249, 245, 0.22);
  border-radius: 8px;
  background: rgba(9, 37, 29, 0.58);
  color: rgba(250, 249, 245, 0.82);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.gift-tag span {
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

/* --------------------------------------------------------------------------
   NFC
   -------------------------------------------------------------------------- */

.nfc-section {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: clamp(34px, 5vw, 80px);
}

.nfc-copy h2 {
  margin: 0 0 23px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.5vw, 60px);
  font-weight: 500;
  line-height: 1.23;
}

.nfc-copy h2 span {
  color: var(--gold);
}

.nfc-copy > p {
  max-width: 490px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.95;
}

.nfc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.24s ease, color 0.24s ease, border-color 0.24s ease, transform 0.24s ease;
}

.button svg {
  width: 15px;
  height: 15px;
}

.button--primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--paper);
}

.button--primary:hover {
  background: var(--green-2);
  border-color: var(--green-2);
  transform: translateY(-2px);
}

.button--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--green);
}

.button--ghost:hover {
  border-color: var(--gold);
  background: rgba(205, 164, 93, 0.08);
  transform: translateY(-2px);
}

.button--large {
  min-height: 50px;
  padding: 0 24px;
  font-size: 12.5px;
}

.nfc-note {
  min-height: 18px;
  margin-top: 14px !important;
  color: var(--muted) !important;
  font-size: 9.5px !important;
}

.nfc-visual {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nfc-card {
  position: absolute;
  z-index: 2;
  top: 15%;
  left: 2%;
  width: min(74%, 380px);
  aspect-ratio: 1.58;
  padding: 21px 23px;
  border: 1px solid rgba(229, 201, 143, 0.35);
  border-radius: 17px;
  background:
    radial-gradient(circle at 77% 27%, rgba(205, 164, 93, 0.22), transparent 32%),
    linear-gradient(145deg, #205944, #0c3328);
  color: var(--paper);
  box-shadow: 0 24px 50px -28px rgba(9, 37, 29, 0.65);
  transform: rotate(-8deg);
  overflow: hidden;
}

.nfc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(229, 201, 143, 0.3) 0.6px, transparent 0.6px);
  background-size: 9px 9px;
  opacity: 0.16;
  pointer-events: none;
}

.nfc-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nfc-card__brand {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.15em;
}

.nfc-card__type {
  color: rgba(250, 249, 245, 0.5);
  font-family: "Georgia", serif;
  font-size: 6px;
  letter-spacing: 0.14em;
}

.nfc-waves {
  position: absolute;
  top: 28%;
  left: 50%;
  width: 80px;
  height: 80px;
  color: var(--gold-2);
  opacity: 0.85;
  transform: translateX(-50%);
}

.nfc-card__bottom {
  position: absolute;
  left: 23px;
  right: 23px;
  bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: rgba(250, 249, 245, 0.42);
  font-family: "Georgia", serif;
  font-size: 5.5px;
  letter-spacing: 0.15em;
}

.phone-mock {
  position: relative;
  z-index: 3;
  width: min(39%, 212px);
  aspect-ratio: 0.52;
  margin-left: 43%;
  padding: 6px;
  border: 1px solid rgba(23, 70, 56, 0.22);
  border-radius: 30px;
  background: #f8f4e9;
  box-shadow: 0 36px 60px -34px rgba(9, 37, 29, 0.62);
  transform: rotate(4deg);
}

.phone-mock__speaker {
  position: absolute;
  z-index: 4;
  top: 11px;
  left: 50%;
  width: 35%;
  height: 9px;
  border-radius: 10px;
  background: #0e3228;
  transform: translateX(-50%);
}

.phone-mock__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 25px;
  background: var(--ivory);
}

.phone-mock__mini-head {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 8px;
  background: var(--green);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.mini-seal {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(205, 164, 93, 0.7);
  border-radius: 4px;
  color: var(--gold-2);
  font-size: 7px;
}

.phone-mock__portrait {
  position: relative;
  height: 57%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(205, 164, 93, 0.22), transparent 45%),
    linear-gradient(160deg, #225c46, #0c3026);
}

.phone-mock__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 5%;
  transform: scale(1.28);
  transform-origin: 50% 15%;
}

.phone-mock__line {
  margin: 9px 9px 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 8px;
  line-height: 1.6;
}

.phone-mock__button {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  padding: 6px 0;
  border-radius: 6px;
  background: var(--green);
  color: var(--paper);
  font-size: 6.5px;
  text-align: center;
  letter-spacing: 0.1em;
}

.nfc-ripple {
  position: absolute;
  z-index: 1;
  top: 27%;
  left: 28%;
  width: 260px;
  height: 260px;
  pointer-events: none;
}

.nfc-ripple i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(205, 164, 93, 0.22);
  border-radius: 50%;
  animation: nfcRipple 4s ease-out infinite;
}

.nfc-ripple i:nth-child(2) {
  animation-delay: 1.2s;
}

.nfc-ripple i:nth-child(3) {
  animation-delay: 2.4s;
}

/* --------------------------------------------------------------------------
   Closing / footer
   -------------------------------------------------------------------------- */

.closing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(60px, 8vw, 110px);
  padding-bottom: clamp(70px, 9vw, 130px);
}

.closing-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  border: 1px solid rgba(205, 164, 93, 0.55);
  border-radius: 50%;
  color: var(--gold);
}

.closing-mark svg {
  width: 31px;
  height: 31px;
}

.closing-kicker {
  margin: 0 0 18px;
  color: var(--gold);
  font-family: "Georgia", serif;
  font-size: 8px;
  letter-spacing: 0.25em;
}

.closing-section h2 {
  margin: 0 0 30px;
  font-family: var(--serif);
  font-size: clamp(31px, 4.4vw, 57px);
  font-weight: 500;
  line-height: 1.35;
}

.closing-section h2 em {
  color: var(--gold);
  font-style: normal;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: 36px;
  padding: 46px clamp(24px, 6vw, 92px) 24px;
  border-top: 1px solid var(--line);
  background: rgba(244, 240, 229, 0.55);
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-brand strong {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.footer-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.footer-meta {
  justify-self: end;
  max-width: 700px;
  text-align: right;
}

.footer-meta p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.8;
}

.footer-meta a {
  color: var(--green);
  border-bottom: 1px solid rgba(23, 70, 56, 0.22);
}

.footer-meta a:hover {
  border-bottom-color: var(--gold);
}

.footer-meta span {
  margin: 0 6px;
  color: rgba(116, 128, 120, 0.42);
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: rgba(116, 128, 120, 0.72);
  font-size: 8px;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Dialogs / toast
   -------------------------------------------------------------------------- */

.source-dialog {
  width: min(560px, calc(100vw - 30px));
  max-height: min(76vh, 700px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(205, 164, 93, 0.4);
  border-radius: 23px;
  background: var(--ivory);
  color: var(--ink);
  box-shadow: 0 40px 100px -35px rgba(5, 30, 22, 0.68);
  overflow: hidden;
}

.source-dialog::backdrop {
  background: rgba(6, 31, 24, 0.62);
  backdrop-filter: blur(5px);
}

.source-dialog[open] {
  animation: dialogIn 0.3s var(--ease-out);
}

.source-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 25px 17px;
  border-bottom: 1px solid var(--line);
}

.source-dialog__head p {
  margin: 0 0 4px;
  color: var(--gold);
  font-family: "Georgia", serif;
  font-size: 7px;
  letter-spacing: 0.22em;
}

.source-dialog__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.dialog-close svg {
  width: 14px;
  height: 14px;
}

.source-list {
  max-height: calc(76vh - 170px);
  overflow-y: auto;
  padding: 14px 25px 4px;
}

.source-card {
  display: block;
  margin-bottom: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
}

.source-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.source-card__meta span:first-child {
  color: var(--gold);
  font-family: "Georgia", serif;
  letter-spacing: 0.12em;
}

.source-card h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.source-card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green);
  font-size: 9px;
  border-bottom: 1px solid rgba(23, 70, 56, 0.2);
}

.source-card a:hover {
  border-bottom-color: var(--gold);
}

.source-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
}

.source-empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.source-dialog__foot {
  margin: 0;
  padding: 13px 25px 20px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border: 1px solid rgba(250, 249, 245, 0.18);
  border-radius: 999px;
  background: rgba(9, 37, 29, 0.92);
  color: var(--paper);
  font-size: 11px;
  text-align: center;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Focus modes
   -------------------------------------------------------------------------- */

body.is-locked {
  overflow: hidden;
}

.experience.is-stage-focus .dh-panel {
  position: fixed;
  z-index: 150;
  inset: 0;
  gap: 0;
  background: var(--green-deep);
}

.experience.is-stage-focus .dh-stage {
  border-radius: 0;
  box-shadow: none;
}

.experience.is-stage-focus #stageExpand {
  display: none;
}

.experience.is-stage-focus .stage-close-btn {
  display: grid;
}

.experience.is-stage-focus .stage-focus-bar {
  position: absolute;
  z-index: 8;
  right: 24px;
  top: 18px;
}

.experience.is-stage-focus .stage-topline {
  left: 20px;
  right: 72px;
}

.experience.is-chat-focus .dh-panel {
  display: none;
}

.experience.is-chat-focus {
  grid-template-columns: 1fr;
}

.experience.is-chat-focus .chat-shell {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
}

.experience.is-chat-focus .chat-focus-bar {
  display: none;
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */

@keyframes characterBreathe {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -2.5px, 0) scale(1.0025);
  }
}

@keyframes characterTalk {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  28% {
    transform: translate3d(0, -1.2px, 0) rotate(0.08deg);
  }
  55% {
    transform: translate3d(0, 0.4px, 0) rotate(-0.02deg);
  }
  78% {
    transform: translate3d(0, -0.6px, 0) rotate(0.04deg);
  }
}

@keyframes characterWelcome {
  0% {
    transform: translate3d(0, 8px, 0) scale(0.992);
  }
  45% {
    transform: translate3d(0, -4px, 0) scale(1.004);
  }
  75% {
    transform: translate3d(0, 0, 0) scale(1.001);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes characterHappy {
  0% {
    transform: translate3d(0, 5px, 0) scale(0.972);
  }
  55% {
    transform: translate3d(0, -3px, 0) scale(1.006);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes slowSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.82);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
    transform: translateY(4px) scale(0.6);
  }
  35% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  70% {
    opacity: 0.2;
    transform: translateY(-8px) scale(0.8);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.1) rotate(45deg);
  }
}

@keyframes bar {
  0%,
  100% {
    height: 5px;
    opacity: 0.45;
  }
  50% {
    height: 18px;
    opacity: 1;
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes giftFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(0.4deg);
  }
}

@keyframes nfcRipple {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  22% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 1181px) {
  .experience:not(.is-stage-focus) :is(.character-layer, .character-gaze) {
    object-fit: cover;
    object-position: 50% 9%;
  }
}

@media (max-width: 1180px) {
  :is(.character-layer, .character-gaze) {
    object-fit: cover;
    object-position: 50% 7%;
  }
}

@media (max-width: 1240px) {
  :root {
    --header-h: 70px;
  }

  .site-header {
    gap: 18px;
  }

  .header-place {
    display: none;
  }

  .experience {
    gap: 15px;
    padding-inline: clamp(14px, 2.6vw, 35px);
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  }

  .stage-hud {
    left: 22px;
    right: 20px;
    bottom: 20px;
  }

  .stage-hud h1 {
    font-size: clamp(30px, 3.1vw, 38px);
  }

  .tap-hint {
    right: 17px;
    top: 57px;
    max-width: 190px;
    font-size: 9.5px;
  }

  .speech-bars {
    right: 18px;
    bottom: 61px;
  }

  .chat-head {
    padding: 14px 19px;
  }

  .chat-log {
    padding-inline: 19px;
  }

  .prompt-area,
  .composer {
    padding-inline: 19px;
  }

  .chat-head h2 {
    font-size: 22px;
  }

  .mode-badge {
    padding: 0 8px;
    font-size: 8.5px;
  }

  .story-head {
    gap: 42px;
  }

  .gift-section {
    border-radius: 30px;
  }

  .gift-visual {
    min-height: 420px;
  }

  .nfc-visual {
    min-height: 450px;
  }
}

@media (max-width: 1020px) {
  .site-nav {
    gap: 20px;
  }

  .site-nav a {
    font-size: 12px;
  }

  .brand__text small {
    display: none;
  }

  .experience {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .dh-stage,
  .chat-shell {
    border-radius: 24px;
  }

  .stage-hud h1 {
    font-size: 32px;
  }

  .stage-status {
    font-size: 10px;
    gap: 6px;
  }

  .tap-hint {
    display: none;
  }

  .stage-hud {
    max-width: 85%;
  }

  .chat-head {
    gap: 10px;
  }

  .chat-head__actions {
    gap: 4px;
  }

  .icon-text-btn span {
    display: none;
  }

  .icon-text-btn {
    width: 30px;
    justify-content: center;
    padding: 0;
  }

  .mode-badge span {
    display: none;
  }

  .mode-badge {
    width: 26px;
    justify-content: center;
    padding: 0;
  }

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

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .story-head {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .story-head p {
    max-width: 520px;
  }

  .gift-section,
  .nfc-section {
    grid-template-columns: 1fr;
  }

  .gift-copy {
    order: 1;
  }

  .gift-visual {
    order: 2;
    min-height: 450px;
  }

  .gift-orbit--one {
    width: 58%;
  }

  .gift-orbit--two {
    width: 43%;
  }

  .gift-box {
    width: min(82%, 520px);
  }

  .nfc-visual {
    order: 2;
    min-height: 500px;
  }

  .nfc-card {
    left: 12%;
    width: min(60%, 380px);
  }

  .phone-mock {
    width: min(31%, 206px);
    margin-left: 44%;
  }

  .nfc-ripple {
    left: 34%;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 58px;
  }

  html {
    scroll-padding-top: 70px;
  }

  body {
    font-size: 15px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    height: var(--header-h);
    padding: 0 14px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand__seal {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 9px;
    font-size: 17px;
  }

  .brand__text strong {
    font-size: 17px;
    letter-spacing: 0.1em;
  }

  .site-nav {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .header-cta {
    height: 34px;
    padding: 0 13px;
    font-size: 11px;
  }

  .header-cta svg {
    width: 13px;
    height: 13px;
  }

  .experience {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    height: auto;
    min-height: 0;
    padding: 10px 12px 14px;
  }

  .experience__glow {
    display: none;
  }

  .dh-panel {
    display: block;
    min-height: 0;
  }

  .dh-stage {
    height: clamp(198px, 52vw, 250px);
    border-radius: 20px;
  }

  .experience:not(.is-stage-focus) .character-viewport {
    inset: 10px 2px 0 auto;
    width: 54%;
  }

  .stage-topline {
    top: 10px;
    left: 12px;
    right: 10px;
  }

  .live-badge {
    height: 25px;
    padding: 0 9px;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .model-badge,
  .stage-icon-btn {
    display: none;
  }

  .stage-topline__right #stageExpand {
    display: grid;
    width: 29px;
    height: 29px;
  }

  .stage-topline__right #stageExpand svg {
    width: 13px;
    height: 13px;
  }

  :is(.character-layer, .character-gaze) {
    object-fit: contain;
    object-position: 50% 100%;
  }

  .stage-hud {
    left: 15px;
    right: auto;
    bottom: 20px;
    max-width: 43%;
  }

  .experience:not(.is-stage-focus) .stage-hud::before {
    display: none;
  }

  .stage-kicker {
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.17em;
  }

  .stage-hud h1 {
    max-width: 100%;
    font-size: clamp(18px, 5vw, 24px);
    line-height: 1.3;
  }

  .stage-status {
    margin-top: 9px;
    font-size: 10px;
    gap: 5px;
  }

  .status-sep {
    display: none;
  }

  .stage-status #stateHint {
    display: none;
  }

  .speech-bars {
    right: 14px;
    bottom: 14px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }

  .stage-sparkles i:nth-child(1),
  .stage-sparkles i:nth-child(3) {
    display: none;
  }

  .chat-shell {
    border-radius: 20px;
    min-height: 0;
  }

  .chat-head {
    padding: 10px 13px;
    gap: 8px;
  }

  .chat-avatar {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  .chat-avatar svg {
    width: 19px;
    height: 19px;
  }

  .chat-eyebrow {
    font-size: 6px;
  }

  .chat-head h2 {
    font-size: 18px;
  }

  .chat-head__actions {
    gap: 2px;
  }

  .chat-head__actions .icon-text-btn {
    width: 28px;
    height: 28px;
  }

  .chat-head__actions .icon-text-btn svg {
    width: 13px;
    height: 13px;
  }

  .chat-head__actions :is(#focusChat, #autoRead) {
    width: 36px;
    height: 36px;
  }

  .mode-badge {
    display: none;
  }

  .mode-notice {
    padding: 7px 13px;
    font-size: 8.5px;
    line-height: 1.45;
  }

  .chat-log {
    overflow: visible;
    padding: 12px 13px 0;
  }

  .chat-shell:has(.message--user) .chat-log,
  .experience.is-chat-focus .chat-log {
    overflow-y: auto;
  }

  .experience:not(.is-chat-focus) .chat-shell:has(.message--user) .chat-log {
    max-height: clamp(180px, 48svh, 420px);
  }

  .day-divider {
    margin-bottom: 13px;
    font-size: 7.5px;
  }

  .message {
    gap: 7px;
    margin-bottom: 14px;
  }

  .message--user {
    padding-left: 8%;
  }

  .message__avatar {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .message__avatar svg {
    width: 14px;
    height: 14px;
  }

  .message__content {
    max-width: 90%;
  }

  .bubble {
    padding: 10px 12px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.65;
  }

  .message--user .bubble {
    border-radius: 14px 4px 14px 14px;
  }

  .message__meta {
    margin-top: 5px;
    gap: 6px;
    font-size: 8px;
  }

  .chat-context-card {
    margin: 0 0 8px;
    padding: 10px 11px 9px;
  }

  .chat-context-card__head {
    font-size: 10px;
  }

  .chat-context-card__stats {
    margin-top: 8px;
  }

  .chat-context-card__stats > div {
    padding: 7px 7px 6px 0;
  }

  .chat-context-card__stats > div:not(:first-child) {
    padding-left: 8px;
  }

  .chat-context-card__stats strong {
    font-size: 18px;
  }

  .chat-context-card__stats span {
    font-size: 9px;
  }

  .chat-context-card > p {
    font-size: 9px;
  }

  .source-pill {
    padding: 2px 7px;
    font-size: 7.5px;
  }

  .prompt-area {
    padding: 8px 13px 0;
  }

  .prompt-head {
    margin-bottom: 5px;
  }

  .prompt-head h3 {
    font-size: 8.5px;
  }

  .prompt-rail {
    padding-bottom: 7px;
    gap: 6px;
  }

  .prompt-chip {
    width: auto;
    min-height: 36px;
    padding: 7px 9px;
    font-size: 11px;
    gap: 5px;
  }

  .prompt-chip__no {
    display: none;
  }

  .composer {
    padding: 6px 13px 10px;
  }

  .composer__box {
    padding: 5px 5px 5px 11px;
    border-radius: 14px;
  }

  .composer textarea {
    min-height: 42px;
    padding: 8px 0;
    font-size: 16px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 10px;
  }

  .send-btn svg {
    width: 17px;
    height: 17px;
  }

  .composer__meta {
    padding-top: 4px;
    font-size: 7.5px;
  }

  .composer__meta p:first-child {
    display: none;
  }

  .composer__policy {
    text-align: left;
  }

  .chat-focus-bar {
    display: none;
  }

  .section {
    padding: 64px 20px;
  }

  .section-kicker {
    margin-bottom: 17px;
    font-size: 8px;
  }

  .story-head {
    margin-bottom: 34px;
  }

  .story-head h2 {
    font-size: clamp(30px, 9.4vw, 42px);
  }

  .story-head p {
    font-size: 13px;
    line-height: 1.85;
  }

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

  .stat-card {
    min-height: 184px;
    padding: 18px 14px;
  }

  .stat-card strong {
    font-size: 44px;
  }

  .stat-card > span {
    font-size: 10px;
  }

  .stat-card p {
    margin-top: 16px;
    font-size: 10.5px;
    line-height: 1.65;
  }

  .story-quote {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 13px;
    margin-top: 30px;
  }

  .story-quote p {
    grid-column: 2;
    white-space: normal;
  }

  .story-quote blockquote {
    font-size: 16px;
  }

  .gift-section,
  .nfc-section {
    gap: 20px;
    padding: 42px 22px;
    border-radius: 24px;
  }

  .gift-copy h2,
  .nfc-copy h2 {
    font-size: clamp(31px, 9vw, 42px);
  }

  .mobile-break {
    display: block;
    height: 0;
  }

  .gift-copy > p,
  .nfc-copy > p {
    font-size: 12.5px;
  }

  .gift-notes {
    margin: 24px 0 20px;
  }

  .gift-notes li {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    font-size: 10.5px;
  }

  .gift-visual {
    min-height: 350px;
    margin: 0 -8px;
  }

  .gift-box {
    width: min(95%, 430px);
  }

  .gift-tag {
    right: 0;
    bottom: 2%;
    font-size: 9px;
  }

  .nfc-actions {
    margin-top: 20px;
  }

  .button {
    min-height: 40px;
    padding: 0 15px;
    font-size: 10.5px;
  }

  .nfc-visual {
    min-height: 385px;
    margin: 0 -10px;
  }

  .nfc-card {
    top: 13%;
    left: 0;
    width: 69%;
    padding: 15px;
    border-radius: 13px;
  }

  .nfc-card__brand {
    font-size: 14px;
  }

  .nfc-waves {
    width: 55px;
    height: 55px;
  }

  .nfc-card__bottom {
    left: 15px;
    right: 15px;
    bottom: 12px;
    font-size: 4.5px;
  }

  .phone-mock {
    width: 34%;
    padding: 4px;
    border-radius: 22px;
    margin-left: 42%;
  }

  .phone-mock__screen {
    border-radius: 19px;
  }

  .nfc-ripple {
    left: 30%;
    top: 20%;
    width: 190px;
    height: 190px;
  }

  .closing-section h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 30px 20px 18px;
  }

  .footer-meta {
    justify-self: start;
    text-align: left;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .source-dialog {
    width: calc(100vw - 20px);
    max-height: 84vh;
    border-radius: 19px;
  }

  .source-dialog__head {
    padding: 18px 18px 13px;
  }

  .source-dialog__head h2 {
    font-size: 20px;
  }

  .source-list {
    padding: 12px 18px 2px;
  }

  .source-dialog__foot {
    padding: 11px 18px 16px;
  }

  .experience.is-stage-focus .stage-topline {
    top: 15px;
    left: 16px;
    right: 62px;
  }

  .experience.is-stage-focus .dh-stage {
    height: 100%;
  }

  .experience.is-stage-focus .stage-close-btn {
    display: grid;
  }

  .experience.is-stage-focus .stage-icon-btn {
    display: grid;
    width: 36px;
    height: 36px;
  }

  .experience.is-stage-focus .stage-hud {
    right: 13px;
    bottom: 28px;
    max-width: 86%;
  }

  .experience.is-stage-focus .stage-hud h1 {
    max-width: 100%;
    font-size: clamp(30px, 9vw, 39px);
  }

  .experience.is-stage-focus .stage-hud h1 br {
    display: block;
  }

  .experience.is-stage-focus .stage-hud h1 em::before {
    content: none;
  }

  .experience.is-stage-focus .stage-status {
    font-size: 10px;
  }

  .experience.is-stage-focus .stage-status #stateHint {
    display: inline;
  }

  .experience.is-stage-focus :is(.character-layer, .character-gaze) {
    object-position: 50% 12%;
  }

  .experience.is-stage-focus .stage-focus-bar {
    display: none;
  }

  .experience.is-chat-focus {
    grid-template-rows: minmax(0, 1fr);
    height: calc(100dvh - var(--header-h));
  }

  .experience.is-chat-focus .chat-shell {
    border-radius: 20px;
  }

}

@media (max-width: 420px) {
  .experience {
    padding-inline: 10px;
  }

  .chat-head h2 {
    font-size: 17px;
  }

  .chat-head__actions .icon-text-btn {
    width: 26px;
  }

}

@media (max-height: 900px) and (min-width: 761px) {
  .chat-topics {
    display: none;
  }
}

@media (max-height: 880px) and (min-width: 761px) {
  .chat-context-card {
    display: none;
  }
}

@media (max-width: 760px) {
  .chat-topics {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .experience {
    min-height: 600px;
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .chat-head {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .chat-head h2 {
    font-size: 20px;
  }

  .prompt-area {
    padding-top: 7px;
  }

  .prompt-chip {
    min-height: 42px;
    padding: 7px 10px;
    font-size: 10px;
  }

  .composer {
    padding-bottom: 10px;
  }

  .composer__meta {
    display: none;
  }

  .stage-hud h1 {
    font-size: 32px;
  }

  .story-head h2 {
    font-size: 46px;
  }
}

@media (max-height: 680px) and (max-width: 760px) {
  .composer__meta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --character-crossfade-ms: 20ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .character-breathing,
  .character-gesture {
    animation: none !important;
  }

  .character-layer {
    transition-duration: 20ms !important;
  }

  .stage-ring--two,
  .gift-orbit--one,
  .nfc-ripple i,
  .gift-box {
    animation: none !important;
  }
}

/* Culture archive entry on the original homepage */
.story-archive-intro .button {
  margin-top: 17px;
}

.header-archive-mobile {
  display: none;
}

@media (max-width: 760px) {
  .header-archive-mobile {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    margin-right: 5px;
    padding-inline: 7px;
    color: var(--green);
    font-size: 12px;
    white-space: nowrap;
  }
}

.gift-copy .gift-catalog-link {
  margin-top: 17px;
  border-color: #efdfb7;
  background: #f7edce;
  color: var(--green-deep);
}

.gift-copy .gift-catalog-link:hover {
  background: #fff8e6;
}

/* V3.2 商品问答和课程成果 */
.chat-product-scene[hidden] { display: none; }
.chat-product-scene {
  padding: .5rem clamp(.65rem, 2vw, 1rem);
  background: #eef3e8; color: #174638; border-bottom: 1px solid #d8e1d6;
}
.chat-product-scene strong { display: block; font-size: .85rem; }
.chat-scene-questions { display: flex; flex-wrap: wrap; gap: .32rem; margin-top: .3rem; }
.chat-scene-questions button {
  color: #174638; background: #fffef9; border: 1px solid #b7c9bb; border-radius: 7px;
  padding: .27rem .48rem; font: inherit; font-size: .79rem; cursor: pointer;
}
.chat-scene-questions button:hover { background: #dce9db; }
.chat-product-link { color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.nfc-actions .button { font-size: .85rem; }
.nfc-note:empty { display: none; }

/* Food provenance entry beneath the existing gift link. */
.gift-origins-link{display:block;color:#e9d9b1;font-size:.875rem;margin-top:18px;text-underline-offset:5px}
.source-pill--web{background:#edf3ee;color:#285e49;border-color:#c6d7cb}

.speech-status{margin:5px 4px 0;color:var(--text-muted,#6e776d);font-size:.7rem;line-height:1.5}.speech-status:empty{display:none}
