/**
 * Styles of the FilmNatale landing page.
 *
 * Why these choices:
 * - Colors are the app's "cinema" palette (`app/src/theme/tokens.ts`): the page is the `notte`
 *   green the user asked for, accents are `oro` (on notte the design system never uses red text)
 *   and the one red button per screen is `rosso`. No other colors appear in the rules below.
 * - Fraunces for titles, Figtree for everything else, the same files as the app.
 * - Side margins follow the app's layout classes: 16 px below 600, 24 up to 899, 32 above.
 * - The hero is a size container, so every object is placed in `cqw`/`cqh` (fractions of the
 *   hero itself) and the burst keeps its shape on any screen; portrait and square screens get
 *   their own arrangement so nothing lands on the payoff.
 * - The burst is driven by one registered number, `--e` (0 at the center, 1 in place), so the
 *   entrance, the overshoot and the scroll parallax (`--p`, set by main.js) share one transform.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/Fraunces-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('fonts/Figtree-Variable.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@property --e {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

:root {
  /* cinema palette */
  --notte: #143023;
  --notte-scura: #0e2419;
  --notte-fonda: #0a1a12;
  --notte-alta: #1d3a2b;
  --linea: #2c4a3a;
  --crema: #f7f1e6;
  --crema-tenue: #bfcbc2;
  --marchio: #fff2dd;
  --rosso: #c42a3b;
  --rosso-acceso: #d23447;
  --oro: #e2be6a;
  --oro-tenue: rgba(226, 190, 106, 0.14);
  --abete-testo: #8fd6ab;
  /* light theme ink, only for the notification card that imitates iOS */
  --inchiostro: #1c2620;
  --inchiostro-tenue: #5c665f;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

@media (min-width: 600px) {
  :root { --gutter: 24px; }
}

@media (min-width: 900px) {
  :root { --gutter: 32px; }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--notte);
  color: var(--crema);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--abete-testo);
  outline-offset: 3px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 9999px;
  background: var(--rosso);
  color: #fff;
  font: 600 17px/1 var(--sans);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(196, 42, 59, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.btn:hover {
  background: var(--rosso-acceso);
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(196, 42, 59, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn--small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 15px;
  box-shadow: none;
}

.btn--small:hover {
  box-shadow: none;
}

/* ---------- top bar, shown once the hero has scrolled away ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: rgba(14, 36, 25, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 242, 221, 0.08);
  transform: translateY(-110%);
  transition: transform 0.4s var(--ease-out);
}

.topbar.is-visible {
  transform: translateY(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--marchio);
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: auto;
}

.brand span {
  font: 600 20px/1 var(--serif);
  letter-spacing: -0.01em;
}

/* ---------- hero ---------- */

.hero {
  --cy: 45%;
  --logo: clamp(150px, 29cqmin, 340px);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  max-height: 1200px;
  overflow: hidden;
  container-type: size;
  isolation: isolate;
  background:
    radial-gradient(58% 52% at 50% 45%, #2a5a42 0%, #1d4331 34%, var(--notte) 62%, var(--notte-fonda) 100%);
}

/* fine grain, like a film frame */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: calc(var(--logo) * 3.2);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 190, 106, 0.3) 0%, rgba(226, 190, 106, 0.1) 32%, transparent 64%);
  z-index: 0;
}

/* projector rays turning slowly behind the logo */
.hero__rays {
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: 220vmax;
  aspect-ratio: 1;
  translate: -50% -50%;
  z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 242, 221, 0.075) 0deg 3.5deg, transparent 3.5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.7) 12%, transparent 34%);
  mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.7) 12%, transparent 34%);
  animation: spin 160s linear infinite;
}

@keyframes spin {
  to { rotate: 360deg; }
}

.burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.obj {
  --e: 1;
  --push: calc(1 + var(--p, 0) * var(--k, 0.5));
  position: absolute;
  left: 50%;
  top: var(--cy);
  width: var(--w);
  translate: -50% -50%;
  transform:
    translate(calc(var(--x) * var(--e) * var(--push)), calc(var(--y) * var(--e) * var(--push)))
    rotate(calc(var(--r) * var(--e) * 1deg))
    scale(calc(0.2 + 0.8 * var(--e)));
  opacity: clamp(0, calc(var(--e) * 2.5), 1);
  animation: burst 1.35s cubic-bezier(0.17, 1.28, 0.32, 1) var(--d, 0ms) both;
  z-index: 1;
}

