@font-face {
  font-family: "Crimson Text";
  src: url("fonts/CrimsonText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("fonts/CrimsonText-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("fonts/CrimsonText-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("fonts/CrimsonText-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/LibreFranklin-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #F6F0E4;
  --cream-deep: #E8DCC8;
  --ivory: #FBF7EF;
  --ink: #2A1416;
  --wine: #6F1420;
  --wine-deep: #3E0E12;
  --forest: #1E3A2F;
  --forest-mid: #2F5A45;
  --gold: #C4A36A;
  --gold-soft: #E2C992;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --app-h: 100svh;
}

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

html, body {
  height: 100%;
  height: var(--app-h);
  max-height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background: #11080A;
  color: var(--ink);
  font-family: "Libre Franklin", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
  cursor: default;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

img, video { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

#app, .screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* ---------- Shared media stage: contain + blurred backdrop ---------- */
.media-root {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0A0707;
}
.media-bg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(36px) brightness(0.42) saturate(1.08);
  transform: scale(1.08);
  pointer-events: none;
}
.media-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}
.media-frame img,
.media-frame video,
.media-fg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: transparent;
}
.media-frame picture {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}
.media-frame picture img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-spinner {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 2px solid rgba(247,241,230,.25);
  border-top-color: var(--gold-soft);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.media-root.is-loading .media-spinner { opacity: 1; }

/* Poster is out of flow so it never shares flex space with the video
   (two in-flow siblings were offsetting videos halfway off-screen). */
.media-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 0;
}
.media-poster.is-hidden { opacity: 0; }
.media-frame video {
  position: relative;
  z-index: 1;
}
.media-msg {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: min(86%, 22rem);
  text-align: center;
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.2;
  color: #F7F1E6;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  pointer-events: none;
}
.media-root.is-error video.media-fg { opacity: 0; }


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

.kenburns {
  animation: kenburns 9s ease-in-out forwards;
  transform-origin: center center;
}
.kenburns.alt { animation-name: kenburns-alt; }
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}
@keyframes kenburns-alt {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

/* ---------- Attract ---------- */
#screen-attract { background: #0A0707; }

/* v1 full-bleed: media covers the entire screen, no letterbox or blur frame */
#screen-attract .media-bg { display: none; }
#screen-attract .media-frame {
  display: block;
}
#screen-attract .media-frame picture,
#screen-attract .media-frame img,
#screen-attract .media-frame video,
#screen-attract .media-fg,
#screen-attract .media-frame picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.stage, .layer {
  position: absolute;
  inset: 0;
}
.layer {
  opacity: 0;
  transition: opacity 1.05s ease;
  overflow: hidden;
}
.layer.is-on { opacity: 1; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(to top, rgba(8,4,4,.62) 0%, rgba(8,4,4,.08) 38%, transparent 58%),
    linear-gradient(to bottom, rgba(8,4,4,.28) 0%, transparent 22%);
}

.logo-btn { padding: 0; background: none; }
.logo-attract {
  position: absolute;
  top: max(16px, calc(var(--safe-t) + 8px));
  left: max(16px, calc(var(--safe-l) + 12px));
  z-index: 3;
  width: min(240px, 42vw);
}
.logo-attract img { width: 100%; height: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.45)); }

.overlay-line {
  position: absolute;
  left: max(16px, calc(var(--safe-l) + 16px));
  right: max(16px, calc(var(--safe-r) + 16px));
  bottom: max(52px, calc(var(--safe-b) + 36px));
  z-index: 3;
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 2.15rem);
  line-height: 1.2;
  color: #F7F1E6;
  text-shadow: 0 2px 16px rgba(0,0,0,.55);
  letter-spacing: 0.01em;
  max-width: 18em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.overlay-line.is-on { opacity: 1; transform: none; }

.tap-hint {
  position: absolute;
  right: max(16px, calc(var(--safe-r) + 16px));
  bottom: max(16px, calc(var(--safe-b) + 12px));
  z-index: 3;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247,241,230,.78);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- Menu ---------- */
#screen-menu { background: var(--cream); }
.menu-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196,163,106,.18), transparent 50%),
    var(--cream);
}

