/* =========================================================
   Camp Liebo — styles.css
   Mobile-first. Plain CSS. No build step.
   Palette and type are tuned to the intro video so the page
   dissolves into the artwork rather than framing it.
   ========================================================= */

:root {
  /* Palette — every color used in this stylesheet routes through these. */
  --bg:           #A8D2EE;
  --ink:          #0F1F36;
  --ink-dim:      #33476A;
  --ink-faint:    #65789A;
  --accent:       #D7473F;
  --accent-warm:  #E8AC58;
  --cream:        #F5F1DD;
  --bg-card:      #BFDEF3;
  --line:         #8CB2CD;

  /* Translucent variants of --bg for masks / readability gradients.
     Authored as 8-digit hex so we never reach for an out-of-system color. */
  --bg-00: #A8D2EE00;
  --bg-40: #A8D2EE66;
  --bg-70: #A8D2EEB3;
  --bg-90: #A8D2EEE6;

  /* Translucent --ink for hairlines and shadows. */
  --ink-12: #0F1F361F;
  --ink-25: #0F1F3640;

  /* Translucent --accent for the soft glow. */
  --accent-12: #D7473F1F;

  /* Type stack. */
  --font-display: "Sigmar", "Georgia", serif;
  --font-body:    "Fraunces", "Georgia", "Times New Roman", serif;

  /* Motion. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-dur: 600ms;
  --fade-dur:   480ms;
  --hover-dur:  220ms;

  /* Layout tokens. */
  --video-w: min(92vw, 360px);
  --feather: 36px;
}

@media (min-width: 720px) {
  :root {
    --video-w: min(60vw, 420px);
  }
}

/* ---------- Reset / base ---------- */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

h1 { margin: 0; font-weight: 400; }
p  { margin: 0; }

/* ---------- Atmosphere: film-grain noise ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ---------- Screens ---------- */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  opacity: 0;
  transform: translateY(0);
  transition:
    opacity var(--fade-dur) var(--ease-out),
    transform var(--fade-dur) var(--ease-out);
}

.screen.is-active {
  display: flex;
  opacity: 1;
}

.screen.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* ---------- Screen 1: intro ---------- */

.intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
}

/* Soft radial accent glow behind the video. */
.video-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--video-w) * 1.6);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, var(--accent-12) 0%, var(--bg-00) 62%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

/* Frame that holds the video. Aspect-ratio per spec. */
.video-wrap {
  position: relative;
  width: var(--video-w);
  aspect-ratio: 9 / 16;
  z-index: 1;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--bg);
  /* On final frame freeze, prevent any UI chrome */
  pointer-events: none;
}

/*
  The video file has a built-in ~18.8% black bar at the top.
  This overlay paints --bg over that bar and feathers into the
  artwork's sky so the page background and the video's sky meet
  with no visible seam.
*/
.video-top-blend {
  position: absolute;
  inset: 0 0 auto 0;
  height: 23%;
  background: linear-gradient(
    to bottom,
    var(--bg)    0%,
    var(--bg)   78%,
    var(--bg-70) 88%,
    var(--bg-00) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Edge feathering — fades all four sides into --bg over ~36px. */
.video-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: inset 0 0 var(--feather) 14px var(--bg);
}

/* ---------- Mode A: readability gradient under overlaid Enter ---------- */

.enter-gradient {
  display: none;
}

[data-mode="A"] .enter-gradient {
  display: block;
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(
    to bottom,
    var(--bg-00) 0%,
    var(--bg-40) 55%,
    var(--bg-70) 100%
  );
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity var(--fade-dur) var(--ease-out);
}

[data-mode="A"] .enter-gradient.is-revealed {
  opacity: 1;
}

/* ---------- Mode C: wordmark replaces video ---------- */

.wordmark {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8% 4%;
  z-index: 1;
  opacity: 0;
  transition: opacity var(--fade-dur) var(--ease-out);
}

[data-mode="C"] .wordmark {
  display: flex;
}

.wordmark.is-revealed {
  opacity: 1;
}

[data-mode="C"] .video-wrap {
  transition: opacity 600ms var(--ease-out);
}

[data-mode="C"] .video-wrap.is-fading {
  opacity: 0;
}

/* Wordmark feels like a vintage camp placard:
   cream "paper" with a navy carved frame and a mustard hairline. */
.wordmark-eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-bottom: 12px;
}

.wordmark-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 18vw, 96px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: uppercase;
  text-shadow:
    0 0 0 var(--ink),
    1px 1px 0 var(--accent-warm);
}

.wordmark-rule {
  display: block;
  width: clamp(120px, 38%, 200px);
  height: 2px;
  margin: 14px 0 12px;
  background: var(--accent-warm);
  position: relative;
}

.wordmark-rule::before,
.wordmark-rule::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent-warm);
  border-radius: 50%;
  transform: translateY(-50%);
}
.wordmark-rule::before { left: -12px; }
.wordmark-rule::after  { right: -12px; }