.obj img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45));
  animation: float var(--fd, 7s) ease-in-out calc(var(--d, 0ms) + 1.3s) infinite alternate;
}

.obj.back {
  z-index: 0;
}

.obj.back img {
  filter: blur(0.6px) brightness(0.86) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.4));
}

.obj.front {
  z-index: 4;
}

.obj.front img {
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.5));
}

@keyframes burst {
  from { --e: 0; }
  to { --e: 1; }
}

@keyframes float {
  from { transform: translateY(calc(var(--fa, 7px) * -1)) rotate(-1.2deg); }
  to { transform: translateY(var(--fa, 7px)) rotate(1.2deg); }
}

/* hold the burst until the images are ready, so nothing pops in half way */
.js .hero:not(.is-ready) .obj,
.js .hero:not(.is-ready) .obj img,
.js .hero:not(.is-ready) .hero__logo,
.js .hero:not(.is-ready) .hero__words > *,
.js .hero:not(.is-ready) .hero__scroll {
  animation-play-state: paused;
}

/* landscape: x and y are offsets from the logo, w the width, r the turn in degrees */
.o-duo     { --x: -31cqw; --y: -24cqh; --w: 27cqw;  --r: -9;  --d: 40ms;  --k: 0.3;  --fd: 8s; }
.o-ipad    { --x: 27cqw;  --y: -27cqh; --w: 17cqw;  --r: 11;  --d: 0ms;   --k: 0.3;  --fd: 9s; }
.o-reel    { --x: -6cqw;  --y: -40cqh; --w: 12cqw;  --r: -16; --d: 120ms; --k: 0.45; --fd: 6s; }
.o-strip   { --x: 3cqw;   --y: 50cqh;  --w: 40cqw;  --r: -5;  --d: 140ms; --k: 0.4;  --fd: 10s; }
.o-cup     { --x: 39cqw;  --y: -6cqh;  --w: 7.5cqw; --r: 16;  --d: 160ms; --k: 0.7;  --fd: 6.5s; }
.o-iphone  { --x: 29cqw;  --y: 12cqh;  --w: 10.5cqw; --r: 13; --d: 80ms;  --k: 0.6;  --fd: 7.5s; }
.o-bucket  { --x: 38cqw;  --y: 31cqh;  --w: 14cqw;  --r: 12;  --d: 200ms; --k: 0.75; --fd: 7s; }
.o-bag     { --x: -40cqw; --y: 6cqh;   --w: 11cqw;  --r: -14; --d: 180ms; --k: 0.7;  --fd: 6.8s; }
.o-android { --x: -27cqw; --y: 30cqh;  --w: 9cqw;   --r: -15; --d: 100ms; --k: 0.6;  --fd: 8.2s; }
.o-k1      { --x: 14cqw;  --y: -37cqh; --w: 8cqw;   --r: 20;  --d: 220ms; --k: 0.5;  --fd: 5.5s; }
.o-k2      { --x: -19cqw; --y: 11cqh;  --w: 6.5cqw; --r: -30; --d: 240ms; --k: 0.9;  --fd: 5s; }
.o-k3      { --x: 15cqw;  --y: -14cqh; --w: 6cqw;   --r: 40;  --d: 260ms; --k: 0.9;  --fd: 6s; }

.hero__logo {
  position: absolute;
  left: 50%;
  top: var(--cy);
  z-index: 3;
  width: var(--logo);
  height: auto;
  translate: -50% -50%;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.45));
  transform: scale(calc(1 - var(--p, 0) * 0.12));
  animation: logo-in 0.9s cubic-bezier(0.2, 1.4, 0.35, 1) both;
}

@keyframes logo-in {
  from { opacity: 0; scale: 0.6; }
  to { opacity: 1; scale: 1; }
}

.hero__words {
  position: absolute;
  left: 50%;
  top: calc(var(--cy) + var(--logo) * 0.53 + clamp(18px, 3.4cqmin, 40px));
  z-index: 5;
  width: min(100% - 2 * var(--gutter), 900px);
  translate: -50% 0;
  text-align: center;
  opacity: calc(1 - var(--p, 0) * 1.6);
}

/* the entrance runs on the texts, so the scroll fade on the wrapper is not overridden */
.hero__words > * {
  animation: rise 0.9s var(--ease-out) 0.55s both;
}

.hero__words > .hero__sub {
  animation-delay: 0.7s;
}

