:root {
  --page-bg: #f3efe6;
  --page-bg-alt: #e5decd;
  --panel-bg: rgba(255, 252, 246, 0.92);
  --panel-border: rgba(92, 73, 37, 0.14);
  --ink: #2f261d;
  --muted: #6f614f;
  --accent: #7b5229;
  --accent-soft: #c9b08f;
  --shadow: 0 24px 60px rgba(73, 51, 22, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, var(--page-bg-alt), var(--page-bg));
}

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

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-header {
  padding: 18px 8px 24px;
  text-align: center;
}

.eyebrow,
.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.site-header h1,
.panel-heading h2,
#video-title {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-header h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.intro {
  width: min(760px, 100%);
  margin: 14px auto 0;
  line-height: 1.5;
  color: var(--muted);
  font-size: 1.08rem;
}

.site-main {
  display: grid;
  gap: 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  gap: 22px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent);
  pointer-events: none;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 26px 26px 14px;
}

.panel-heading h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.detail {
  margin: 0;
  max-width: 280px;
  line-height: 1.45;
  color: var(--muted);
  text-align: right;
}

.media-frame {
  margin: 0 26px 26px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(88, 65, 33, 0.15);
  background: linear-gradient(135deg, #dad7cf, #f3f1ed);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.current-frame {
  aspect-ratio: 4 / 3;
}

.setup-frame {
  aspect-ratio: 3 / 4;
}

.timeline-panel {
  padding-bottom: 24px;
}

.calendar-legend,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 0 26px;
}

.calendar-legend {
  margin-bottom: 10px;
}

.calendar-legend span {
  padding: 0 0 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-cell {
  min-height: 158px;
  border-radius: var(--radius-sm);
}

.calendar-cell.empty {
  background: transparent;
}

.calendar-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 158px;
  width: 100%;
  border: 1px solid rgba(96, 74, 43, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
  color: inherit;
}

.calendar-card.date-only {
  opacity: 0.6;
}

.calendar-card.available {
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.calendar-card.blank {
  background: rgba(255, 255, 255, 0.48);
}

.calendar-card.available:hover,
.calendar-card.available:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(83, 60, 30, 0.16);
  border-color: rgba(123, 82, 41, 0.42);
  outline: none;
}

.day-number {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.thumb-frame {
  display: grid;
  place-items: center;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(140deg, #d8cdb6, #f0ebdf);
  border: 1px dashed rgba(111, 97, 79, 0.35);
}

.calendar-card.blank .thumb-frame {
  background: transparent;
  border-color: transparent;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.thumb-placeholder strong {
  font-size: 1.25rem;
  line-height: 1;
}

.thumb-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.video-modal[hidden] {
  display: none;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.source-images-modal {
  z-index: 50;
}

.video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 16, 11, 0.82);
  backdrop-filter: blur(4px);
}

.video-dialog {
  position: relative;
  width: min(920px, calc(100vw - 28px));
  margin: min(7vh, 48px) auto;
  padding: 22px;
  background: #12100c;
  color: #fff9ef;
  border-radius: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.32);
}

.video-dialog video {
  width: 100%;
  border-radius: 14px;
  background: #000;
}

.source-images-dialog {
  width: min(1120px, calc(100vw - 28px));
  background: #f7f1e7;
  color: var(--ink);
}

.source-images-frame {
  width: 100%;
  height: min(78vh, 920px);
  border: 0;
  border-radius: 14px;
  background: #fffaf2;
}

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

.modal-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-secondary,
.modal-close {
  appearance: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
}

.modal-secondary {
  border: 1px solid rgba(255, 249, 239, 0.26);
  background: rgba(123, 82, 41, 0.78);
  color: #fff7ea;
}

.modal-secondary:hover,
.modal-secondary:focus-visible {
  background: rgba(150, 102, 53, 0.9);
  outline: none;
}

.modal-close {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  margin-left: auto;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .detail {
    max-width: none;
    text-align: left;
  }

  .panel-heading {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 18px;
  }

  .calendar-legend {
    display: none;
  }

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

  .calendar-card,
  .calendar-cell {
    min-height: 140px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-action-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .modal-close,
  .modal-secondary {
    width: 100%;
    margin-left: 0;
  }

  .panel-heading,
  .media-frame,
  .calendar-grid {
    padding-left: 18px;
    padding-right: 18px;
  }

  .media-frame {
    margin-left: 18px;
    margin-right: 18px;
  }
}
