/* Diegofest 2026: a festival poster at sunset on the Caribbean.
   The hero is a scene built in layers (sky, sun, sea, shore, palms); the sun's
   height comes from --e, set by app.js from the time left until the lineup. */

@font-face { font-family: "Barlow"; src: url(assets/fonts/barlow-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(assets/fonts/barlow-condensed-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(assets/fonts/barlow-condensed-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(assets/fonts/barlow-condensed-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Mansalva"; src: url(assets/fonts/mansalva.woff2) format("woff2"); font-weight: 400; font-display: swap; }

@property --e { syntax: "<number>"; inherits: true; initial-value: 0.6; }

:root {
  --ink: #1c130d;
  --cream: #fff4e1;
  --orange: #ec7d34;
  --aqua: #5fd3c3;
  --gutter: 20px;
  --body: "Barlow", "Avenir Next", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --brush: "Mansalva", "Marker Felt", cursive;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wm-ratio: 1296 / 173;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Overscroll shows sky above the page and the footer's ink below it. */
  background: linear-gradient(180deg, #e8712f 50%, var(--ink) 50%);
}
body {
  margin: 0;
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; }
a { color: inherit; }
p, h1 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* ---------- Hero scene ---------- */
.hero {
  --hz: 29%;                                 /* horizon height from the bottom */
  --rise: calc((100% - var(--hz)) * 0.56);   /* sun travel above the horizon */
  --sun: clamp(120px, 34vw, 250px);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  transition: --e 2.4s var(--ease-out);
}
.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e8712f 0%, #ee863b 34%, #f39f52 62%, #f8c07a calc(100% - var(--hz)));
}
.sky::before {          /* dusk: takes over as the sun drops */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #d24f39 0%, #e2653d 36%, #ee8150 64%, #f7a57e calc(100% - var(--hz)));
  opacity: calc((1 - var(--e)) * 0.85);
}
.sky::after {           /* painted streaks */
  content: "";
  position: absolute;
  inset: 0;
  background: url(assets/sky.webp) center / cover;
  mix-blend-mode: soft-light;
  opacity: 0.7;
}
.sun-glow, .sun {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hz) + var(--e) * var(--rise));
  border-radius: 50%;
  transform: translate(-50%, 50%);
}
.sun-glow {
  width: calc(var(--sun) * 4.6);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 238, 185, 0.8), rgba(255, 210, 140, 0.38) 38%, rgba(255, 186, 120, 0.12) 66%, rgba(255, 170, 110, 0) 100%);
  mix-blend-mode: screen;
}
.sun {
  width: var(--sun);
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 42%, #fffbf0 0%, #fff1c8 40%, #ffdc92 80%, #ffcd7a 100%);
  box-shadow: 0 0 46px 10px rgba(255, 236, 190, 0.5);
}
.sun::after {           /* the sun reddens near the water */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffd48f 0%, #ffa45f 72%, #ff8c55 100%);
  opacity: calc((1 - var(--e)) * 0.9);
}
.sea {
  position: absolute;
  inset: auto 0 0;
  height: var(--hz);
  overflow: hidden;
  background: linear-gradient(180deg, #0d5a63 0%, #0f7279 16%, #13959a 46%, #28b2aa 74%, #5ccdbe 100%);
}
.sea::before {          /* bright horizon line */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 214, 160, 0), rgba(255, 214, 160, 0.65) 30%, rgba(255, 244, 210, 0.95) 50%, rgba(255, 214, 160, 0.65) 70%, rgba(255, 214, 160, 0));
  z-index: 2;
}
.sea::after {           /* warm sheen near the horizon */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 170, 110, 0.45), rgba(255, 170, 110, 0) 55%);
  mix-blend-mode: soft-light;
}
.waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: drift 16s ease-in-out infinite alternate;
}
.waves path { fill: none; stroke: #eafffb; stroke-opacity: calc(var(--o) * 0.9); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 90 40 30 70; vector-effect: non-scaling-stroke; }
.waves path:nth-child(2n) { stroke-dasharray: 50 80 120 30; }
.waves path:nth-child(3n) { stroke-dasharray: 140 50 20 60; }
.glitter {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(84vw, 560px);
  height: 92%;
  transform: translateX(-50%);
  fill: #fff0c8;
  opacity: calc(0.75 + (1 - var(--e)) * 0.25);
}
.glitter rect { animation: twinkle 2.6s ease-in-out infinite; }
.glitter .g1 { animation-duration: 3.4s; animation-delay: -1.2s; }
.glitter .g2 { animation-duration: 1.9s; animation-delay: -0.6s; }
.shore {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: max(100%, 980px);
  height: 12%;
  transform: translateX(-50%);
}
.foam { fill: none; stroke: #fffaf0; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.foam-front { stroke-width: 3; opacity: 0.9; }
.foam-back { stroke-width: 2; opacity: 0.45; animation: lap 6s ease-in-out infinite; }
.palms { position: absolute; inset: 0; pointer-events: none; }
.palm {
  position: absolute;
  bottom: 3%;
  width: auto;
  aspect-ratio: 2 / 3;
  fill: #1a140e;
  transform-origin: 50% 100%;
  animation: sway 8s ease-in-out infinite alternate;
}
.p1 { height: 33%; left: -16%; }
.p2 { height: 22%; left: 5%; bottom: 2%; animation-delay: -3s; animation-duration: 7s; }
.p3 { height: 30%; right: -15%; animation-delay: -5s; }
.p4 { display: none; }

/* Grain over the whole poster. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: url(assets/grain.webp);
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

.hero-content {
  position: absolute;
  inset: 0 0 var(--hz);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px var(--gutter) 28px;
  text-align: center;
}
.edition {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 13px/1 var(--cond);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding-left: 0.3em;
}
.edition svg { width: 12px; height: 12px; fill: currentColor; }
.wordmark { margin-top: 16px; width: min(100%, 940px); }
.wordmark svg { width: 100%; height: auto; aspect-ratio: var(--wm-ratio); color: var(--ink); }
.tagline {
  margin-top: 14px;
  font: 700 clamp(10px, 2.85vw, 18px)/1.2 var(--cond);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dates {
  margin-top: 8px;
  font: 800 clamp(20px, 5.6vw, 34px)/1 var(--cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dates span { opacity: 0.45; padding: 0 0.15em; }

.countdown { margin-top: clamp(26px, 5vh, 46px); display: flex; flex-direction: column; align-items: center; }
.cd-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 800 15px/1 var(--cond);
  letter-spacing: 0.42em;
  text-transform: uppercase;
}
.cd-label span { margin-right: -0.42em; }
.cd-label::before, .cd-label::after { content: ""; width: 44px; height: 2px; background: currentColor; opacity: 0.5; }
.cd-grid { display: flex; align-items: flex-start; gap: clamp(6px, 2vw, 18px); margin-top: 10px; }
.cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 2.1ch; }
.cd-num {
  font: 800 clamp(46px, 14.5vw, 112px)/0.92 var(--cond);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.cd-name {
  margin-top: 4px;
  font: 700 12px/1 var(--cond);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding-left: 0.24em;
}
.cd-sep { font: 700 clamp(32px, 9vw, 74px)/1 var(--cond); opacity: 0.35; margin-top: 0.08em; }
.no-days .cd-num { font-size: clamp(64px, 20vw, 128px); }
.no-days .cd-sep { font-size: clamp(44px, 13vw, 84px); }
.countdown.no-days .cd-days { display: none; }
.cd-when {
  margin-top: 16px;
  font: 700 clamp(14px, 3.6vw, 18px)/1 var(--cond);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.cd-live { display: none; }
.cd-live-title { font: 400 clamp(38px, 10vw, 72px)/1 var(--brush); -webkit-text-stroke: 0.02em currentColor; }
.cd-live-sub { margin-top: 10px; font: 700 clamp(15px, 3.8vw, 19px)/1.3 var(--cond); letter-spacing: 0.12em; text-transform: uppercase; }
.is-live .cd-grid, .is-live .cd-label, .is-live .cd-when { display: none; }
.is-live .cd-live { display: block; }

/* ---------- Dale play: the music on and off ---------- */
.play {
  position: absolute;
  padding: 0;
  border: 0;
  font: inherit;
  cursor: pointer;
  z-index: 4;
  left: 50%;
  bottom: calc(var(--hz) * 0.62);
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--ink), 0 12px 26px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 50%);
  transition: transform 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  animation: fade 0.8s ease 1.5s both;
}
.play:hover { transform: translate(-50%, 50%) scale(1.07); }
.play:active { transform: translate(-50%, 50%) scale(0.96); }
.play::after {          /* a ripple that keeps inviting a tap */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 225, 0.85);
  animation: ripple 2.4s ease-out infinite;
  pointer-events: none;
}
.play-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.play-ring text { font: 800 11px var(--cond); letter-spacing: 0.1em; fill: var(--ink); }
.play-core { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); }
.play-core svg { width: 20px; height: 20px; fill: var(--cream); transform: translateX(2px); }
.eq { display: none; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 4px; height: 6px; border-radius: 2px; background: var(--cream); animation: eq 0.8s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -0.35s; animation-duration: 0.6s; }
.eq i:nth-child(3) { animation-delay: -0.6s; animation-duration: 0.9s; }
.is-playing .eq { display: flex; }
.is-playing .ico-play { display: none; }