.hero__payoff {
  font: 600 clamp(38px, 6.6cqmin, 84px)/1.04 var(--serif);
  letter-spacing: -0.015em;
  color: var(--marchio);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
  text-wrap: balance;
}

.hero__sub {
  margin-top: clamp(8px, 1.4cqmin, 16px);
  font: 500 clamp(16px, 2.2cqmin, 21px)/1.4 var(--sans);
  color: var(--crema-tenue);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);
  text-wrap: balance;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  translate: -50% 0;
  border-radius: 50%;
  color: var(--crema);
  background: rgba(10, 26, 18, 0.45);
  border: 1px solid rgba(255, 242, 221, 0.18);
  animation: rise 0.8s var(--ease-out) 1.4s both, nudge 2.6s ease-in-out 2.4s infinite;
}

.hero__scroll svg,
.points__icon svg,
.sheet__close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* square-ish screens (small laptops, split windows): pull everything in a little */
@media (max-aspect-ratio: 5/4) and (min-aspect-ratio: 4/5) {
  .hero { --cy: 43%; --logo: clamp(140px, 27cqmin, 300px); }
  .o-duo     { --x: -30cqw; --y: -31cqh; --w: 34cqw; }
  .o-ipad    { --x: 31cqw;  --y: -29cqh; --w: 21cqw; }
  .o-reel    { --x: -2cqw;  --y: -41cqh; --w: 14cqw; }
  .o-strip   { --x: 0cqw;   --y: 50cqh;  --w: 56cqw; }
  .o-cup     { --x: 41cqw;  --y: 0cqh;   --w: 9cqw; }
  .o-iphone  { --x: 35cqw;  --y: 34cqh;  --w: 14cqw; }
  .o-bucket  { --x: 12cqw;  --y: 45cqh;  --w: 16cqw; }
  .o-bag     { --x: -41cqw; --y: 0cqh;   --w: 14cqw; }
  .o-android { --x: -30cqw; --y: 33cqh;  --w: 12cqw; }
  .o-k1      { --x: 16cqw;  --y: -40cqh; --w: 10cqw; }
  .o-k2      { --x: -24cqw; --y: 9cqh;   --w: 8cqw; }
  .o-k3      { --x: 24cqw;  --y: 7cqh;   --w: 8cqw; }
}

/* portrait (phones, iPad upright): logo higher, devices above and below the words */
@media (max-aspect-ratio: 4/5) {
  .hero { --cy: 41%; --logo: clamp(130px, 46cqw, 340px); }
  .hero__payoff { font-size: clamp(36px, 10.6cqw, 84px); }
  .hero__sub { font-size: clamp(16px, 4.2cqw, 22px); }
  .hero__scroll { display: none; }
  .o-duo     { --x: -22cqw; --y: -33cqh; --w: 58cqw; }
  .o-ipad    { --x: 28cqw;  --y: -30cqh; --w: 36cqw; }
  .o-reel    { --x: -41cqw; --y: 5cqh;   --w: 24cqw; }
  .o-strip   { --x: -4cqw;  --y: 57cqh;  --w: 96cqw; }
  .o-cup     { --x: 41cqw;  --y: -8cqh;  --w: 15cqw; }
  .o-iphone  { --x: 28cqw;  --y: 44cqh;  --w: 24cqw; }
  .o-bucket  { --x: 0cqw;   --y: 54cqh;  --w: 29cqw; }
  .o-bag     { --x: -41cqw; --y: -14cqh; --w: 21cqw; }
  .o-android { --x: -28cqw; --y: 43cqh;  --w: 22cqw; }
  .o-k1      { --x: 4cqw;   --y: -41cqh; --w: 18cqw; }
  .o-k2      { --x: 40cqw;  --y: 10cqh;  --w: 16cqw; }
  .o-k3      { --x: -2cqw;  --y: 36cqh;  --w: 14cqw; }
}

/* tablets upright (iPad, the Duo opened upright): wider than a phone, so a smaller logo and
   the devices further down, clear of the words */
