/* The Rafa Way — clay court theme */

:root {
  --clay: #b94a2a;          /* Roland Garros clay — slightly redder/earthier */
  --clay-dark: #92381f;     /* Darker clay for value slides */
  --line-white: #f8f4ee;    /* Court line color */
  --navy: #1a3a5c;          /* Accent for buttons/headings */
  --text-dark: #2a1810;     /* Body text on light backgrounds */
}

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

html, body {
  height: 100%;
  font-family: 'Georgia', serif;
  color: var(--line-white);
  overflow: hidden;
}

body {
  background-color: var(--clay);
  background-image:
    /* Court lines (top layer) */
    url("../assets/images/court.svg"),
    /* Clay grit — fine speckle that suggests crushed-brick surface */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.25  0 0 0 0 0.15  0 0 0 0.18 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>"),
    /* Vignette so the centre of the page stays the visual focus */
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.28) 100%);
  background-size: cover, 220px 220px, cover;
  background-position: center, top left, center;
  background-repeat: no-repeat, repeat, no-repeat;
  background-attachment: fixed;
}

h1, h2 {
  font-family: 'Impact', 'Arial Black', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 4vh 6vw;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0s linear 0.5s;
}

.section.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
  transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
              visibility 0s linear 0s;
}

/* Keep the clay court visible throughout — value slides no longer override the bg. */

/* Home title and bridge are matched: same italic narrative voice, same size, but
   the title sits at the top of the screen and the bridge sits at the bottom. */
.home__opener,
.home__bridge {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  text-align: center;
  letter-spacing: 0;
  line-height: 1.25;
  opacity: 0.94;
  max-width: 1100px;
}

#home {
  justify-content: space-between;
  padding-top: 6vh;
  padding-bottom: 6vh;
}

.home__title {
  font-size: clamp(3.5rem, 9vw, 8rem);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.35), 0 0 40px rgba(255,215,0,0.3);
  margin-bottom: 1rem;
  text-align: center;
}

.home__cue {
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  text-align: center;
  margin-top: 1rem;
}

.values {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
  margin: 0;
  width: min(1000px, 92vw);
}

.value-item {
  font-family: -apple-system, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--line-white);
  text-align: center;
  text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.05s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 1.05s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.pop-in {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.85s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.pop-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================ */
/* Slide 2: Rafa reveal — 2x2 landscape grid + RAFAEL NADAL overlaid at the centre */
/* ============================================================ */
.section--rafa {
  padding: 4vh 5vw;
}

.rafa-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.2rem;
  width: min(1200px, 95vw);
  height: min(740px, 88vh);
}

.rafa-grid__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(248,244,238,0.18);
}

.rafa-grid__title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 1.6rem 3rem;
  text-align: center;
  background: rgba(20, 12, 8, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(248,244,238,0.18);
  z-index: 2;
}

.rafa-grid__title h1 {
  font-family: -apple-system, 'SF Pro Display', system-ui, sans-serif;
  font-size: clamp(2rem, 5.5vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--line-white);
  text-shadow: 0 4px 24px rgba(0,0,0,0.55);
}

/* ============================================================ */
/* Slide 3, 7, 11: Value intro — just the value text, centered   */
/* ============================================================ */
.section--value-intro {
  justify-content: center;
}

.value-intro__title {
  font-family: -apple-system, 'SF Pro Display', system-ui, sans-serif;
  font-size: clamp(3rem, 8vw, 7.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none;
  text-align: center;
  text-shadow: 0 8px 40px rgba(0,0,0,0.4);
  max-width: 1200px;
  line-height: 1.02;
}

/* ============================================================ */
/* Slides 4-6, 8-10, 12-14: Story slides                         */
/* Value title at top, photo on left, cumulative stories right.  */
/* Past stories are dimmed, the current story stands out.        */
/* ============================================================ */
.section--story {
  justify-content: flex-start;
  padding: 4vh 6vw;
}

.story__title {
  font-family: -apple-system, 'SF Pro Display', system-ui, sans-serif;
  font-size: clamp(1.8rem, 4.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-transform: none;
  text-align: center;
  margin-bottom: 2.8rem;
  text-shadow: 0 6px 28px rgba(0,0,0,0.35);
}

.story__body {
  display: flex;
  gap: 3.5rem;
  align-items: center;
  max-width: 1240px;
  width: 100%;
  flex: 1;
}

.story__photo {
  width: clamp(240px, 36vw, 440px);
  height: auto;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(248,244,238,0.18);
}

.story__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif;
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  line-height: 1.55;
  letter-spacing: -0.005em;
  flex: 1;
  padding: 1.75rem 2rem;
  background: rgba(20, 12, 8, 0.42);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.32), inset 0 0 0 1px rgba(248,244,238,0.14);
}

.story__item {
  padding-left: 1.9rem;
  position: relative;
  transition: opacity 0.45s ease-out;
}

.story__item::before {
  content: "🎾";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-size: 0.95em;
}

.story__item--past {
  opacity: 0.5;
}

.story__item--current {
  opacity: 1;
}

.story__item strong {
  font-weight: 700;
}

/* ============================================================ */
/* YouTube embed slide (used by closing — full-bleed video frame) */
/* ============================================================ */
.section--youtube {
  padding: 0;
  justify-content: center;
  align-items: stretch;
}

.youtube-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.youtube-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.youtube-placeholder {
  text-align: center;
  font-family: 'Impact', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  letter-spacing: 0.05em;
  color: var(--line-white);
  padding: 2rem;
}

.youtube-placeholder small {
  display: block;
  font-family: 'Georgia', serif;
  font-size: 0.5em;
  margin-top: 1.5rem;
  opacity: 0.7;
  font-style: italic;
}

.youtube-placeholder code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.95em;
  background: rgba(255,255,255,0.12);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* When a video id is set, show the iframe and hide the placeholder */
.section--youtube[data-youtube-id]:not([data-youtube-id=""]) .youtube-iframe {
  display: block;
}
.section--youtube[data-youtube-id]:not([data-youtube-id=""]) .youtube-placeholder {
  display: none;
}

.mute-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.05rem;
  background: rgba(20, 12, 8, 0.45);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  color: var(--line-white);
  border: none;
  box-shadow: inset 0 0 0 1px rgba(248,244,238,0.25), 0 6px 18px rgba(0,0,0,0.3);
  border-radius: 999px;
  cursor: pointer;
  z-index: 100;
  transition: background 0.2s ease, transform 0.2s ease;
}
.mute-btn:hover { background: rgba(20, 12, 8, 0.7); transform: scale(1.04); }

