/* ============================================================
   40th BIRTHDAY REVEAL — styles
   ============================================================ */

/* ------------------------------------------------------------
   EDIT YOUR IMAGE PATHS HERE
   Drop landscape photos (2000px+ wide) into the images/ folder.
   Until then, each section shows a tasteful gradient fallback.
   ------------------------------------------------------------ */
:root {
  --img-hero:      url('../images/tom.jpg');
  --img-lookback:  url('../images/tomclaire1.jpg');
  --img-turn:      url('../images/turn.jpg');       /* sea/sky only — no boat, keep the reveal for Section 4 */
  --img-brunch:    url('../images/brunch.jpg');
  --img-boat:      url('../images/boat.png');        /* the Thunder boat photo */
  --img-watertoys: url('../images/watertoys.png');
  --img-calaconta: url('../images/calaconta.jpg');
  --img-sunset:    url('../images/sunset.jpg');
  --img-closing:   url('../images/tomclaire2.jpg');

  /* Palette */
  --sand:       #F2E8DC;
  --terracotta: #C4694A;
  --espresso:   #4A3427;
  --turquoise:  #3E8E8C;

  /* Gradient fallbacks (shown when a photo is missing) */
  --fb-hero:      linear-gradient(160deg, #4A8C9A, #2E6673);
  --fb-lookback:  linear-gradient(160deg, #C4694A, #7A3A26);
  --fb-turn:      linear-gradient(160deg, #5A7A82, #35505A);
  --fb-brunch:    linear-gradient(160deg, #D8A07A, #A55E3C);
  --fb-boat:      linear-gradient(160deg, #2E6673, #163842);
  --fb-watertoys: linear-gradient(160deg, #3E8E8C, #1E5450);
  --fb-calaconta: linear-gradient(160deg, #4FA0A6, #C4694A);
  --fb-sunset:    linear-gradient(160deg, #E08A5A, #7A2E1E);
  --fb-present:   linear-gradient(160deg, #D98C6A, #8A3E2A);
  --fb-cab:       linear-gradient(160deg, #5A7A82, #2E4E58);
  --fb-onboard:   linear-gradient(160deg, #2E6673, #163842);
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 300;
  color: var(--sand);
  background: var(--espresso);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------
   Panels (full-screen photo sections)
   ------------------------------------------------------------ */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 5rem);
  overflow: hidden;
  background-color: var(--espresso);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.panel--short { min-height: 70vh; min-height: 70svh; }

/* Photo panels where faces sit in the upper/centre of the frame: drop the
   text into the lower third so it never covers the picture, over a darker
   bottom band for readability. */
.panel--text-bottom { align-items: flex-end; }
.panel--text-bottom .panel__content { margin-bottom: clamp(3rem, 10vh, 6rem); }
.panel--text-bottom .overlay--bottom {
  background: linear-gradient(180deg, rgba(74,52,39,0) 0%, rgba(74,52,39,.12) 35%, rgba(74,52,39,.5) 62%, rgba(74,52,39,.86) 100%);
}

/* Hero holds a portrait photo of Tom — drop the text to the lower third
   so his face stays clear above it, over the darkened bottom band. */
.panel--hero { min-height: 100vh; min-height: 100svh; align-items: flex-end; }
.panel--hero .panel__content { margin-bottom: clamp(4.5rem, 14vh, 9rem); }

/* Desktop parallax: fixed backgrounds. Disabled on touch (see media query
   + .no-parallax class from JS) because iOS Safari renders it badly. */
@media (hover: hover) and (min-width: 900px) {
  .panel, .activity { background-attachment: fixed; }
}
body.no-parallax .panel,
body.no-parallax .activity { background-attachment: scroll; }

/* Background image slots with gradient fallback underneath */
.bg-hero      { background-image: var(--img-hero),      var(--fb-hero); }
.bg-lookback  { background-image: var(--img-lookback),  var(--fb-lookback); }
.bg-turn      { background-image: var(--img-turn),      var(--fb-turn); }
.bg-brunch    { background-image: var(--img-brunch),    var(--fb-brunch); }
.bg-boat      { background-image: var(--img-boat),      var(--fb-boat); }
.bg-watertoys { background-image: var(--img-watertoys), var(--fb-watertoys); }
.bg-calaconta { background-image: var(--img-calaconta), var(--fb-calaconta); }
.bg-present   { background-image: var(--fb-present); }
.bg-cab       { background-image: var(--fb-cab); }
.bg-onboard   { background-image: var(--fb-onboard); }
.bg-sunset    { background-image: var(--img-sunset),    var(--fb-sunset); }
.bg-closing   { background-image: var(--img-closing),   var(--fb-sunset); }

/* ------------------------------------------------------------
   Overlays (keep cream text readable on any photo)
   ------------------------------------------------------------ */
.overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.overlay--bottom { background: linear-gradient(180deg, rgba(74,52,39,.15) 0%, rgba(74,52,39,.3) 45%, rgba(74,52,39,.6) 70%, rgba(74,52,39,.82) 100%); }
.overlay--full   { background: radial-gradient(ellipse 130% 90% at center, rgba(74,52,39,.62) 0%, rgba(74,52,39,.5) 55%, rgba(74,52,39,.66) 100%); }
.overlay--center { background: radial-gradient(ellipse at center, rgba(74,52,39,.25) 0%, rgba(74,52,39,.6) 100%); }
.overlay--activity { background: linear-gradient(180deg, rgba(74,52,39,.32) 0%, rgba(74,52,39,.46) 50%, rgba(74,52,39,.66) 100%); }

/* ------------------------------------------------------------
   Content + typography
   ------------------------------------------------------------ */
.panel__content { position: relative; z-index: 2; max-width: 60rem; width: 100%; }
.align-center { text-align: center; }
.align-left   { text-align: left; }
.narrow { max-width: 34rem; margin: 0 auto; }

.label {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: clamp(.7rem, 2.6vw, .85rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #EAF6F4;
  margin-bottom: 1.1rem;
  text-shadow: 0 1px 3px rgba(20,14,10,.85), 0 2px 12px rgba(20,14,10,.6);
}

.headline {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  line-height: 1.12;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  color: var(--sand);
  text-shadow: 0 2px 24px rgba(30,20,14,.45), 0 1px 4px rgba(30,20,14,.5);
}
.italic { font-style: italic; font-weight: 400; }

.subtext {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 3.4vw, 1.4rem);
  letter-spacing: .02em;
  color: rgba(242,232,220,.9);
  margin-top: 1.4rem;
}

.signoff {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(.95rem, 3vw, 1.2rem);
  color: var(--terracotta);
  margin-top: 2rem;
}

/* Memory beats (section 2) */
.memory {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 5.5vw, 2.6rem);
  line-height: 1.35;
  color: var(--sand);
  margin: 1.6rem 0;
  text-shadow: 0 2px 24px rgba(30,20,14,.35);
}
.memory .italic { color: var(--sand); }

/* ------------------------------------------------------------
   Section 4 — Itinerary timeline
   ------------------------------------------------------------ */
.itinerary { position: relative; }

/* Line geometry — single source of truth for line + dot alignment */
:root { --line-x: 34px; }
@media (min-width: 700px) { :root { --line-x: 64px; } }

.timeline {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--line-x);
  width: 2px;
  z-index: 5;
  pointer-events: none;
}
.timeline__line {
  position: absolute;
  inset: 0;
  background: rgba(242,232,220,.28);
}
.timeline__progress {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;                 /* grown by JS as you scroll */
  background: var(--turquoise);
  box-shadow: 0 0 12px rgba(62,142,140,.7);
  transition: height .1s linear;
}

.activity {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;              /* text sits level with its timeline dot */
  background-color: var(--espresso);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: clamp(2rem, 8vh, 6rem) clamp(1.5rem, 5vw, 4rem)
           clamp(2rem, 8vh, 6rem) calc(var(--line-x) + clamp(1.5rem, 5vw, 3rem));
  overflow: hidden;
}

/* Dot sits exactly on the line, vertically centred in each panel */
.activity__dot {
  position: absolute;
  left: var(--line-x);
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--espresso);
  border: 2px solid rgba(242,232,220,.6);
  transform: translate(-50%, -50%) scale(.8);
  z-index: 6;
  transition: transform .5s ease, background .5s ease, border-color .5s ease, box-shadow .5s ease;
}
.activity.in-view .activity__dot {
  background: var(--turquoise);
  border-color: var(--sand);
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 0 6px rgba(62,142,140,.25), 0 0 18px rgba(62,142,140,.6);
}

.activity__content { position: relative; z-index: 2; max-width: 40rem; }
.activity__title {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  line-height: 1.15;
  font-size: clamp(1.7rem, 5.6vw, 3rem);
  color: var(--sand);
  text-shadow: 0 2px 24px rgba(30,20,14,.4);
}
.activity .label { margin-bottom: .8rem; }
.activity .subtext { margin-top: .8rem; }

/* ------------------------------------------------------------
   Scroll cue (hero)
   ------------------------------------------------------------ */
.scroll-cue {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3rem);
  left: 0;
  right: 0;                 /* centre via flexbox, not transform, so the
                               reveal animation's transform can't shift it */
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: rgba(242,232,220,.75);
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.scroll-cue svg { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ------------------------------------------------------------
   Reveal-on-scroll (fade + rise)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }
.delay-1 { transition-delay: .18s; }
.delay-2 { transition-delay: .36s; }
.delay-3 { transition-delay: .54s; }

/* Stagger the three memory beats */
.bg-lookback .memory:nth-child(1) { transition-delay: 0s; }
.bg-lookback .memory:nth-child(2) { transition-delay: .35s; }
.bg-lookback .memory:nth-child(3) { transition-delay: .7s; }

/* ------------------------------------------------------------
   Intro gate ("tap to begin")
   ------------------------------------------------------------ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  cursor: pointer;
  background: radial-gradient(ellipse 120% 90% at center, #2E6673 0%, #1B3A44 70%, #142C34 100%);
  transition: opacity 1s ease, visibility 1s ease;
}
.intro.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__inner { animation: introRise 1.4s cubic-bezier(.2,.7,.2,1) both; }
.intro__label {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  color: var(--sand);
  text-shadow: 0 2px 24px rgba(20,20,14,.4);
}
.intro__cue {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: .74rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(242,232,220,.8);
  animation: introPulse 2.4s ease-in-out infinite;
}
.intro__note { display: inline-flex; color: var(--turquoise); }
@keyframes introRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes introPulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .intro__inner { animation: none; }
  .intro__cue { animation: none; opacity: .85; }
}

/* ------------------------------------------------------------
   Audio toggle
   ------------------------------------------------------------ */
.audio-toggle {
  position: fixed;
  bottom: clamp(1rem, 3vh, 1.6rem);
  right: clamp(1rem, 3vw, 1.6rem);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border: 1px solid rgba(242,232,220,.35);
  border-radius: 999px;
  background: rgba(74,52,39,.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--sand);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
}
.audio-toggle:hover { background: rgba(74,52,39,.65); border-color: rgba(242,232,220,.6); }
.audio-icon { display: inline-flex; }
/* Default = muted: show the slash, dim the notes */
.audio-toggle .ic-mute { opacity: 1; }
.audio-toggle .ic-note { opacity: .55; }
.audio-toggle[aria-pressed="true"] .ic-mute { opacity: 0; }
.audio-toggle[aria-pressed="true"] .ic-note { opacity: 1; }
.audio-toggle[aria-pressed="true"] { border-color: var(--turquoise); }

/* ------------------------------------------------------------
   Accessibility: respect reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .scroll-cue svg { animation: none; }
  .timeline__progress { transition: none; }
}