@media (max-aspect-ratio: 4/5) and (min-aspect-ratio: 3/5) {
  .hero { --cy: 39%; --logo: clamp(130px, 33cqw, 340px); }
  .hero__payoff { font-size: clamp(36px, 8cqw, 84px); }
  .hero__sub { font-size: clamp(16px, 2.8cqw, 24px); }
  .o-duo     { --y: -35cqh; --w: 52cqw; }
  .o-ipad    { --y: -33cqh; --w: 32cqw; }
  .o-bag     { --y: -12cqh; --w: 17cqw; }
  .o-reel    { --x: -40cqw; --y: 6cqh;  --w: 19cqw; }
  .o-cup     { --x: 40cqw;  --y: -6cqh; --w: 12cqw; }
  .o-k2      { --x: 38cqw;  --y: 10cqh; --w: 12cqw; }
  .o-android { --x: -29cqw; --y: 44cqh; --w: 17cqw; }
  .o-iphone  { --x: 29cqw;  --y: 45cqh; --w: 18cqw; }
  .o-bucket  { --x: 1cqw;   --y: 52cqh; --w: 22cqw; }
  .o-k3      { --x: 2cqw;   --y: 38cqh; --w: 11cqw; }
  .o-strip   { --y: 58cqh; }
}

/* ---------- strong point ---------- */

.feature {
  position: relative;
  padding: clamp(80px, 12vw, 160px) var(--gutter);
  background: linear-gradient(180deg, var(--notte-fonda) 0%, var(--notte) 22%, var(--notte-scura) 100%);
  overflow: hidden;
}

.feature__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  max-width: 1120px;
  margin: 0 auto;
}

.eyebrow {
  font: 700 13px/16px var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oro);
}

.feature__title {
  margin-top: 14px;
  font: 600 clamp(38px, 5vw, 64px)/1.06 var(--serif);
  letter-spacing: -0.015em;
  color: var(--marchio);
  text-wrap: balance;
}

.feature__lead {
  margin-top: 22px;
  max-width: 32em;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--crema-tenue);
}

.points {
  display: grid;
  gap: 20px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: var(--crema-tenue);
}

.points strong {
  display: block;
  font: 600 18px/1.3 var(--sans);
  color: var(--crema);
}

.points__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--oro);
  background: var(--oro-tenue);
}

.feature__visual {
  position: relative;
  justify-self: center;
  width: min(360px, 100%);
  /* the notification is sized in cqw, fractions of the phone, so it stays on its screen */
  container-type: inline-size;
}

.feature__glow {
  position: absolute;
  inset: -20% -30%;
  z-index: 0;
  background: radial-gradient(closest-side, rgba(226, 190, 106, 0.2), transparent 70%);
}

.feature__phone {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55));
}

/* the reminder as an iOS banner, in the app's words: inside the screen (4.7% to 95.3% of the
   phone image's width), just below the Dynamic Island */
.notif {
  position: absolute;
  z-index: 2;
  top: 15.5cqw;
  left: 7cqw;
  right: 7cqw;
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: 3.2cqw 3.6cqw;
  border-radius: 6.5cqw;
  background: rgba(247, 241, 230, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: var(--inchiostro);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.notif img {
  flex: none;
  width: 10.5cqw;
  height: 10.5cqw;
  border-radius: 2.4cqw;
}

.notif__text {
  flex: 1;
  min-width: 0;
  font-size: 3.9cqw;
  line-height: 1.3;
}

.notif__title {
  font-weight: 700;
}

.notif__time {
  align-self: flex-start;
  font-size: 3.4cqw;
  color: var(--inchiostro-tenue);
}

@media (max-width: 860px) {
  .feature__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature__visual {
    width: min(300px, 76%);
    margin-top: 12px;
  }
}

/* ---------- final photo ---------- */

.finale {
  position: relative;
  display: grid;
  align-items: end;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--notte-fonda);
  isolation: isolate;
}

.finale__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.finale__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--notte-scura) 0%, rgba(14, 36, 25, 0) 14%),
    linear-gradient(0deg, rgba(10, 26, 18, 0.94) 0%, rgba(10, 26, 18, 0.72) 22%, rgba(10, 26, 18, 0) 50%);
}

.finale__content {
  display: grid;
  justify-items: center;
  gap: clamp(24px, 3.4vw, 36px);
  padding: 0 var(--gutter) max(clamp(56px, 10vh, 120px), env(safe-area-inset-bottom));
  text-align: center;
}

.finale__title {
  max-width: 13em;
  font: 600 clamp(38px, 5.6vw, 76px)/1.06 var(--serif);
  letter-spacing: -0.015em;
  color: var(--marchio);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
  text-wrap: balance;
}

/* wide screens: one line of title over the sofa back, so the family stays in view */
@media (min-aspect-ratio: 4/3) {
  .finale__title {
    max-width: none;
    font-size: clamp(34px, 4.2vw, 68px);
  }

  .finale__content {
    gap: 22px;
    padding-bottom: max(clamp(36px, 6vh, 72px), env(safe-area-inset-bottom));
  }
}

