:root {
  --cream: #f5efe4;
  --wall: #efe7d8;
  --paper: #faf6ee;
  --wood: #dfc7a7;
  --wood-trim: #c9ae8c;
  --wood-deep: #b68b5c;
  --olive: #5d6a3b;
  --olive-hover: #4b562e;
  --olive-soft: #e5e9d6;
  --terracotta: #c76b53;
  --ink: #2c2a27;
  --ink-muted: #6c6459;
  --border: #dfd2be;
  --border-strong: #cbbba2;
  --font-display: "Newsreader", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --max-w: 1120px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

img {
  display: block;
  max-width: 100%;
}

.pixel-art {
  image-rendering: auto;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Language switching: bilingual-friendly with Chinese primary by default */
body[data-lang="zh"] [data-i18n-en] {
  display: none;
}

body[data-lang="en"] [data-i18n-zh] {
  display: none;
}

.container {
  width: min(var(--max-w), calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 239, 228, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
}

.brand-name {
  font-size: 1.08rem;
  color: var(--ink);
}

.brand-serif {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.brand-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--olive-soft);
  color: var(--olive);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.92rem;
  color: var(--ink-muted);
  transition: color 140ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.lang-toggle:hover {
  background: var(--olive-soft);
  border-color: var(--olive);
}

/* Hero */
.hero {
  padding: clamp(44px, 7vw, 84px) 0 clamp(40px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--olive);
  background: var(--olive-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--olive);
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 28px;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  color: var(--ink-muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--olive);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--olive-hover);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--wood-deep);
  background: #fdfaf3;
}

.btn-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--olive-soft);
  color: var(--olive);
}

.hero-footnote {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Live Interactive Jimmy Stage */
.stage-frame {
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.stage-room {
  position: relative;
  height: 318px;
  border-radius: var(--radius-md);
  background: var(--wall);
  border: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Subtle warm morning window light on the wall */
.stage-window-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 24%, rgba(250, 246, 238, 0.72) 0%, rgba(250, 246, 238, 0) 56%),
    linear-gradient(125deg, rgba(255, 252, 246, 0.42) 0%, rgba(239, 231, 216, 0) 60%);
  pointer-events: none;
}

.stage-hud {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.9);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
}

.stage-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* Oak floor band */
.oak-baseboard {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  height: 8px;
  background: linear-gradient(180deg, var(--wood-trim) 0%, var(--wood-deep) 100%);
  border-top: 1px solid rgba(182, 139, 92, 0.35);
}

.oak-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  background-color: var(--wood);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(182, 139, 92, 0.16) 0,
      rgba(182, 139, 92, 0.16) 1px,
      transparent 1px,
      transparent 92px
    ),
    linear-gradient(180deg, rgba(182, 139, 92, 0.2) 0%, rgba(223, 199, 167, 0) 30%);
  border-top: 1px solid var(--wood-trim);
}

/* Live Jimmy actor */
.jimmy-actor {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 164px;
  height: 164px;
  z-index: 4;
  border: 0;
  padding: 0;
  background: transparent;
  transform: translate3d(120px, 0, 0);
  will-change: transform;
  touch-action: manipulation;
}

.jimmy-actor:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
  border-radius: 12px;
}

.jimmy-shadow {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 76px;
  height: 11px;
  transform: translateX(-50%) scaleX(1);
  transform-origin: center center;
  border-radius: 50%;
  background: rgba(44, 42, 39, 0.16);
  filter: blur(1.5px);
  opacity: 0.95;
  will-change: transform, opacity;
  pointer-events: none;
}

.jimmy-bounce {
  width: 164px;
  height: 164px;
  transform-origin: center bottom;
  will-change: transform;
}

.jimmy-sprite {
  width: 164px;
  height: 164px;
  object-fit: contain;
  transform-origin: center bottom;
}

.jimmy-actor.facing-left .jimmy-sprite {
  transform: scaleX(-1);
}

.jimmy-heart {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
}

.jimmy-heart.pop {
  animation: heartFloat 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heartFloat {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1.05);
  }
}

.jimmy-whisper {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms ease;
}

.jimmy-whisper.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Stage bottom action controls */
.stage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 4px 2px;
}

.activity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--cream);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: background-color 130ms ease, color 130ms ease, border-color 130ms ease;
}

.pill-btn:hover {
  border-color: var(--wood-deep);
  color: var(--ink);
}

.pill-btn.active {
  background: var(--olive-soft);
  border-color: var(--olive);
  color: var(--olive);
  font-weight: 600;
}

.pet-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(199, 107, 83, 0.45);
  background: rgba(199, 107, 83, 0.1);
  color: #9e4833;
  font-size: 0.8rem;
  font-weight: 600;
}

.pet-btn:hover {
  background: rgba(199, 107, 83, 0.18);
}

/* Editorial Sections */
.section {
  padding: clamp(52px, 7vw, 88px) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  max-width: 64ch;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--olive);
}

.section-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.section-desc {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Editorial Memorial Sections */
.moments-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.moment-tile {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 14px 16px;
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease;
}

.moment-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.moment-tile img {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.moment-tile figcaption strong {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.moment-tile figcaption span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

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

.room-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 3.6vw, 38px);
}

.room-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--olive);
  margin-bottom: 10px;
}

.room-card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.room-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.75;
}

.memorial-section {
  padding-bottom: clamp(56px, 8vw, 96px);
}

.memorial-card {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4.5vw, 52px);
}

.memorial-quote {
  margin: 10px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.memorial-body {
  margin: 0 auto 24px;
  max-width: 54ch;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.82;
}

.memorial-sig {
  display: inline-block;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--olive);
  letter-spacing: 0.02em;
}

.code-inline {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--wall);
  color: var(--ink);
}

/* Subpages (/privacy & /support) */
.doc-hero {
  padding: clamp(40px, 6vw, 68px) 0 28px;
  border-bottom: 1px solid var(--border);
}

.doc-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 600;
  line-height: 1.22;
}

.doc-hero p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 64ch;
}

.doc-layout {
  padding: clamp(32px, 5vw, 56px) 0 72px;
  display: grid;
  gap: 24px;
}

.doc-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
}

.doc-card h2 {
  margin: 0 0 14px;
  font-size: 1.24rem;
  font-weight: 700;
}

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

.doc-col h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--olive);
}

.doc-col p,
.doc-col ul,
.doc-col ol {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.doc-col ul,
.doc-col ol {
  padding-left: 20px;
}

.doc-col li + li {
  margin-top: 6px;
}

.doc-col strong {
  color: var(--ink);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.92rem;
}

.policy-table th,
.policy-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.policy-table th {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--olive);
  background: var(--wall);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-strong);
  padding: 34px 0 44px;
  background: var(--wall);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

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

.footer-brand img {
  width: 32px;
  height: 32px;
}

.footer-meta {
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links a {
  color: var(--ink-muted);
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid,
  .rooms-grid,
  .doc-bilingual {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 600px) {
  .moments-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .site-nav {
    gap: 14px;
  }

  .stage-room {
    height: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .jimmy-bounce,
  .jimmy-whisper {
    transition: none;
  }

  .jimmy-heart.pop {
    animation: none;
    opacity: 1;
  }
}
