/* yulduzcha.app landing: one child's calm day. The fixed .sky layer runs morning -> sunset -> night with the
   scroll (landing.js sets --sky-top / --sky-bottom / --sun-* / --night); sections sit on it with their own tone. */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-var.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --sky: #4FC3F7;
  --sky-light: #9ADDFB;
  --sun: #FFD54F;
  --sun-deep: #FFB300;
  --night: #1F3A5F;
  --night-deep: #14273F;
  --dusk: #3B4F8C;
  --cloud: #FFFFFF;
  --peach: #FFCC80;
  --rose: #F48FB1;
  --plum: #8E5A9B;
  --ink-on-night: #E8EEF8;
  --shadow-soft: 0 10px 30px rgba(20, 39, 63, 0.18);
  --shadow-lift: 0 18px 50px rgba(20, 39, 63, 0.28);
  --radius: 28px;
  --gutter: clamp(20px, 5vw, 64px);
  --measure: 34rem;
  /* set by landing.js; these are the morning values (no JS = a calm day page) */
  --sky-top: #9ADDFB;
  --sky-bottom: #4FC3F7;
  --sun-x: 90vw;
  --sun-y: 30vh;
  --sun-o: 1;
  --stars-o: 0;
  --moon-o: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: clamp(1.0625rem, 0.4vw + 0.95rem, 1.25rem);
  line-height: 1.55;
  color: var(--night);
  background: var(--night-deep); /* under the sky while it paints */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--sun); color: var(--night); }
:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 4px; border-radius: 12px; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- the sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  overflow: hidden;
}
.sky-sun {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(90px, 12vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #FFF3C4 0%, var(--sun) 45%, var(--sun-deep) 100%);
  box-shadow: 0 0 80px 20px rgba(255, 213, 79, 0.45);
  transform: translate(calc(var(--sun-x) - 50%), calc(var(--sun-y) - 50%));
  opacity: var(--sun-o);
}
.sky-moon {
  position: absolute;
  right: 14vw;
  top: 12vh;
  width: clamp(70px, 8vw, 110px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #FFF6D8;
  box-shadow: inset -18px -10px 0 0 #E9DDB3, 0 0 60px 10px rgba(255, 246, 216, 0.25);
  opacity: var(--moon-o);
}
.sky-stars {
  position: absolute;
  inset: 0;
  opacity: var(--stars-o);
  background-image:
    radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 63% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 81% 52%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 7% 66%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 36% 78%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 84%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 54% 60%, #fff 50%, transparent 51%);
}

/* ---------- chrome ---------- */
.skip { position: absolute; left: -999px; top: 8px; background: var(--cloud); padding: 10px 16px; border-radius: 12px; }
.skip:focus { left: 8px; z-index: 10; }

.top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px var(--gutter);
  font-weight: 800;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.375rem; font-weight: 900; }
.brand img { width: 44px; height: 44px; filter: drop-shadow(0 4px 8px rgba(20, 39, 63, 0.25)); }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { text-decoration: none; }
.top-nav a:hover { text-decoration: underline; }
.lang {
  text-decoration: none;
  background: var(--cloud);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 720px) {
  .top-nav { display: none; }
  .lang { margin-left: auto; }
}

/* ---------- typography ---------- */
h1, h2 { font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.6rem, 6vw + 0.5rem, 5.5rem); }
h2 { font-size: clamp(2rem, 3.6vw + 0.6rem, 3.75rem); }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: clamp(1.15rem, 0.6vw + 1rem, 1.45rem); font-weight: 600; }

/* ---------- tones: text that reads on the sky behind it ---------- */
.tone-day, .tone-sunset { color: var(--night); }
.tone-night { color: var(--ink-on-night); }

/* ---------- hero: the film (dawn) ---------- */
.top { position: absolute; inset: 0 0 auto; z-index: 3; }
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  padding: calc(96px + 3vh) var(--gutter) 0;
  overflow: hidden;
  color: var(--night);
}
.hero-film { position: absolute; inset: 0; z-index: -1; background: #F7C9A6; }
.hero-scene, .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;   /* the key visual keeps its top 40 % calm sky for the words */
}
.hero-video { opacity: 0; transition: opacity 1.2s ease; }
.has-film .hero-video { opacity: 1; }
/* dawn haze behind the words: keeps them readable on any frame of the film */
.hero-film::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 233, 214, 0.86) 0%, rgba(255, 233, 214, 0.68) 34%, rgba(255, 233, 214, 0.28) 56%, rgba(255, 233, 214, 0) 70%);
}
.hero-copy { position: relative; max-width: 62rem; }
.hero h1 { font-size: clamp(2.6rem, 4.6vw + 0.6rem, 5.25rem); }
.hero .lede, .hero .soon { text-shadow: 0 0 14px rgba(255, 236, 222, 0.95), 0 0 2px rgba(255, 236, 222, 0.9); }
.hero .lede { margin-inline: auto; max-width: 36rem; }
.hero .stores { justify-content: center; }
.hero .soon { margin-inline: auto; }
.hero-flyer {
  position: absolute;
  z-index: 1;
  width: clamp(120px, 13vw, 220px);
  right: clamp(16px, 13vw, 260px);
  top: clamp(380px, 52vh, 620px);
  filter: drop-shadow(0 18px 28px rgba(90, 50, 20, 0.35));
}
.hero-down {
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--night);
  box-shadow: var(--shadow-soft);
}
.hero-down svg { width: 26px; height: 26px; }
@media (max-width: 860px) {
  .hero { padding-top: 92px; }
  .hero-flyer { top: auto; bottom: 120px; right: 6vw; }
}

