/* Boi — one Duun day. The sky is the app: it changes as you scroll. */

:root {
  --skyA: #2a1a2f;
  --skyB: #c96a50;
  --hillfar: #4a2c18;
  --hillnear: #2c1a0d;
  --cream: #f6ecd9;
  --cream-dim: #d9c6a8;
  --gold: #d9a441;
  --ink: #241b14;
  --star-op: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

body {
  background: var(--skyA);
  color: var(--cream);
  font-family: "Jost", system-ui, sans-serif;
}

[lang^="dux"] { font-family: "Andika", sans-serif; }

/* ---------- fixed sky ---------- */

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--skyA) 0%, var(--skyB) 78%);
  transition: background 0.4s linear;
  overflow: hidden;
  pointer-events: none;
}

#stars {
  position: absolute;
  inset: 0;
  opacity: var(--star-op);
  transition: opacity 0.5s;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #f6ecd9 50%, transparent 60%),
    radial-gradient(1.1px 1.1px at 34% 8%, #f6ecd9 50%, transparent 60%),
    radial-gradient(1.6px 1.6px at 58% 22%, #e8c168 50%, transparent 60%),
    radial-gradient(1px 1px at 72% 12%, #f6ecd9 50%, transparent 60%),
    radial-gradient(1.3px 1.3px at 86% 28%, #f6ecd9 50%, transparent 60%),
    radial-gradient(1.2px 1.2px at 22% 38%, #f6ecd9 50%, transparent 60%),
    radial-gradient(1.5px 1.5px at 66% 42%, #e8c168 50%, transparent 60%),
    radial-gradient(1px 1px at 44% 32%, #f6ecd9 50%, transparent 60%);
}

#sun {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  left: calc(var(--sun-x, 8%) - 60px);
  top: calc(var(--sun-y, 70%) - 60px);
  background: radial-gradient(circle, #f5e2b0 0%, #e8b74f 45%, rgba(232, 183, 79, 0.35) 65%, transparent 78%);
  filter: blur(1.5px);
}

#moon {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  right: 12%;
  top: 16%;
  background: radial-gradient(circle at 60% 40%, #f2ead6, #cfc4a6 70%);
  box-shadow: 0 0 34px rgba(242, 234, 214, 0.5);
  opacity: var(--star-op);
  transition: opacity 0.5s;
}

#moon::before {
  content: "";
  position: absolute;
  left: -12%;
  top: -6%;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: var(--skyA);
  transition: background 0.4s linear;
}

#hills-far, #hills-near {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
}

#hills-far { height: 130px; color: var(--hillfar); transition: color 0.4s linear; }
#hills-near { height: 100px; color: var(--hillnear); transition: color 0.4s linear; }

/* ---------- intro ---------- */

#intro {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 26px 120px;
  text-align: center;
}

#intro h1 {
  font-size: 4.2rem;
  font-weight: 400;
  color: var(--cream);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
}

#intro .sub { font-size: 1.02rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-dim); font-weight: 500; }

.start-hint { margin-top: 60px; font-size: 0.95rem; color: var(--cream); font-weight: 500; line-height: 1.7; animation: bob 2.4s ease-in-out infinite; }
.start-hint .small { font-size: 0.78rem; color: var(--cream-dim); }

@keyframes bob { 50% { transform: translateY(7px); } }

/* ---------- journey ---------- */

#journey { position: relative; z-index: 2; }

.phase {
  min-height: 100dvh;
  padding: 90px 20px 120px;
  max-width: 560px;
  margin: 0 auto;
}

.phase-head { text-align: center; margin-bottom: 26px; }

.phase-head .num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--cream-dim);
  text-transform: uppercase;
}

.phase-head h2 {
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--cream);
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.4);
}

.sentence {
  background: rgba(20, 12, 6, 0.55);
  border: 1px solid rgba(246, 236, 217, 0.16);
  border-radius: 20px;
  padding: 18px 18px 15px;
  margin-bottom: 14px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.sentence.seen { opacity: 1; transform: none; }

.sentence .dux-row { display: flex; align-items: flex-start; gap: 12px; }

.sentence .dux {
  flex: 1;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--cream);
}

.sentence .fr { margin-top: 8px; font-size: 0.9rem; line-height: 1.5; color: var(--cream-dim); font-weight: 500; }

.say {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1.4px solid var(--gold);
  border-radius: 50%;
  background: rgba(217, 164, 65, 0.12);
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s;
}

.say:active { transform: scale(0.88); }
.say svg { width: 16px; height: 16px; }
.say.playing { background: var(--gold); color: var(--ink); animation: throb 0.9s infinite; }

@keyframes throb { 50% { transform: scale(1.1); } }

/* ---------- outro ---------- */

#outro {
  position: relative;
  z-index: 2;
  min-height: 70dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 26px 140px;
  gap: 12px;
}

.goodnight { font-size: 2rem; color: var(--cream); }
.outro-fr { color: var(--cream-dim); font-weight: 500; }

#outro a { color: var(--gold); text-decoration: none; font-weight: 600; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