@media (max-aspect-ratio: 4/5) {
  /* keep the mother's phone and the children in the frame */
  .finale__photo { object-position: 24% 50%; }
}

/* ---------- reveal on scroll ---------- */

.js .feature__text[data-reveal] > *,
.js .feature__visual[data-reveal],
.js .finale[data-reveal] .finale__content > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.js .feature__text.is-in > *,
.js .feature__visual.is-in,
.js .finale.is-in .finale__content > * {
  opacity: 1;
  transform: none;
}

.js .feature__text.is-in > :nth-child(2) { transition-delay: 0.08s; }
.js .feature__text.is-in > :nth-child(3) { transition-delay: 0.16s; }
.js .feature__text.is-in > :nth-child(4) { transition-delay: 0.24s; }
.js .feature__visual.is-in { transition-delay: 0.1s; }
.js .finale.is-in .finale__content > :nth-child(2) { transition-delay: 0.15s; }

.js .notif {
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  transition: opacity 0.6s var(--ease-out) 0.7s, transform 0.6s var(--ease-out) 0.7s;
}

.js .feature__visual.is-in .notif {
  opacity: 1;
  transform: none;
}

.js .finale__photo {
  scale: 1.07;
  transition: scale 9s cubic-bezier(0.2, 0.6, 0.3, 1);
}

.js .finale.is-in .finale__photo {
  scale: 1;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) max(20px, env(safe-area-inset-bottom));
  background: var(--notte-fonda);
  color: var(--crema-tenue);
  font-size: 14px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer img {
  width: 26px;
  height: auto;
}

.footer__name {
  font: 600 17px/1 var(--serif);
  color: var(--marchio);
}

.footer__year::before {
  content: '·';
  margin-right: 10px;
}

/* 44 pt tall links, as the app's touch areas */
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.footer__links a {
  padding: 12px 0;
  color: var(--crema);
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--oro);
}

@media (max-width: 599px) {
  .footer {
    flex-direction: column;
    justify-content: center;
  }
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px var(--gutter);
  text-align: center;
  background:
    radial-gradient(60% 50% at 50% 40%, #2a5a42 0%, var(--notte) 60%, var(--notte-fonda) 100%);
}

.lost__logo {
  width: clamp(120px, 30vmin, 200px);
  height: auto;
  margin-bottom: 8px;
}

.lost__title {
  font: 600 clamp(32px, 6vw, 52px)/1.1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--marchio);
}

.lost__text {
  margin-bottom: 12px;
  color: var(--crema-tenue);
}

/* ---------- download sheet (desktop, or before the store links exist) ---------- */

.sheet {
  width: min(420px, 100% - 2 * var(--gutter));
  padding: 32px 28px 28px;
  border: 1px solid var(--linea);
  border-radius: 24px;
  background: var(--notte-alta);
  color: var(--crema);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.sheet::backdrop {
  background: rgba(5, 12, 8, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sheet[open] {
  animation: sheet-in 0.35s var(--ease-out);
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
}

.sheet__close-form {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

.sheet__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--crema-tenue);
  cursor: pointer;
}

.sheet__close:hover {
  background: rgba(255, 242, 221, 0.08);
  color: var(--crema);
}

.sheet__icon {
  width: 72px;
  height: 72px;
  border-radius: 17px;
}

.sheet__title {
  margin-top: 16px;
  font: 600 26px/1.15 var(--serif);
  color: var(--marchio);
}

.sheet__text {
  margin-top: 8px;
  color: var(--crema-tenue);
}

.sheet__stores {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.store {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--linea);
  border-radius: 16px;
  background: var(--notte-scura);
  color: var(--crema);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.store:hover {
  border-color: var(--oro);
}

.store__small {
  font-size: 13px;
  color: var(--crema-tenue);
}

.store__name {
  font: 600 19px/1.2 var(--sans);
}

.store[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.7;
}

/* ---------- less motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .obj,
  .obj img,
  .hero__rays,
  .hero__logo,
  .hero__words > *,
  .hero__scroll,
  .sheet[open] {
    animation: none;
  }

  .obj { --e: 1; }

  .js .feature__text[data-reveal] > *,
  .js .feature__visual[data-reveal],
  .js .finale[data-reveal] .finale__content > *,
  .js .notif {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js .finale__photo { scale: 1; transition: none; }
}