.menu-shell {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(52%, 620px);
  padding: max(24px, calc(var(--safe-t) + 16px)) 56px max(24px, calc(var(--safe-b) + 20px)) max(28px, calc(var(--safe-l) + 28px));
  display: flex;
  flex-direction: column;
  z-index: 2;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.logo-light { width: min(260px, 70%); margin-bottom: 10px; align-self: flex-start; }
.logo-light img { width: 100%; height: auto; }

.menu-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 6px 0 28px;
  line-height: 1.35;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  justify-content: center;
}
.menu-nav button {
  text-align: left;
  font-family: "Crimson Text", Georgia, serif;
  font-size: clamp(1.55rem, 3.2vw, 2.45rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 0.42em 0;
  border-bottom: 1px solid rgba(110, 20, 32, 0.16);
  transition: color 0.2s ease, padding-left 0.25s ease;
}
.menu-nav button:hover,
.menu-nav button:active { color: var(--wine); padding-left: 8px; }

.btn-book {
  margin-top: 28px;
  align-self: flex-start;
  background: var(--wine);
  color: var(--ivory);
  padding: 0.85em 1.6em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 2px;
  transition: background 0.2s ease;
}
.btn-book:hover, .btn-book:active { background: var(--wine-deep); }

.menu-credit {
  margin: 16px 0 0;
  font-family: "Libre Franklin", system-ui, sans-serif;
  font-size: 0.62rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: rgba(30, 58, 47, 0.48);
  max-width: 22rem;
}

.menu-aside {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 50%;
  overflow: hidden;
}
.menu-aside img, .menu-aside video {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.95) contrast(1.05);
}
.menu-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--cream) 0%, transparent 18%);
}

/* ---------- Shared bars / typography ---------- */
.bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex: 0 0 auto;
  padding: max(12px, calc(var(--safe-t) + 8px)) max(16px, calc(var(--safe-r) + 8px)) 10px max(16px, calc(var(--safe-l) + 8px));
  color: #F7F1E6;
  min-height: 0;
}
.bar-light { color: var(--ink); }
.bar-over {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}
.bar-over > * { pointer-events: auto; }
.bar-title {
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.2rem, 3.8vw, 1.85rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bar-sub {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
  min-width: 0;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  color: #F7F1E6;
  padding: 6px 0;
  align-self: center;
}
.btn-back::before { content: "← "; }
.btn-back-dark { color: var(--wine); }
.btn-text {
  margin-left: auto;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wine);
  line-height: 1;
}

/* ---------- Gallery ---------- */
#screen-gallery {
  background: #0C0808;
  display: flex;
  flex-direction: column;
}
.gallery-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.gallery-caption {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 8px max(16px, calc(var(--safe-r) + 12px)) 6px max(16px, calc(var(--safe-l) + 12px));
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  line-height: 1.2;
  color: #F7F1E6;
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
  max-width: 100%;
}
.filmstrip {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px max(16px, calc(var(--safe-r) + 12px)) max(12px, calc(var(--safe-b) + 10px)) max(16px, calc(var(--safe-l) + 12px));
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.4));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}
.filmstrip::-webkit-scrollbar { display: none; }
.filmstrip button {
  flex: 0 0 auto;
  width: 96px;
  height: 64px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 2px;
  opacity: 0.7;
}
.filmstrip button.is-current {
  border-color: var(--gold);
  opacity: 1;
}
.filmstrip img, .filmstrip video {
  width: 100%; height: 100%; object-fit: cover;
}

/* ---------- Events ---------- */
#screen-events, #screen-book, #screen-admin {
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.event-grid,
.book-grid,
.admin-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px max(20px, calc(var(--safe-r) + 16px)) max(20px, calc(var(--safe-b) + 16px)) max(20px, calc(var(--safe-l) + 16px));
}
.event-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.event-card {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(62,14,18,.12);
  min-height: 220px;
}
.event-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s ease;
}
.event-card:hover img, .event-card:active img { transform: scale(1.05); }
.event-card span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 24px;
  background: linear-gradient(to top, rgba(20,8,8,.72), transparent);
  color: #F7F1E6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.event-card em {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.event-card strong {
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ---------- Stories ---------- */
#screen-stories { background: #000; }
.stories-reel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.story {
  position: relative;
  height: 100%;
  height: 100svh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}
