/* Minimal, functional — calm neutrals, clear type, no decorative motion */

:root {
  --bg: #f6f4ef;
  --surface: #fffdf9;
  --text: #1c1917;
  --text-muted: #44403c;
  --border: #d6d3cd;
  --accent: #5c5347;
  --accent-hover: #3f3a33;
  --focus: #2563eb;
  --shadow: rgba(28, 25, 23, 0.08);
}

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

html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  outline: 3px solid var(--focus);
}

.site-qr {
  position: fixed;
  z-index: 60;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: auto;
  display: block;
  padding: 0.45rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 24px var(--shadow);
  line-height: 0;
}

.site-qr img {
  display: block;
  width: 100px;
  height: 100px;
}

.site-qr:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .site-qr img {
    width: 84px;
    height: 84px;
  }
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  max-width: 100%;
}

.brand .bilingual-inline .zh {
  font-size: 0.95em;
}

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

.bilingual-inline {
  display: block;
}

.bilingual-inline .zh {
  display: block;
  font-size: 0.92em;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.2em;
}

.tagline.bilingual-block {
  white-space: normal;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem max(5rem, calc(3rem + env(safe-area-inset-bottom, 0px)));
}

.silent-banner {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 32px var(--shadow);
  width: 100%;
  /* Large hero: most of the viewport on phones; capped on very tall monitors */
  height: min(78vh, 960px);
  background: var(--bg);
}

/* Full-bleed: fill width, crop top/bottom (or sides for tall photos) to cover the box */
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.welcome-text {
  margin-bottom: 2rem;
}

.welcome-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 650;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.dates {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.tagline {
  font-size: 1.25rem;
  max-width: 40em;
  margin: 0;
  color: var(--text);
}

.intro-video {
  margin-top: 0.25rem;
}

.intro-video[hidden] {
  display: none !important;
}

.intro-video__title {
  margin-bottom: 1rem;
}

.intro {
  margin-bottom: 0;
}

.themes-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.theme-detail {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.theme-detail[hidden] {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem 1.35rem;
  min-height: 56px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn .btn-bi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  line-height: 1.25;
  text-align: center;
}

.btn .btn-bi .bi-zh {
  font-size: 0.88em;
  font-weight: 600;
  opacity: 0.92;
}

.btn-secondary .btn-bi .bi-zh {
  color: var(--text-muted);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 650;
  margin: 0 0 1.25rem;
}

.theme-detail-title {
  margin-bottom: 1.25rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .theme-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.theme-card {
  display: block;
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 1.35rem 1.25rem;
  min-height: 72px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px var(--shadow);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 28px var(--shadow);
}

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

.theme-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 6px 24px var(--shadow);
}

.theme-card .theme-bilingual {
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 0;
}

.theme-card .theme-bilingual span {
  display: block;
}

.theme-card .theme-bilingual.compact {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.35;
}

.theme-player-section {
  margin-top: 1.75rem;
}

.theme-player-section[hidden] {
  display: none;
}

/* Topic clip wall: dense thumbnail grid */
.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .video-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

@media (min-width: 1000px) {
  .video-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.gallery-empty {
  grid-column: 1 / -1;
}

.gallery-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.gallery-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px var(--shadow);
}

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

.gallery-tile.is-current {
  border-color: var(--accent);
  box-shadow: 0 6px 22px var(--shadow);
}

.gallery-tile__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}

.gallery-tile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.gallery-tile__caption {
  padding: 0.4rem 0.45rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--text);
}

.gallery-tile__caption .bilingual-inline .zh {
  font-size: 0.95em;
  margin-top: 0.1em;
}

.player-shell {
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(70vh, 720px);
  min-height: 220px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 12px 40px var(--shadow);
}

.player-shell iframe,
.player-shell video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  border: 0;
  object-fit: contain;
  vertical-align: middle;
}

.player-meta {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

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