.wordmark-tag {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Enter button ---------- */

.enter-zone {
  --reveal-y: 8px;
  --x: 0;
  position: relative;
  margin-top: clamp(20px, 4vh, 32px);
  opacity: 0;
  transform: translateX(var(--x)) translateY(var(--reveal-y));
  transition:
    opacity var(--reveal-dur) var(--ease-out),
    transform var(--reveal-dur) var(--ease-out);
  z-index: 5;
}

.enter-zone.is-revealed {
  opacity: 1;
  --reveal-y: 0px;
}

/* Mode A: Enter sits over the bottom of the video. */
[data-mode="A"] .enter-zone {
  position: absolute;
  bottom: 6%;
  left: 50%;
  --x: -50%;
  margin-top: 0;
}

/* Mode C: tighter spacing under the wordmark. */
[data-mode="C"] .enter-zone {
  margin-top: clamp(28px, 5vh, 44px);
}

.enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 52px;
  padding: 14px 36px;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4.5px var(--accent-warm),
    0 2px 0 0 var(--ink-25);
  transition:
    background var(--hover-dur) var(--ease-out),
    color var(--hover-dur) var(--ease-out),
    transform var(--hover-dur) var(--ease-out),
    box-shadow var(--hover-dur) var(--ease-out);
}

.enter-btn-label {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 var(--accent-12);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .enter-btn-label { font-size: 19px; }
  .enter-btn { min-width: 260px; }
}

/* Pointer-only hover state — no sticky hover on touch. */
@media (hover: hover) and (pointer: fine) {
  .enter-btn:hover {
    background: var(--accent-warm);
    transform: translateY(-1px);
  }
}

.enter-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.enter-btn:active {
  background: var(--accent);
  color: var(--cream);
  transform: translateY(1px);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 4.5px var(--accent-warm),
    0 0 0 0 var(--ink-25);
}

/* ---------- Screen 2: details ----------
   Screen 2 breaks out of the fixed-screen base rule and flows
   in normal document order so the body's native scroll handles
   the page. Screen 1's centered fixed composition is untouched. */

.screen-detail {
  position: static;
  padding: 0;
}

.screen-detail.is-active {
  display: block;
}

/* Editorial reading column. Caps line length on tablet/desktop and
   adds top/bottom safe-area padding so the headline clears the notch
   and the final paragraph clears the iOS home indicator. */
.detail {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding-left: clamp(20px, 6vw, 28px);
  padding-right: clamp(20px, 6vw, 28px);
  padding-top: max(56px, calc(env(safe-area-inset-top) + 24px));
  padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 32px));
}

/* --- Headline block --- */

.detail-header {
  margin: 0;
}

.detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 10vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.005em;
  color: var(--ink);
  outline: none;
}

.detail-title:focus-visible {
  outline: none;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.detail-tag {
  margin: 14px 0 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

/* --- Single hairline treatment used between top-level sections
       and between days inside the schedule. No other dividers. --- */

.bunk,
.schedule,
.day + .day {
  margin-top: clamp(40px, 8vw, 56px);
  padding-top: clamp(40px, 8vw, 56px);
  border-top: 1px solid var(--ink-12);
}

/* --- Section heading (used for "Bunk Info" and "Camp Schedule") --- */

.section-heading {
  margin: 0 0 36px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* --- Bunk info --- */

.bunk-body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}

.bunk-address {
  display: block;
  margin: 20px 0 0;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  min-height: 44px;
  padding: 10px 22px;
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background var(--hover-dur) var(--ease-out),
    color var(--hover-dur) var(--ease-out),
    transform var(--hover-dur) var(--ease-out);
}

.link-btn-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .link-btn:hover {
    background: var(--accent-warm);
    transform: translateY(-1px);
  }
}

.link-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.link-btn:active {
  background: var(--accent);
  color: var(--cream);
  transform: translateY(1px);
}

/* --- Schedule --- */

.day-header {
  margin: 0 0 20px;
}

.day-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}

.day-tag {
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-dim);
}

.day p {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

.day p + p {
  margin-top: 12px;
}

.block {
  margin-top: 24px;
}

.block-name {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Featured/timed activity lines: same paragraph treatment with a slightly
   heavier weight. Used for both timed events (golf, hike) and headlined
   un-timed events (Casino Run, Color War, The Liebo Feast). */
.day .event {
  font-weight: 500;
}

.event-time {
  display: inline-block;
  margin-right: 2px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.electives {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.electives li {
  position: relative;
  padding-left: 18px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}

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

.electives li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink-dim);
}

/* --- Inline links scoped to the detail page only --- */

.detail a:not(.link-btn) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-25);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--hover-dur) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .detail a:not(.link-btn):hover {
    text-decoration-color: var(--accent-warm);
  }
}

.detail a:not(.link-btn):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  text-decoration-color: var(--ink);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }

  .enter-zone {
    --reveal-y: 0px;
  }

  /* Skip the video fade-out in mode C for reduced motion. */
  [data-mode="C"] .video-wrap.is-fading { opacity: 0; }
}