/* ---------- Gate: the cabana door with a zipper (drawn by gate.js) ---------- */
.gate { display: none; }
.is-gate .gate, .gate.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  transition: opacity 0.35s ease;
}
.is-gate body { overflow: hidden; }
.gate canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.is-pulling .gate canvas { cursor: grabbing; }
.gate.is-open { pointer-events: none; }
.gate-key {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font: 700 14px/1 var(--cond);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
.gate-key:focus-visible { opacity: 1; pointer-events: auto; outline-color: var(--cream); }
/* The poster's words wait behind the door, then paint in as it opens. */
.is-gate .hero-content *, .is-gate .play, .is-gate .play *, .is-gate .play::after { animation-play-state: paused; }

/* ---------- Footer ---------- */
.foot {
  padding: 56px var(--gutter) calc(56px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: rgba(255, 244, 225, 0.75);
  text-align: center;
  font: 700 13px/1.6 var(--cond);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.foot-wm { width: min(520px, 84vw); height: auto; aspect-ratio: var(--wm-ratio); margin: 0 auto 24px; color: var(--orange); }
.foot-tag { margin-top: 8px; color: var(--aqua); }
.foot-credit { margin-top: 18px; font-size: 11px; color: rgba(255, 244, 225, 0.5); }
.foot-credit a { color: inherit; text-underline-offset: 3px; }

/* ---------- Entrance ---------- */
.edition, .tagline, .dates, .countdown { animation: rise 0.9s var(--ease-out) both; }
.edition { animation-delay: 0.1s; }
.tagline { animation-delay: 0.75s; }
.dates { animation-delay: 0.85s; }
.countdown { animation-delay: 1.05s; }
.wordmark svg { animation: paint 1.2s cubic-bezier(0.6, 0, 0.2, 1) 0.2s both; }
.sun, .sun-glow { animation: fade 2.2s var(--ease-out) both; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes paint { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sway { from { transform: rotate(-0.9deg); } to { transform: rotate(0.9deg); } }
@keyframes sway-flip { from { transform: scaleX(-1) rotate(-0.9deg); } to { transform: scaleX(-1) rotate(0.9deg); } }
@keyframes drift { from { transform: translateX(-2.5%); } to { transform: translateX(2.5%); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes lap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq { to { height: 18px; } }

@media (min-width: 960px) {
  .hero { --hz: 27%; --sun: clamp(170px, 17vw, 270px); }
  .hero-content { padding-top: 72px; }
  .wordmark { width: min(64vw, 940px); }
  .p1 { height: 58%; left: -4%; }
  .p2 { height: 37%; left: 13%; }
  .p3 { height: 50%; right: -3%; }
  .p4 { display: block; height: 32%; right: 15%; bottom: 2%; transform: scaleX(-1); animation-name: sway-flip; animation-delay: -2s; }
  .play { width: 120px; height: 120px; }
  .play-core { width: 52px; height: 52px; }
}

@media (min-width: 960px) and (max-height: 760px) {
  .hero { --hz: 25%; }
  .wordmark { width: min(56vw, 820px); }
  .cd-num { font-size: 92px; }
  .p1 { height: 52%; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero-content { padding-top: 28px; }
  .wordmark { width: min(58vw, 620px); margin-top: 10px; }
  .tagline { font-size: 12px; }
  .dates { font-size: 20px; }
  .countdown { margin-top: 18px; }
  .no-days .cd-num, .cd-num { font-size: 64px; }
  .no-days .cd-sep, .cd-sep { font-size: 44px; }
  .play { width: 88px; height: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
