/* Landing page (home.html): "RGB Labs" rises out of the clouds, then the story scrolls past in parallax.
   Works with the Sky UI (clouds on #sky-canvas behind the page) and with the classic look (CSS clouds only).
   landing.js sets --p (0..1 scroll progress) on the hero and on each chapter, and .is-in when a chapter shows. */

.landing .home-main { overflow-x: clip; }

/* ---------- colours per look ---------- */
.lp-hero {
  --lp-fg: #ffffff; --lp-muted: rgba(255,255,255,.86); --lp-shadow: 0 2px 34px rgba(10,30,80,.35);
  --lp-cloud: rgba(255,255,255,.96); --lp-cloud-back: rgba(255,255,255,.7);
}
html:not(.sky) .lp-hero { background: radial-gradient(60% 50% at 20% 20%, rgba(124,58,237,.35), transparent 70%),
  radial-gradient(50% 45% at 85% 30%, rgba(56,189,248,.22), transparent 70%), radial-gradient(60% 50% at 60% 90%, rgba(236,72,153,.18), transparent 70%), #05041a;
  --lp-cloud: rgba(200,185,255,.17); --lp-cloud-back: rgba(170,190,255,.1); --lp-shadow: 0 2px 40px rgba(124,58,237,.45); }
html:not(.sky)[data-theme="light"] .lp-hero { background: linear-gradient(180deg, #9cc3ee 0%, #cfe2f6 55%, #f6f4ff 100%);
  --lp-cloud: rgba(255,255,255,.95); --lp-cloud-back: rgba(255,255,255,.7); }
html.sky .lp-hero { --lp-fg: var(--hero-fg); --lp-muted: var(--hero-muted); --lp-shadow: var(--hero-shadow); }
html.sky[data-sky="night"] .lp-hero { --lp-cloud: rgba(165,185,230,.15); --lp-cloud-back: rgba(165,185,230,.08); }
html.sky[data-sky="overcast"] .lp-hero { --lp-cloud: rgba(238,240,243,.92); --lp-cloud-back: rgba(238,240,243,.6); }
.lp-hero.has-image { background: linear-gradient(180deg, rgba(5,10,26,.5), rgba(5,10,26,.25)), var(--hero-image) center / cover no-repeat;
  --lp-fg: #fff; --lp-muted: rgba(255,255,255,.88); --lp-shadow: 0 2px 30px rgba(0,0,0,.5); --lp-cloud: rgba(255,255,255,.5); --lp-cloud-back: rgba(255,255,255,.25); }

/* ---------- hero ---------- */
.lp-hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; isolation: isolate;
  overflow-x: clip; color: var(--lp-fg); text-align: center; }
.lp-hero-inner { position: relative; z-index: 2; padding: 0 16px; margin-top: -6vh;
  translate: 0 calc(var(--p, 0) * -22vh); scale: calc(1 - var(--p, 0) * .1); opacity: calc(1 - var(--p, 0) * 1.25); will-change: translate, opacity; }
.lp-title { margin: 0; font-size: clamp(4.2rem, 15vw, 11rem); line-height: .9; letter-spacing: -.035em; font-weight: 700;
  color: var(--lp-fg); text-shadow: var(--lp-shadow); animation: lp-rise 1.9s cubic-bezier(.2,.7,.15,1) both; }
.lp-rgb b { font-weight: 700; }
.lp-labs { font-weight: 250; }
.lp-tag { margin: 18px 0 0; font-size: clamp(.82rem, 2.6vw, 1rem); letter-spacing: .28em; text-transform: uppercase; color: var(--lp-muted);
  text-shadow: var(--lp-shadow); animation: lp-fade 1.4s .9s ease both; }
.lp-tag::before { content: ""; display: block; width: 72px; height: 9px; margin: 0 auto 13px;
  /* Portuguese flag: green 2/5, red 3/5, with a yellow dot where they meet */
  background: radial-gradient(circle at 40% 50%, #ffcd00 0 3.5px, transparent 4px),
    linear-gradient(90deg, #046a38 0 40%, #da291c 40%) center / 100% 3px no-repeat; }

/* ---------- CSS clouds (soft blurred puffs) ---------- */
.lp-clouds { position: absolute; inset: 0; pointer-events: none; }
.lp-back { z-index: 1; }
.lp-front { z-index: 3; }
.lp-clouds i { position: absolute; display: block; border-radius: 50%; background: var(--lp-cloud); filter: blur(22px); }
.lp-clouds i::before, .lp-clouds i::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.lp-clouds i::before { width: 55%; height: 120%; left: 14%; top: -45%; }
.lp-clouds i::after { width: 42%; height: 95%; right: 12%; top: -28%; }
.lp-back i { background: var(--lp-cloud-back); filter: blur(28px); }
.lp-back .c1 { left: -4%; top: 16%; width: 34%; height: 12%; translate: calc(var(--p, 0) * -8vw) calc(var(--p, 0) * -6vh); }
.lp-back .c2 { right: -6%; top: 12%; width: 30%; height: 11%; translate: calc(var(--p, 0) * 8vw) calc(var(--p, 0) * -8vh); }
.lp-back .c3 { left: 60%; top: 30%; width: 22%; height: 8%; translate: calc(var(--p, 0) * 6vw) calc(var(--p, 0) * -4vh); }
.lp-front .c1 { left: -14%; top: 71%; width: 62%; height: 22%; animation: lp-part-l 2.6s cubic-bezier(.2,.7,.15,1) both;
  translate: calc(var(--p, 0) * -34vw) calc(var(--p, 0) * 6vh); }
.lp-front .c2 { right: -16%; top: 68%; width: 64%; height: 24%; animation: lp-part-r 2.6s cubic-bezier(.2,.7,.15,1) both;
  translate: calc(var(--p, 0) * 34vw) calc(var(--p, 0) * 4vh); }
.lp-front .c3 { left: 22%; top: 80%; width: 56%; height: 20%; translate: 0 calc(var(--p, 0) * 14vh); }
.lp-front .c4 { left: -10%; top: 92%; width: 120%; height: 28%; filter: blur(30px); translate: 0 calc(var(--p, 0) * 10vh); }

.lp-scroll { position: absolute; z-index: 4; left: 50%; bottom: 7vh; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px; font-size: .82rem; letter-spacing: .08em; text-decoration: none; color: var(--fg);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent); border: 1px solid var(--glass-edge, var(--line));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: lp-fade 1.2s 1.6s ease both; opacity: calc(1 - var(--p, 0) * 3); }
.lp-scroll i { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; margin-top: -4px;
  animation: lp-bob 1.8s 2.8s ease-in-out infinite; }
.lp-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- story chapters ---------- */
.lp-story { position: relative; z-index: 1; padding: 4vh 0 2vh; }
.lp-chapter { position: relative; min-height: 64vh; display: flex; align-items: center; padding: 6vh 6vw; }
.lp-chapter.lp-right { justify-content: flex-end; }
/* the story sits straight on the sky: big, bold text, no boxes */
.lp-card { position: relative; z-index: 1; max-width: 660px; color: var(--hero-fg, var(--fg)); text-shadow: var(--hero-shadow, none);
  translate: 0 calc((.5 - var(--p, .5)) * 90px); will-change: translate; }
.lp-card h2 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.05; color: inherit; }
.lp-card p { margin: 0; font-size: clamp(1.15rem, 1.6vw, 1.45rem); font-weight: 500; line-height: 1.5; color: inherit; opacity: .95; }
.lp-card .lp-kicker { margin: 0 0 12px; font-size: .85rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; opacity: .85; }
.lp-right .lp-card { text-align: right; }
html.sky[data-sky="day"] .lp-card, html:not(.sky)[data-theme="dark"] .lp-card { text-shadow: 0 1px 3px rgba(8,30,70,.55), 0 0 18px rgba(8,30,70,.45), 0 4px 44px rgba(8,30,70,.55); }
html.sky[data-sky="overcast"] .lp-card { text-shadow: 0 0 2px rgba(255,255,255,.8), 0 0 24px rgba(255,255,255,.7); }
.lp-num { position: absolute; z-index: 0; top: 50%; left: calc(6vw + 700px); margin-top: -.6em; font-size: clamp(6rem, 14vw, 12rem); font-weight: 200;
  line-height: 1; letter-spacing: -.04em; color: var(--hero-fg, var(--fg)); opacity: .32; text-shadow: var(--hero-shadow, none);
  translate: 0 calc((.5 - var(--p, .5)) * 300px); pointer-events: none; user-select: none; }
.lp-right .lp-num { left: auto; right: calc(6vw + 700px); }
.lp-end { justify-content: center; min-height: 52vh; text-align: center; }
.lp-end .lp-card { max-width: 720px; text-align: center; }
.lp-end .lp-card h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.lp-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.lp-tools-cta { margin-top: 22px; }

/* reveal: only when landing.js runs, so the text is always readable without it */
html.lp-js .lp-chapter .lp-card { opacity: 0; transform: translateY(34px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.15,1); }
html.lp-js .lp-chapter .lp-num { opacity: 0; transition: opacity 1.2s ease .15s; }
html.lp-js .lp-chapter.is-in .lp-card { opacity: 1; transform: none; }
html.lp-js .lp-chapter.is-in .lp-num { opacity: .32; }

@keyframes lp-rise { from { opacity: 0; transform: translateY(70px) scale(.9); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes lp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lp-part-l { from { transform: translateX(14vw); } to { transform: none; } }
@keyframes lp-part-r { from { transform: translateX(-14vw); } to { transform: none; } }
@keyframes lp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- tablets and phones ---------- */
@media (max-width: 1100px) {
  .lp-num { left: auto; right: 6vw; } .lp-right .lp-num { right: auto; left: 6vw; }
}
@media (max-width: 760px) {
  .lp-hero { min-height: calc(100svh - 76px); }
  .lp-hero-inner { margin-top: -10vh; }
  .lp-front .c1 { top: 72%; width: 80%; } .lp-front .c2 { top: 70%; width: 82%; } .lp-front .c3 { left: 10%; width: 80%; }
  .lp-tag { letter-spacing: .14em; }
  .lp-scroll { bottom: 5vh; }
  .lp-chapter, .lp-chapter.lp-right { min-height: 62vh; padding: 5vh 16px; justify-content: center; }
  .lp-chapter, .lp-chapter.lp-right { padding-top: 14vh; }
  .lp-card, .lp-right .lp-card { text-align: left; translate: 0 calc((.5 - var(--p, .5)) * 50px); }
  .lp-end .lp-card { text-align: center; }
  .lp-num, .lp-right .lp-num { top: 3vh; margin-top: 0; left: 16px; right: auto; font-size: 5rem; translate: 0 calc((.5 - var(--p, .5)) * 120px); }
}

/* ---------- reduced motion: no intro, no parallax, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  .lp-title, .lp-tag, .lp-scroll, .lp-scroll i, .lp-front i { animation: none; }
  .lp-hero-inner, .lp-clouds i, .lp-card, .lp-num, .lp-right .lp-num { translate: none; scale: none; }
  .lp-hero-inner, .lp-scroll { opacity: 1; }
  html.lp-js .lp-chapter .lp-card { opacity: 1; transform: none; transition: none; }
  html.lp-js .lp-chapter .lp-num { opacity: .32; transition: none; }
}
