:root {
  --paper: #f5f0e6;
  --paper-deep: #ece3d4;
  --ink: #40453f;
  --ink-soft: #697169;
  --accent: #8d9d95;
  --accent-deep: #66756f;
  --border: rgba(72, 79, 71, 0.16);
  --shadow: 0 16px 44px rgba(67, 70, 58, 0.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(173, 184, 176, 0.28), transparent 28%),
    linear-gradient(180deg, #f7f3ea 0%, #f0eadf 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.page-shell { max-width: 1440px; margin: 0 auto; padding: 18px 16px 24px; }
.site-header, .site-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 8px; color: var(--ink-soft);
}
.site-nav { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.95rem; }
.site-nav a { padding: 6px 0; }
.site-footer { font-size: 0.88rem; margin-top: 22px; border-top: 1px solid var(--border); }
.card {
  background: rgba(250, 247, 240, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 22px;
  backdrop-filter: blur(6px);
}
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.83rem; color: var(--accent-deep); }
.lede { font-size: 1.03rem; line-height: 1.72; }
.home-view, .location-view { display: grid; gap: 20px; }
.home-hero { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(300px, 1fr); gap: 22px; padding: 24px; align-items: center; overflow: hidden; }
.home-hero h1 { font-size: clamp(2rem, 4vw, 3.6rem); margin: 10px 0; line-height: 1.1; }
.home-hero-copy { max-width: 60ch; }
.home-actions, .action-row { display: flex; flex-wrap: wrap; gap: 12px; }
.primary-btn, .secondary-btn, .ghost-btn, .mode-btn, .pref-chip {
  border-radius: 999px; border: 1px solid var(--border); padding: 12px 18px; transition: 0.2s ease;
}
.primary-btn {
  background: var(--accent-deep); color: #fff; border-color: transparent;
}
.secondary-btn { background: rgba(255,255,255,0.58); color: var(--ink); }
.ghost-btn { background: transparent; color: var(--ink-soft); }
.small { padding: 8px 12px; font-size: 0.92rem; }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .mode-btn:hover, .pref-chip:hover {
  transform: translateY(-1px); box-shadow: 0 8px 18px rgba(67,70,58,0.08);
}
.home-map-wrap { position: relative; min-height: 340px; }
.home-map {
  width: 100%; height: 100%; object-fit: cover; border-radius: 18px; border: 1px solid var(--border);
}
.location-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.location-card { overflow: hidden; }
.location-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.location-copy { padding: 16px; }
.location-copy h3 { margin: 0 0 8px; font-size: 1.45rem; }
.intro-card { padding: 18px 22px; }
.location-top { display: flex; align-items: center; gap: 18px; padding: 18px 20px; position: relative; z-index: 1; }
.location-heading h1 { margin: 6px 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.location-heading p { margin: 0; line-height: 1.7; }
.location-view { position: relative; }
.location-backdrop {
  position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.18;
  filter: blur(16px) saturate(0.9); transform: scale(1.02); border-radius: 24px;
}
.editor-layout {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.92fr); gap: 20px; position: relative; z-index: 1;
}
.editor-panel, .controls-panel { padding: 20px; }
.controls-panel { display: grid; align-content: start; gap: 18px; }
.art-banner-wrap { overflow: hidden; border-radius: 18px; border: 1px solid var(--border); margin-bottom: 16px; }
.art-banner { width: 100%; max-height: 280px; object-fit: cover; display: block; }
.music-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  border: 1px solid var(--border); padding: 14px; border-radius: 18px; background: rgba(255,255,255,0.46); margin-bottom: 16px;
}
.music-card p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.94rem; }
.music-controls { display: flex; gap: 8px; }
.progress-row { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.progress-row input { width: 100%; }
.postcard-shell { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.62); }
.postcard-stage { position: relative; padding: 14px; }
#postcardCanvas { width: 100%; height: auto; display: block; border-radius: 16px; background: #fbf7ef; }
.text-fields { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.text-fields label, .control-group label { display: grid; gap: 6px; }
.text-fields span, .control-group span { font-size: 0.92rem; color: var(--ink-soft); }
input[type="text"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,0.78);
}
input[type="range"] { width: 100%; }
.controls-panel h2, .controls-panel h3 { margin: 0 0 8px; }
.control-group { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,0.44); }
.microcopy { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--ink-soft); }
.effect-grid, .preference-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.mode-btn.active, .pref-chip.active { background: rgba(141, 157, 149, 0.24); border-color: rgba(102,117,111,0.35); color: var(--accent-deep); }
.compact { gap: 8px; }
.preference-card textarea { min-height: 80px; }
.status-text { min-height: 1.4em; }
details summary { cursor: pointer; color: var(--accent-deep); }
@media (max-width: 980px) {
  .home-hero, .editor-layout, .location-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-header, .site-footer, .location-top, .music-card { grid-template-columns: 1fr; display: grid; }
  .site-nav { gap: 10px 14px; }
  .page-shell { padding-inline: 12px; }
  .home-hero, .editor-panel, .controls-panel { padding: 16px; }
}

/* v10 music update. The map, editor and postcard layout are unchanged. */
[hidden] { display: none !important; }
.film-music-card { display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-width: 0; }
.film-track-heading { min-width: 0; }
.film-track-heading h2 { margin: 7px 0 8px; font-size: 1.18rem; }
.film-tag { color: var(--accent-deep); font-size: .74rem; letter-spacing: .09em; }
.film-track-heading .film-title { font-size: 1.19rem; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.film-track-heading .recording-meta { font-size: .82rem; line-height: 1.5; }
.film-consent { padding: 14px 0 4px; border-top: 1px solid var(--border); }
.film-consent > p:first-child { margin: 0 0 8px; color: var(--ink); }
.film-consent button { margin-top: 12px; max-width: 100%; }
.film-player-frame { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #1c201e; overflow: hidden; }
.film-player-frame iframe { display: block; width: 100%; height: 100%; min-height: 200px; border: 0; }
.film-playback-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.film-status:empty { display: none; }
.film-source-row { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .83rem; line-height: 1.65; }
.film-source-row a, .site-footer a, .credits-content a { text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.credits-content { max-width: 860px; margin: 20px auto; padding: clamp(20px, 5vw, 40px); line-height: 1.8; overflow-wrap: anywhere; }
.credits-content h1, .credits-content h2, .credits-content h3 { line-height: 1.35; }
.credits-content section + section { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px; }
@media (prefers-reduced-motion: reduce) {
  button, a { transition: none !important; }
  .primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .mode-btn:hover, .pref-chip:hover { transform: none; }
}
/* A 200px-tall video must not impose its 16:9 intrinsic width on mobile grids. */
.editor-panel { min-width: 0; }
.film-player-frame, .film-player-frame iframe { min-width: 0; max-width: 100%; }