.story .story-cap {
  position: absolute;
  left: 50%;
  bottom: max(28px, calc(var(--safe-b) + 20px));
  width: min(86%, 28rem);
  transform: translateX(-50%);
  text-align: center;
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.2;
  color: #F7F1E6;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  z-index: 2;
  pointer-events: none;
}
.story .story-progress {
  position: absolute;
  top: max(10px, calc(var(--safe-t) + 6px));
  left: max(80px, calc(var(--safe-l) + 80px));
  right: max(16px, calc(var(--safe-r) + 16px));
  height: 3px;
  background: rgba(255,255,255,.25);
  z-index: 5;
  border-radius: 2px;
  overflow: hidden;
}
.story .story-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold-soft);
}
.stories-hint {
  position: absolute;
  right: max(16px, calc(var(--safe-r) + 8px));
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: right center;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247,241,230,.55);
  pointer-events: none;
  z-index: 3;
}

/* ---------- Book ---------- */
.book-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: 36px;
  align-items: start;
}
.book-qr {
  background: var(--ivory);
  border: 1px solid rgba(110,20,32,.12);
  padding: 28px 24px;
  text-align: center;
}
.book-qr img {
  width: min(260px, 100%);
  margin: 0 auto 16px;
}
.book-qr p { font-size: 0.95rem; color: var(--ink); }
.placeholder-note {
  margin-top: 8px;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest) !important;
}

.lead-form { display: flex; flex-direction: column; gap: 12px; }
.form-intro {
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  line-height: 1.2;
  margin-bottom: 6px;
}
.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
}
.lead-form input {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid rgba(110,20,32,.2);
  padding: 0.7em 0.8em;
  border-radius: 2px;
}
.lead-form input:focus {
  outline: none;
  border-color: var(--wine);
}
.form-row { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; }
.lead-form .btn-book { align-self: flex-start; margin-top: 8px; }
.form-status {
  font-size: 0.95rem;
  color: var(--forest);
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
}

/* ---------- Admin ---------- */
.admin-note { font-size: 0.85rem; color: var(--forest); margin-bottom: 16px; }
.admin-note code { font-size: 0.8em; }
.leads-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--ivory);
}
.leads-list th, .leads-list td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(110,20,32,.12);
}
.leads-list th {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest);
}
.empty-leads { color: var(--forest); font-style: italic; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .bar-sub { display: none; }
  .menu-shell {
    width: 100%;
    padding: max(20px, calc(var(--safe-t) + 12px)) max(22px, calc(var(--safe-r) + 16px)) max(20px, calc(var(--safe-b) + 16px)) max(22px, calc(var(--safe-l) + 16px));
  }
  .menu-aside { display: none; }
  .logo-light, .logo-attract { width: min(210px, 68vw); }
  .book-grid, .event-grid { grid-template-columns: 1fr; }
  .stories-hint { display: none; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .event-card { min-height: 200px; }
}

@media (orientation: portrait) {
  .menu-shell { width: 100%; }
  .menu-aside { display: none; }
  .book-grid, .event-grid { grid-template-columns: 1fr; }
  .stories-hint { display: none; }
}

@media (max-width: 480px) {
  .menu-nav button { font-size: clamp(1.45rem, 7vw, 1.9rem); padding: 0.36em 0; }
  .menu-kicker { margin-bottom: 16px; }
  .btn-book { margin-top: 20px; }
  .filmstrip button { width: 80px; height: 54px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .menu-nav button { padding: 0.22em 0; font-size: clamp(1.2rem, 4.2vh, 1.8rem); }
  .logo-light { width: 180px; }
  .menu-kicker { margin-bottom: 8px; }
  .btn-book { margin-top: 12px; padding: 0.65em 1.3em; }
  .menu-credit { margin-top: 10px; font-size: 0.58rem; }
  .filmstrip button { width: 80px; height: 50px; }
}
