/* Berbania coming-soon page: the Ibong Adarna above the Piedras Platas tree, at night. */

/* Plumage colors are registered so they fade from one song to the next instead of jumping. */
@property --a { syntax: "<color>"; inherits: true; initial-value: #f6efe2; }
@property --b { syntax: "<color>"; inherits: true; initial-value: #dcc9ab; }
@property --c { syntax: "<color>"; inherits: true; initial-value: #fff8ea; }

:root {
  color-scheme: dark;
  --night: #0b0a24;
  --indigo: #1a1446;
  --violet: #3a1b63;
  --ember: #8a2f5c;
  --gold: #f2c14e;
  --silver: #e4e9f7;
  --text: #f3eee2;
  --muted: #bdb6d6;
  --cycle: 28s;
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  background: var(--night);
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Sky */
.sky {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(120% 60% at 50% 108%, rgba(242, 141, 78, .5), rgba(138, 47, 92, .45) 34%, transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--indigo) 42%, var(--violet) 76%, var(--ember) 100%);
}
.stars { position: absolute; inset: 0; background-repeat: repeat; }
.stars-a {
  background-image:
    radial-gradient(1.4px 1.4px at 22px 34px, #fff, transparent 60%),
    radial-gradient(1px 1px at 130px 88px, #dfe6ff, transparent 60%),
    radial-gradient(1.6px 1.6px at 210px 160px, #fff3cf, transparent 60%),
    radial-gradient(1px 1px at 300px 40px, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 70px 210px, #cfd8ff, transparent 60%),
    radial-gradient(1px 1px at 260px 250px, #fff, transparent 60%);
  background-size: 340px 300px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 82%);
  animation: twinkle 5s ease-in-out infinite alternate;
}
.stars-b {
  background-image:
    radial-gradient(1px 1px at 60px 120px, #fff, transparent 60%),
    radial-gradient(1.8px 1.8px at 180px 30px, #ffe9b0, transparent 60%),
    radial-gradient(1px 1px at 330px 200px, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 400px 90px, #d8ccff, transparent 60%);
  background-size: 460px 380px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 78%);
  animation: twinkle 7s ease-in-out -3s infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }

/* Mount Tabor and the dark forest */
.land {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(150px, 30vh, 320px);
  z-index: -2;
}
.ridge.far { fill: #2c1650; opacity: .75; }
.ridge.mid { fill: #1b0f3a; }
.ridge.near { fill: #090717; }

/* Layout */
.stage {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(12px, 3vh, 40px) 20px 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.art { margin: 0; width: min(100%, 52vh, 440px); }
.art svg { display: block; width: 100%; height: auto; overflow: visible; }
.art figcaption {
  position: relative;
  margin-top: 8px;
  font-style: italic;
  font-size: .95rem;
  color: var(--muted);
  opacity: .85;
}
.words { max-width: 34rem; padding-bottom: 12px; }

.eyebrow {
  margin: 14px 0 6px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 .5em .15em;
  transform: rotate(45deg);
  background: var(--gold);
}
h1 {
  margin: 0;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.7rem, 12vw, 5.6rem);
  line-height: 1.05;
  letter-spacing: .03em;
  color: transparent;
  background: linear-gradient(180deg, #fff6d8 10%, var(--gold) 55%, #c9772e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 18px rgba(242, 193, 78, .28));
}
.lede {
  margin: 10px 0 0;
  font-size: clamp(1.4rem, 4.6vw, 1.9rem);
  font-style: italic;
  color: var(--silver);
}
.story { margin: 14px auto 0; color: var(--text); opacity: .92; text-wrap: pretty; }

/* The seven plumages */
.gems { display: flex; justify-content: center; gap: 18px; margin: 26px 0 8px; padding: 0; list-style: none; }
.gem {
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  background: var(--g);
  opacity: .32;
  animation: gem var(--cycle) linear infinite;
}
.g1 { --g: #f6efe2; animation-delay: 0s; }
.g2 { --g: #4a8ef0; animation-delay: calc(var(--cycle) / -7 * 6); }
.g3 { --g: #25c48a; animation-delay: calc(var(--cycle) / -7 * 5); }
.g4 { --g: #cfe9ff; animation-delay: calc(var(--cycle) / -7 * 4); }
.g5 { --g: #f0a53c; animation-delay: calc(var(--cycle) / -7 * 3); }
.g6 { --g: #b28cff; animation-delay: calc(var(--cycle) / -7 * 2); }
.g7 { --g: #f0425c; animation-delay: calc(var(--cycle) / -7 * 1); }
@keyframes gem {
  0%, 10.7% { opacity: 1; transform: rotate(45deg) scale(1.5); box-shadow: 0 0 16px 2px var(--g); }
  14.3%, 96.4% { opacity: .32; transform: rotate(45deg) scale(1); box-shadow: none; }
  100% { opacity: 1; transform: rotate(45deg) scale(1.5); box-shadow: 0 0 16px 2px var(--g); }
}
.songs {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot {
  padding: 18px 20px 22px;
  text-align: center;
  font-size: .85rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #cfc8e6;
  text-shadow: 0 1px 6px #000;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Artwork */
.moon { fill: #fff1c9; opacity: .1; }
.halo { animation: breathe 9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { from { opacity: .75; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }

.tree { filter: drop-shadow(0 0 10px rgba(214, 226, 255, .35)); }
.branches path, .root { fill: none; stroke: #c9d2e8; stroke-linecap: round; }
.root { stroke-width: 7; stroke: #9aa4c0; }
.mound-rim { fill: none; stroke: #cfd8f0; stroke-width: 1.5; opacity: .35; }
.leaf.s1 { fill: #ffffff; }
.leaf.s2 { fill: #cdd7ee; }
.leaf.s3 { fill: #9eabd0; }
.leaf { animation: glint 4.2s ease-in-out infinite; }
.tw1 { animation-delay: -0.4s; }
.tw2 { animation-delay: -1.3s; }
.tw3 { animation-delay: -2.1s; }
.tw4 { animation-delay: -2.9s; }
.tw5 { animation-delay: -3.6s; }
@keyframes glint { 0%, 70%, 100% { opacity: .78; } 82% { opacity: 1; filter: brightness(1.6); } 90% { opacity: .5; } }

/* The bird */
.bird {
  transform-box: view-box;
  animation: plumage var(--cycle) ease-in-out infinite, hover 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c) 60%, transparent));
}
.fill-a { fill: var(--a); }
.fill-b { fill: var(--b); }
.fill-c { fill: var(--c); }
.stroke-b, .stroke-c, .sheen, .veins, .legs { fill: none; stroke-linecap: round; }
.stroke-b { stroke: var(--b); }
.stroke-c { stroke: var(--c); }
.crest .stroke-c { stroke-width: 3; }
.sheen { stroke: #fff; stroke-width: 1.4; opacity: .4; }
.veins { stroke: #fff; stroke-width: 1.2; opacity: .3; }
.belly { fill: #fff; opacity: .28; }
.gold { fill: var(--gold); }
.legs { stroke: var(--gold); stroke-width: 3; }
.eye { fill: #120c22; }
.glint { fill: #fff; }
.far-wing { filter: brightness(.68); }

.wing { transform-box: view-box; transform-origin: 296px 203px; animation: flap 1.5s ease-in-out infinite; }
.far-wing { animation-delay: -.09s; }
@keyframes flap {
  0%, 100% { transform: rotate(6deg) scaleY(1); }
  50% { transform: rotate(-10deg) scaleY(-.62); }
}
@keyframes hover {
  0%, 100% { translate: 0 7px; }
  50% { translate: 0 -7px; }
}

.tail { transform-box: view-box; transform-origin: 358px 238px; animation: sway 5s ease-in-out infinite alternate; }
.tail1 { animation-duration: 4.2s; }
.tail2 { animation-duration: 5.4s; animation-delay: -1s; }
.tail3 { animation-duration: 4.8s; animation-delay: -2s; }
.tail4 { animation-duration: 5.9s; animation-delay: -.5s; }
.tail5 { animation-duration: 4.5s; animation-delay: -1.6s; }
@keyframes sway { from { transform: rotate(-3.5deg); } to { transform: rotate(4deg); } }

/* Seven songs: pearl, sapphire, emerald, diamond, copper-gold, amethyst, ruby. */
@keyframes plumage {
  0%, 10.7% { --a: #f6efe2; --b: #dcc9ab; --c: #fff8ea; }
  14.3%, 25% { --a: #4a8ef0; --b: #1f4fb0; --c: #8ed8ff; }
  28.6%, 39.3% { --a: #25c48a; --b: #0c7f5e; --c: #9af5bd; }
  42.9%, 53.6% { --a: #d6ecff; --b: #93bfee; --c: #ffffff; }
  57.1%, 67.9% { --a: #f0a53c; --b: #c25f28; --c: #ffdc8e; }
  71.4%, 82.1% { --a: #b28cff; --b: #7447dc; --c: #e8daff; }
  85.7%, 96.4% { --a: #f0425c; --b: #a8142f; --c: #ffa27f; }
  100% { --a: #f6efe2; --b: #dcc9ab; --c: #fff8ea; }
}

/* Light falling from the tail */
.mote { fill: var(--gold); opacity: 0; transform-box: fill-box; transform-origin: center; animation: fall 6s linear infinite; }
.m2 { animation-delay: -1s; }
.m3 { animation-delay: -2.2s; }
.m4 { animation-delay: -3.1s; }
.m5 { animation-delay: -4s; }
.m6 { animation-delay: -5s; }
@keyframes fall {
  0% { opacity: 0; transform: translateY(-30px) scale(.3) rotate(0deg); }
  20% { opacity: .9; }
  100% { opacity: 0; transform: translateY(150px) scale(.7) rotate(160deg); }
}

/* Page not found */
.notfound { max-width: 34rem; margin: 22vh auto 0; padding: 0 20px; text-align: center; }
.notfound h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
a { color: var(--gold); }

/* Wide screens: words on the left, the tree on the right */
@media (min-width: 900px) {
  .stage { grid-template-columns: 1fr 1fr; gap: 32px; text-align: left; padding-top: 24px; }
  .words { order: 1; justify-self: start; padding-bottom: 6vh; }
  .art { order: 2; width: min(100%, 64vh, 600px); }
  .art figcaption {
  position: relative; text-align: center; }
  .story { margin-left: 0; }
  .gems { justify-content: flex-start; padding-left: 6px; }
  h1 { font-size: clamp(3.6rem, 6.4vw, 5.8rem); }
}

@media (prefers-reduced-motion: reduce) {
  .stars, .halo, .leaf, .bird, .wing, .tail, .mote, .gem { animation: none; }
  .mote { opacity: 0; }
  .g1 { opacity: 1; }
}