/* ---------- stores ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 22px 10px 18px;
  border-radius: 16px;
  background: var(--night);
  color: var(--cloud);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.1;
  box-shadow: var(--shadow-soft);
}
.store svg { width: 28px; height: 28px; fill: currentColor; flex: none; }
.store small { display: block; font-size: 0.72rem; font-weight: 700; opacity: 0.85; letter-spacing: 0.02em; }
.store.is-soon { cursor: default; position: relative; }
.store.is-soon::after {
  content: attr(data-soon);
  position: absolute;
  top: -10px;
  right: -8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sun);
  color: var(--night);
  font-size: 0.75rem;
  font-weight: 900;
}
.soon { font-size: 1rem; font-weight: 700; }
.stores-night .store { background: var(--cloud); color: var(--night); }

/* ---------- chapters ---------- */
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
  padding: clamp(64px, 14vh, 160px) var(--gutter);
}
.chapter-flip .chapter-copy { order: 2; }
@media (max-width: 860px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-flip .chapter-copy { order: 0; }
}

/* video -> game -> star */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  align-items: end;
  gap: 18px;
}
.flow li { position: relative; display: grid; gap: 10px; justify-items: center; font-weight: 900; }
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -16px;
  top: 40%;
  width: 14px;
  height: 14px;
  border-top: 4px solid currentColor;
  border-right: 4px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
  opacity: 0.55;
}
.flow-video img { border-radius: 20px; box-shadow: var(--shadow-soft); }
.flow-games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flow-games img { border-radius: 22px; box-shadow: var(--shadow-soft); background: var(--cloud); }
.flow-star img { width: 100%; max-width: 150px; filter: drop-shadow(0 10px 18px rgba(20, 39, 63, 0.25)); }
@media (max-width: 600px) {
  .flow { grid-template-columns: 1fr; justify-items: center; }
  .flow li:not(:last-child)::after { right: auto; top: auto; bottom: -14px; transform: rotate(135deg); }
  .flow-video img { max-width: 360px; }
}

/* the voice */
.voice { position: relative; margin: 0; justify-self: center; width: min(100%, 420px); }
.voice img { width: 72%; margin: 0 auto; filter: drop-shadow(0 14px 24px rgba(20, 39, 63, 0.28)); }
.voice blockquote {
  position: absolute;
  margin: 0;
  padding: 12px 20px;
  border-radius: 24px 24px 24px 6px;
  background: var(--cloud);
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: var(--shadow-soft);
}
.voice blockquote:nth-of-type(1) { top: 2%; left: -4%; }
.voice blockquote:nth-of-type(2) { bottom: 10%; right: -6%; border-radius: 24px 24px 6px 24px; background: var(--sun); }

/* sunset: promises as a plain list, not cards */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; font-size: 1.15rem; }
.promises li { padding-left: 44px; position: relative; max-width: 30rem; }
.promises li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cloud) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='%231F3A5F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: var(--shadow-soft);
}

/* night: bedtime and the close */
.night {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: clamp(80px, 16vh, 180px) var(--gutter) 80px;
}
.night p { margin-inline: auto; }
.night-mascot { width: clamp(150px, 18vw, 240px); margin-bottom: 18px; filter: drop-shadow(0 0 40px rgba(255, 246, 216, 0.25)); }
.night .stores { justify-content: center; }
.night a { color: var(--sun); }

.foot { padding: 32px var(--gutter) 48px; font-size: 0.95rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 12px; }
.foot a { color: var(--ink-on-night); }
.foot p { opacity: 0.8; }

/* ---------- arrival: one orchestrated moment (content is visible without JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-scene { animation: push 16s cubic-bezier(0.16, 1, 0.3, 1) both; transform-origin: 50% 70%; }
  .js .hero-copy > * { animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .js .hero-copy > :nth-child(1) { animation-delay: 0.35s; }
  .js .hero-copy > :nth-child(2) { animation-delay: 0.5s; }
  .js .hero-copy > :nth-child(3) { animation-delay: 0.65s; }
  .js .hero-copy > :nth-child(4) { animation-delay: 0.75s; }
  .js .hero-flyer { animation: fly-in 2.4s 0.9s cubic-bezier(0.22, 1, 0.36, 1) both, float 7s 3.3s ease-in-out infinite alternate; }
  .js .hero-down { animation: rise 1s 2s both, bob 2.8s 3s ease-in-out infinite alternate; }
}
@keyframes push { from { transform: scale(1.22) translateY(2%); filter: blur(4px) saturate(0.8); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes fly-in {
  0% { opacity: 0; transform: translate(42vw, -70vh) rotate(-30deg) scale(0.35); }
  60% { opacity: 1; transform: translate(-3vw, 4vh) rotate(8deg) scale(1.06); }
  100% { opacity: 1; transform: none; }
}
@keyframes float { to { transform: translateY(-14px) rotate(-3deg); } }
@keyframes bob { to { transform: translateY(6px); } }
@media (max-width: 600px) {
  .voice blockquote:nth-of-type(1) { left: 0; }
  .voice blockquote:nth-of-type(2) { right: 0; }
}
