/* Vibeart landing page (vibeart.online): a collage of coloured paper.
   Every layer is a piece of paper; the assistant cuts and pastes them in front of you.
   Colours come from the app's theme (crates/ui-egui/src/barbarart/theme.rs). The mark on the
   window's corner and on the last sheet is Vibeart's own (assets/brand/vibeart-mark.svg).
   No font is fetched from elsewhere: the page uses the fonts the computer has.
   No script: the demo and the mode selector are radio inputs + :checked, all motion is CSS. */

:root {
  /* Paper */
  --lavender: #f6f3fd;    /* the app's chrome: the page's ground */
  --lavender-2: #ede8fa;
  --sheet: #ffffff;
  --violet: #6c4fe0;      /* white text reads on it (5.3:1) */
  --violet-deep: #4f35c2;
  --pink: #e94aaf;
  --orange: #fe8a4b;
  --sky: #41a5fd;
  --ink: #2b2440;
  --ink-dim: #5a5275;
  --line: #e0d8f5;
  --field-line: #bdb2e0;
  --hover: #e9e2fb;
  --tape: rgba(255, 233, 160, 0.88);
  /* The torn ends of a strip of masking tape. */
  --tape-cut: polygon(3% 0, 97% 0, 100% 35%, 97% 100%, 3% 100%, 0 65%);
  --focus: #2b6be0;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .14 0 0 0 0 .25 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");

  --display: "Shantell Sans", "Segoe Print", "Comic Neue", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --measure: 34rem;
  --cut: clamp(14px, 2.4vw, 34px);
  --nav-h: 68px;
  /* Sections meet along a wave: the paint ribbon runs on it. */
  --wave: clamp(28px, 4.5vw, 64px);
  --wave-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0 70 C 240 10, 420 95, 720 55 S 1180 5, 1440 45 L1440 100 L0 100 Z'/%3E%3C/svg%3E");
  --wave-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M1440 70 C 1200 10, 1020 95, 720 55 S 260 5, 0 45 L0 100 L1440 100 Z'/%3E%3C/svg%3E");

  --lift: drop-shadow(0 10px 14px rgba(43, 36, 64, 0.18)) drop-shadow(0 2px 3px rgba(43, 36, 64, 0.16));
  --rest: drop-shadow(0 3px 4px rgba(43, 36, 64, 0.2)) drop-shadow(0 1px 1px rgba(43, 36, 64, 0.14));

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-drop: cubic-bezier(0.2, 0.9, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  scrollbar-color: var(--field-line) var(--lavender);
  accent-color: var(--violet);
}

body {
  margin: 0;
  background: var(--lavender);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: #fbe3f3; color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--violet-deep); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(2.1rem, min(5vw, 7svh), 3.8rem); letter-spacing: -0.01em; }
h3 { font-weight: 700; }

p { margin: 0; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.grain { background-image: var(--grain); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}
.skip:focus { top: 1rem; }

/* Buttons: paper tabs that lift on hover and press flat. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.75rem 1.5rem;
  border-radius: 14px;
  border: 2px solid var(--violet);
  background: var(--sheet);
  color: var(--violet-deep);
  gap: 0.28em;
  font-weight: 700;
  text-decoration: none;
  filter: var(--rest);
  transition: transform 160ms var(--ease-out), filter 160ms ease, background-color 160ms ease;
}

.button:hover { transform: translateY(-2px) rotate(-0.6deg); filter: var(--lift); }
.button:active { transform: translateY(1px); filter: none; transition-duration: 60ms; }

.button.primary { background: var(--violet); color: #fff; }
.button.primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); }

.button.small { min-height: 42px; padding: 0.5rem 1.05rem; font-size: 0.9375rem; border-radius: 12px; }

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.fine { margin-top: 1rem; font-size: 0.9375rem; color: var(--ink-dim); }

/* Cut-paper titles: each line is a strip of coloured paper cut with scissors. */

.cut-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04em;
  filter: var(--rest);
}

.strip {
  display: block;
  padding: 0.3em 0.5em 0.32em;
  background-color: var(--sheet);
  background-image: var(--grain);
  clip-path: polygon(0.6% 6%, 99% 0, 100% 88%, 97.5% 100%, 1.5% 95%, 0 40%);
}

.strip.s1 { background-color: var(--sky); transform: rotate(-1.6deg); }
.strip.s2 { background-color: var(--violet); color: #fff; transform: rotate(1.1deg) translateX(0.35em); clip-path: polygon(0 3%, 98.5% 8%, 100% 100%, 1% 92%); }
.strip.s3 { background-color: var(--orange); transform: rotate(-0.8deg) translateX(0.1em); clip-path: polygon(1% 0, 100% 9%, 98% 96%, 0 100%); }

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem var(--gutter);
  background-color: var(--sheet);
  background-image: var(--grain);
  filter: drop-shadow(0 3px 4px rgba(43, 36, 64, 0.1));
}

/* The nav is a strip of paper with a scissor-cut lower edge. */
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
  background-color: var(--sheet);
  background-image: var(--grain);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 87% 95%, 69% 35%, 51% 100%, 33% 40%, 16% 90%, 0 45%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font: 800 1.35rem/1 var(--display);
  color: var(--ink);
  text-decoration: none;
}

.brand img { transform: rotate(-4deg); transition: transform 200ms var(--ease-out); }
.brand:hover img { transform: rotate(4deg) scale(1.06); }

.nav-links { display: flex; gap: 0.15rem; white-space: nowrap; }

.nav-links a,
.menu nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  color: var(--ink-dim);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.nav-links a:hover,
.menu nav a:hover { background: var(--hover); color: var(--ink); }

.nav-login {
  padding: 0.45rem 0.95rem;
  border-radius: 12px;
  border: 2px solid var(--field-line);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.nav-login:hover { border-color: var(--violet); background: var(--hover); }

.menu { display: none; position: relative; }

.menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  border: 2px solid var(--field-line);
  font-weight: 700;
}
.menu summary::-webkit-details-marker { display: none; }

.menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  display: grid;
  min-width: 14rem;
  padding: 0.5rem;
  border-radius: 14px;
  background: var(--sheet);
  filter: var(--lift);
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  align-content: center;
  gap: clamp(2rem, 5vw, 5rem);
  /* The first view fills the screen under the nav, whatever its height. */
  min-height: calc(100svh - var(--nav-h));
  padding: clamp(3rem, 6svh, 4.5rem) var(--gutter) calc(var(--wave) + clamp(0.75rem, 2.5svh, 2.5rem));
  overflow: hidden;
}

.hero-copy { position: relative; z-index: 3; max-width: 36rem; }

.hero h1 { font-size: clamp(2.1rem, min(3.5vw, 6.2svh), 4.1rem); }
.hero .strip { white-space: nowrap; }

.lead-short { display: none; }

.lead {
  margin-top: clamp(1rem, 2.6svh, 1.75rem);
  max-width: var(--measure);
  font-size: clamp(1.05rem, min(1.5vw, 2.4svh), 1.25rem);
  color: var(--ink-dim);
}

/* The mascot's paint ribbon runs along each wavy edge, separating the sheets.
   Its curve is the same as the edge's mask (--wave-l / --wave-r), so it sits exactly on it. */
.seam { position: relative; z-index: 6; height: 0; pointer-events: none; }
.seam svg {
  position: absolute;
  left: 0;
  top: calc(var(--wave) * -1);
  width: 100%;
  height: var(--wave);
  overflow: visible;
}
.seam path {
  fill: none;
  stroke: url(#paint);
  stroke-width: clamp(14px, 1.9vw, 28px);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* The demo: an app window where the assistant pastes a document together. */

.demo { position: relative; z-index: 2; }

/* The radio buttons behind the demo's requests and the mode selector: present, never seen. */
.demo-pick, .mode-pick { position: absolute; opacity: 0; pointer-events: none; }

.window {
  position: relative;
  border-radius: 20px;
  background-color: var(--sheet);
  background-image: var(--grain);
  filter: var(--lift);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem clamp(6rem, 9vw, 9rem) 0.7rem 1rem; /* room for the mascot on the corner */
  border-bottom: 1px solid var(--line);
  background: var(--lavender);
}

.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; }
.dots i:nth-child(1) { background: var(--pink); }
.dots i:nth-child(2) { background: var(--orange); }
.dots i:nth-child(3) { background: var(--sky); }

.window-title { font-size: 0.875rem; font-weight: 600; color: var(--ink-dim); }
.window-note { margin-left: auto; font-size: 0.75rem; color: var(--ink-dim); }

.scene {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2vw, 1.4rem);
}

#r-saldi:checked ~ .window .scene-saldi,
#r-bar:checked ~ .window .scene-bar,
#r-festa:checked ~ .window .scene-festa { display: grid; }

/* Chat column */

.chat {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  align-content: start;
  gap: 0.7rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.msg { padding: 0.65rem 0.85rem; border-radius: 14px; }

.msg.user {
  grid-row: 1;
  justify-self: end;
  max-width: 92%;
  background: #ded5fb;
  border-bottom-right-radius: 4px;
}

.typing, .msg.bot:not(.done) { grid-row: 2; grid-column: 1; }

.typing {
  justify-self: start;
  display: inline-flex;
  gap: 5px;
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: var(--lavender);
  visibility: hidden;
}
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-dim); }

.msg.bot { justify-self: start; padding-left: 0; color: var(--ink); }
.msg.bot.done { grid-row: 4; font-weight: 600; }

.steps {
  grid-row: 3;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-dim);
}

.steps li { display: flex; align-items: center; gap: 0.45rem; }

.steps svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--violet);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The app's message box sits at the bottom of the chat, as in the real window. */
.composer {
  grid-row: 6;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.45rem 0.45rem 0.8rem;
  border: 1.5px solid var(--field-line);
  border-radius: 12px;
  color: var(--ink-dim);
  font-size: 0.8125rem;
}
.composer b { flex: none; padding: 0.35rem 0.8rem; border-radius: 8px; background: #2b6be0; color: #fff; }

/* Poster */

.poster-col { display: grid; gap: 0.8rem; align-content: start; }

.hero .actions { margin-top: clamp(1.2rem, 3svh, 2rem); }

.poster {
  position: relative;
  container-type: inline-size;
  justify-self: center;
  /* Sized by the screen's height, so the whole demo fits in the first view. */
  height: clamp(160px, calc(100svh - 575px), 440px);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  box-shadow: 0 1px 0 var(--line), 0 14px 30px -18px rgba(43, 36, 64, 0.45);
  isolation: isolate;
}

.piece { position: absolute; }

.piece .cut { position: absolute; inset: 0; background-image: var(--grain); }

.piece.bg { inset: 0; border-radius: 6px; background-image: var(--grain); }

.poster-type {
  display: block;
  font: 800 13cqi/0.98 var(--display);
  letter-spacing: -0.01em;
}

.tape {
  position: absolute;
  z-index: 3;
  padding: 0.18rem 0.55rem 0.22rem;
  background: var(--tape);
  color: var(--ink);
  font: 700 clamp(8px, 3.6cqi, 11px)/1 var(--body);
  white-space: nowrap;
  clip-path: var(--tape-cut);
  transform: rotate(-4deg);
}

/* Sale poster */
.poster-saldi .bg { background-color: #fffdfa; }
.poster-saldi .band { left: -3%; right: -3%; bottom: -2%; height: 38%; filter: var(--rest); }
.poster-saldi .band .cut {
  background-color: var(--violet);
  clip-path: polygon(0 16%, 21% 2%, 46% 12%, 73% 0, 100% 11%, 100% 100%, 0 100%);
}
.poster-saldi .band .tape { top: 4%; right: 12%; }
.poster-saldi .sun { width: 42%; aspect-ratio: 1; top: 8%; right: 8%; filter: var(--rest); }
.poster-saldi .sun .cut { background-color: var(--orange); border-radius: 50% 46% 53% 48% / 48% 54% 46% 52%; }
.poster-saldi .sun .tape { bottom: -4%; left: -10%; transform: rotate(5deg); }
.poster-saldi .title { left: 8%; top: 38%; }
.poster-saldi .title .tape { top: -34%; left: 0; }

/* Café post */
.poster-bar .bg { background-color: #cfe6ff; }
.poster-bar .cup { width: 44%; height: 30%; left: 24%; bottom: 13%; filter: var(--rest); }
.poster-bar .cup .cut { background-color: var(--pink); border-radius: 4% 4% 42% 42% / 6% 6% 58% 58%; }
.poster-bar .cup .handle {
  position: absolute;
  right: -24%;
  top: 14%;
  width: 34%;
  height: 50%;
  border: 6cqi solid var(--pink);
  border-radius: 50%;
}
.poster-bar .cup .tape { bottom: -12%; left: 4%; transform: rotate(3deg); }
.poster-bar .steam { left: 30%; width: 32%; bottom: 45%; height: 20%; display: flex; justify-content: space-between; }
.poster-bar .steam i {
  width: 14%;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transform: rotate(8deg);
  box-shadow: 0 2px 3px rgba(43, 36, 64, 0.12);
}
.poster-bar .steam i:nth-child(2) { height: 80%; align-self: end; transform: rotate(-6deg); }
.poster-bar .steam .tape { top: -26%; right: -38%; transform: rotate(-6deg); }
.poster-bar .title { left: 8%; top: 7%; }
.poster-bar .title .tape { bottom: -26%; right: 0; transform: rotate(3deg); }

/* Party invitation */
.poster-festa .bg { background-color: #fbd3ec; }
.poster-festa .flags { left: 0; right: 0; top: 4%; height: 18%; border-top: 2px solid var(--ink); filter: var(--rest); }
.poster-festa .flags .cut {
  height: 72%;
  background: repeating-linear-gradient(90deg, var(--orange) 0 14.28%, var(--sky) 14.28% 28.57%, var(--violet) 28.57% 42.86%);
  -webkit-mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 0 / 14.28% 100% repeat-x;
  mask: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 0 / 14.28% 100% repeat-x;
}
.poster-festa .flags .tape { top: 70%; right: 6%; transform: rotate(4deg); }
.poster-festa .confetti {
  inset: 24% 4% 4%;
  background:
    radial-gradient(circle, var(--orange) 0 4px, transparent 4.5px) 0 0 / 52px 46px,
    radial-gradient(circle, var(--sky) 0 3.5px, transparent 4px) 19px 21px / 61px 53px,
    radial-gradient(circle, var(--violet) 0 3px, transparent 3.5px) 37px 9px / 47px 59px,
    radial-gradient(circle, #fff 0 3.5px, transparent 4px) 9px 33px / 67px 41px;
}
.poster-festa .confetti .tape { bottom: 2%; left: 4%; transform: rotate(-3deg); }
.poster-festa .title { left: 8%; right: 8%; top: 38%; text-align: center; }
.poster-festa .title .poster-type { font-size: 16cqi; }
.poster-festa .title .tape { top: -20%; right: 10%; transform: rotate(5deg); }

/* Mini layers panel under the poster */

.layers {
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 12px;
  background: var(--lavender);
  font-size: 0.8125rem;
  font-weight: 600;
}

.layers li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
}

.layers li:first-child { background: #ded5fb; }

.layers .eye {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 1.8;
}

.sw {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--field-line);
  font: 800 0.75rem/1 var(--display);
}
.sw-ink { background: #fff; color: var(--ink); }
.sw-orange { background: var(--orange); }
.sw-violet { background: var(--violet); }
.sw-white { background: #fff; }
.sw-pink { background: var(--pink); }
.sw-sky { background: var(--sky); }
.sw-confetti {
  background:
    radial-gradient(circle, var(--orange) 0 2px, transparent 2.5px) 2px 3px / 9px 9px,
    radial-gradient(circle, var(--sky) 0 2px, transparent 2.5px) 6px 7px / 9px 9px,
    #fff;
}

/* Prompt chips */

.prompts {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.prompts-label { flex: none; font-weight: 600; font-size: 0.9375rem; color: var(--ink-dim); margin-right: 0.25rem; }

.prompts label {
  flex: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 2px solid var(--field-line);
  background: var(--sheet);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms var(--ease-out);
}

.prompts label:hover { border-color: var(--violet); transform: translateY(-1px); }

#r-saldi:checked ~ .prompts label[for="r-saldi"],
#r-bar:checked ~ .prompts label[for="r-bar"],
#r-festa:checked ~ .prompts label[for="r-festa"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

#r-saldi:focus-visible ~ .prompts label[for="r-saldi"],
#r-bar:focus-visible ~ .prompts label[for="r-bar"],
#r-festa:focus-visible ~ .prompts label[for="r-festa"] {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The mascot sits on the corner of the window, like on the app's start screen. */
.hero-mascot {
  position: absolute;
  z-index: 4;
  right: clamp(-46px, -2.5vw, -12px);
  top: -38px;
  width: clamp(110px, 10vw, 150px);
  transform: rotate(8deg);
}
.hero-mascot img { filter: var(--rest); }
.hero-mascot .wink { position: absolute; inset: 0; opacity: 0; }
.hero-mascot:hover .wink { opacity: 1; }

/* Sections share one rhythm. */

/* Every section fits in one screen: padding and the big pieces are sized by the screen's height.
   The bottom padding also holds the next sheet's wave, which overlaps it, so no content sits under it. */
.how, .modes, .inside, .assistant, .pricing, .faq, .close {
  position: relative;
  padding: clamp(1.5rem, 4.5svh, 4.5rem) var(--gutter) calc(clamp(1.5rem, 4.5svh, 4.5rem) + var(--wave));
}

/* Every sheet meets the one before along a wave, and overlaps it. The mask shapes the top edge;
   the seam line (.seam) is drawn on the same curve. Alternate sheets use the mirrored wave. */
.how, .modes, .inside, .assistant, .pricing, .faq, .close, .footer {
  margin-top: calc(var(--wave) * -1);
  padding-top: calc(clamp(1.5rem, 4.5svh, 4.5rem) + var(--wave));
  -webkit-mask-image: var(--wave-l), linear-gradient(#000 0 0);
  mask-image: var(--wave-l), linear-gradient(#000 0 0);
  -webkit-mask-size: 100% var(--wave), 100% calc(100% - var(--wave) + 1px);
  mask-size: 100% var(--wave), 100% calc(100% - var(--wave) + 1px);
  -webkit-mask-position: top, bottom;
  mask-position: top, bottom;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.modes, .assistant, .faq, .footer {
  -webkit-mask-image: var(--wave-r), linear-gradient(#000 0 0);
  mask-image: var(--wave-r), linear-gradient(#000 0 0);
}

/* How it works: one collage of the three moments, then the numbered steps. */

.how { background-color: var(--sheet); }

.how-collage {
  position: relative;
  height: clamp(170px, 30svh, 330px);
  margin-top: clamp(1.25rem, 4svh, 2.5rem);
  border-radius: 22px;
  background-color: var(--lavender);
  background-image: var(--grain);
  overflow: hidden;
}

.how-collage .tape { font-size: 0.75rem; }

.c-slip {
  position: absolute;
  z-index: 1;
  left: 5%;
  top: 22%;
  width: 31%;
  padding: 1.1rem 1.25rem;
  border-radius: 18px 18px 4px 18px;
  background-color: var(--sky);
  background-image: var(--grain);
  font-weight: 600;
  font-size: clamp(0.85rem, min(1.25vw, 2.2svh), 1.1rem);
  line-height: 1.4;
  filter: var(--rest);
  transform: rotate(-3deg);
}
.c-slip .tape { top: -10px; left: 12px; }

.c-stack { position: absolute; z-index: 2; left: 31%; top: 9%; width: 36%; height: 82%; }
.c-stack i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  height: 82%;
  border-radius: 6px;
  background-image: var(--grain);
  filter: var(--rest);
  transition: transform 400ms var(--ease-out);
}
.c-stack .a { background-color: var(--violet); transform: translate(-82%, -50%) rotate(-11deg); }
.c-stack .b { background-color: var(--pink); transform: translate(-50%, -54%) rotate(-1deg); }
.c-stack .c { background-color: var(--orange); transform: translate(-18%, -46%) rotate(10deg); }
.c-stack .tape { top: 2%; left: 28%; transform: rotate(-5deg); }

/* Hovering the collage lifts the layers apart. */
.how-collage:hover .c-stack .a { transform: translate(-100%, -50%) rotate(-17deg); }
.how-collage:hover .c-stack .c { transform: translate(0%, -46%) rotate(16deg); }

.c-edit { position: absolute; z-index: 3; right: 5%; top: 14%; width: 25%; height: 72%; }
.c-edit .sheet {
  position: absolute;
  inset: 12%;
  border-radius: 50% 46% 53% 48% / 48% 54% 46% 52%;
  background-color: var(--orange);
  background-image: var(--grain);
  filter: var(--rest);
  outline: 2px dashed var(--violet);
  outline-offset: 8px;
  transform: rotate(-6deg);
  transition: transform 400ms var(--ease-out);
}
.how-collage:hover .c-edit .sheet { transform: rotate(5deg) scale(1.07); }
.c-edit .handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--violet);
  background: #fff;
  border-radius: 3px;
}
.c-edit .h1 { left: calc(12% - 16px); top: calc(12% - 16px); }
.c-edit .h2 { right: calc(12% - 16px); top: calc(12% - 16px); }
.c-edit .h3 { left: calc(12% - 16px); bottom: calc(12% - 16px); }
.c-edit .h4 { right: calc(12% - 16px); bottom: calc(12% - 16px); }
.c-edit .tape { bottom: 0; right: 4%; transform: rotate(4deg); }

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
  margin: clamp(1.25rem, 3.5svh, 2.25rem) 0 0;
  padding: 0;
  list-style: none;
}

/* The numbers are strips of paper too. */
.num {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.12em 0.6em 0.18em;
  font: 800 1.6rem/1 var(--display);
  color: #fff;
  background-color: var(--violet);
  background-image: var(--grain);
  clip-path: polygon(4% 6%, 100% 0, 96% 100%, 0 92%);
  transform: rotate(-4deg);
}
.n-2 { background-color: var(--pink); transform: rotate(3deg); }
.n-3 { background-color: var(--orange); color: var(--ink); transform: rotate(-2deg); }

.how-step h3 { font-size: clamp(1.25rem, min(2vw, 3.2svh), 1.55rem); }
.how-step p { margin-top: 0.45rem; color: var(--ink-dim); max-width: 26rem; }

/* Modes: picking one floods the sheet in that mode's paper colour. */

.modes {
  --flood: var(--orange);
  --flood-ink: var(--ink);
  background-color: var(--flood);
  background-image: var(--grain);
  color: var(--flood-ink);
  transition: background-color 450ms var(--ease-out), color 450ms var(--ease-out);
}

.modes:has(#modo-manuale:checked) { --flood: var(--sky); }
.modes:has(#modo-semi:checked) { --flood: var(--violet); --flood-ink: #fff; }


.modes-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem 2rem;
}

.modes-head h2 { grid-column: 1; }
.modes-head p { grid-column: 1; max-width: var(--measure); font-size: 1.125rem; }

.segments {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(7.25rem, 1fr));
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  filter: var(--rest);
}

.segments .thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / 3);
  border-radius: 12px;
  background: var(--ink);
  transition: transform 340ms var(--ease-out);
}

#modo-semi:checked ~ .modes-head .thumb { transform: translateX(100%); }
#modo-vibe:checked ~ .modes-head .thumb { transform: translateX(200%); }

.segments label {
  position: relative;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-dim);
  cursor: pointer;
  user-select: none;
  transition: color 200ms ease, background-color 0s;
}

.segments label:hover { color: var(--ink); }

#modo-manuale:checked ~ .modes-head label[for="modo-manuale"],
#modo-semi:checked ~ .modes-head label[for="modo-semi"],
#modo-vibe:checked ~ .modes-head label[for="modo-vibe"] {
  color: #fff;
  /* Fills in once the thumb has arrived, so the label carries its own background. */
  background-color: var(--ink);
  transition: color 200ms ease, background-color 0s 300ms;
}

#modo-manuale:focus-visible ~ .modes-head label[for="modo-manuale"],
#modo-semi:focus-visible ~ .modes-head label[for="modo-semi"],
#modo-vibe:focus-visible ~ .modes-head label[for="modo-vibe"] {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.mode-panel { display: none; margin: clamp(1.5rem, 4svh, 3rem) 0 0; }

#modo-manuale:checked ~ .mode-panels .panel-manuale,
#modo-semi:checked ~ .mode-panels .panel-semi,
#modo-vibe:checked ~ .mode-panels .panel-vibe {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.mode-panel h3 { font-size: clamp(2rem, 3.4vw, 2.75rem); }
.mode-panel figcaption p { margin-top: 0.8rem; font-size: 1.125rem; }
.mode-panel .for {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.35rem 0.8rem;
  background: var(--tape);
  color: var(--ink);
  font-weight: 700;
  clip-path: polygon(2% 0, 98% 0, 100% 40%, 98% 100%, 2% 100%, 0 60%);
  transform: rotate(-2deg);
}

/* Screenshots are prints taped onto the sheet, sized so the whole sheet fits one screen. */
.shot {
  position: relative;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: clamp(6px, 0.8vw, 12px);
  background: var(--sheet);
  border-radius: 6px;
  filter: var(--lift);
  transform: rotate(-0.8deg);
}
.shot::before, .shot::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -12px;
  width: 92px;
  height: 26px;
  background: var(--tape);
  clip-path: var(--tape-cut);
}
.shot::before { left: 6%; transform: rotate(-5deg); }
.shot::after { right: 6%; transform: rotate(4deg); }
.shot img { border-radius: 3px; width: auto; max-height: max(200px, calc(100svh - 470px)); }

/* Inside: the app's layers panel, one feature per layer. */

.inside { background-color: var(--lavender); }

.inside-head { display: grid; gap: 1rem; max-width: 46rem; }
.inside-head p { font-size: 1.125rem; color: var(--ink-dim); max-width: var(--measure); }

.panel-board {
  margin-top: clamp(1.5rem, 4svh, 3rem);
  border-radius: 20px;
  background: var(--sheet);
  filter: var(--lift);
  overflow: hidden;
}

.panel-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.panel-tabs span { padding: 0.3rem 0.75rem; border-radius: 8px; }
.panel-tabs .on { background: var(--lavender-2); color: var(--ink); }

.feature-layers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 0.5rem;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
}

.feature-layers li {
  display: grid;
  grid-template-columns: 24px 64px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: clamp(0.6rem, 1.6svh, 0.9rem) 1rem;
  border-radius: 14px;
  transition: background-color 150ms ease;
}
.feature-layers li:first-child,
.feature-layers li:hover { background: var(--hover); }
.feature-layers li:first-child:hover { background: #ded5fb; }

.feature-layers .eye { width: 20px; height: 20px; fill: none; stroke: var(--ink-dim); stroke-width: 1.7; }

.feature-layers .thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--field-line);
  /* A layer's preview: its piece of paper on the transparency checkerboard. */
  background: repeating-conic-gradient(#e7e2f5 0 25%, #fff 0 50%) 0 0 / 12px 12px;
}

.feature-layers .thumb svg {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 10px;
  background-image: var(--grain);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(43, 36, 64, 0.25));
  transform: rotate(-4deg);
  transition: transform 220ms var(--ease-out);
}
.feature-layers li:nth-child(even) .thumb svg { transform: rotate(4deg); }
.feature-layers li:hover .thumb svg { transform: rotate(0) scale(1.08); }

.t-violet svg { background-color: var(--violet); stroke: #fff; }
.t-pink svg { background-color: var(--pink); stroke: #fff; }
.t-orange svg { background-color: var(--orange); stroke: var(--ink); }
.t-sky svg { background-color: var(--sky); stroke: var(--ink); }

.feature-layers h3 { font-size: 1.25rem; }
.feature-layers p { margin-top: 0.2rem; color: var(--ink-dim); max-width: 36rem; font-size: 0.975rem; line-height: 1.5; }

/* Each piece is cut to its own shape. */
.feature-layers li:nth-child(2) .thumb svg { border-radius: 50%; }
.feature-layers li:nth-child(3) .thumb svg { border-radius: 50% 46% 53% 48% / 48% 54% 46% 52%; }
.feature-layers li:nth-child(4) .thumb svg { border-radius: 3px; }
.feature-layers li:nth-child(5) .thumb svg { border-radius: 22px 22px 6px 6px; }
.feature-layers li:nth-child(6) .thumb svg { border-radius: 14px 4px 14px 4px; }

.swipe-hint { display: none; }

/* Assistant: notes taped to a violet sheet. */

.assistant {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  background-color: var(--violet);
  background-image: var(--grain);
  color: #fff;
}

.assistant-head { position: sticky; top: 7rem; }
.assistant-head p { margin-top: 1rem; font-size: 1.125rem; max-width: 26rem; }

.assistant-mascot {
  width: min(300px, 70%);
  margin-top: 2rem;
  filter: var(--lift);
  transform: rotate(-4deg);
}

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.note {
  position: relative;
  padding: 1.75rem 1.4rem 1.5rem;
  border-radius: 4px;
  background-color: var(--sheet);
  background-image: var(--grain);
  color: var(--ink);
  filter: var(--rest);
  transition: transform 220ms var(--ease-out), filter 220ms ease;
}
.note::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 24px;
  background: var(--tape);
  clip-path: var(--tape-cut);
  transform: translateX(-50%) rotate(-3deg);
}
.note h3 { font-size: 1.3rem; }
.note p { margin-top: 0.5rem; color: var(--ink-dim); }

.n1 { transform: rotate(-1.5deg); }
.n2 { transform: rotate(1.2deg) translateY(1rem); background-color: #fff4fb; }
.n3 { transform: rotate(0.8deg); background-color: #f0f7ff; }
.n4 { transform: rotate(-1deg) translateY(1rem); background-color: #fff5ee; }

.note:hover { transform: rotate(0) translateY(-4px); filter: var(--lift); }

/* Pricing: PLACEHOLDER until the Premium plan is decided. Two sheets taped on a sky field. */

.pricing { background-color: var(--sky); background-image: var(--grain); }

.pricing-head { display: grid; gap: 0.8rem; }
.pricing-head p { max-width: var(--measure); font-size: 1.125rem; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 72rem;
  margin-top: clamp(1.5rem, 4svh, 2.75rem);
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3svh, 2rem) clamp(1.25rem, 2.5vw, 2rem);
  border-radius: 6px;
  background-color: var(--sheet);
  background-image: var(--grain);
  filter: var(--rest);
  transform: rotate(-0.7deg);
}

.plan-premium { background-color: var(--violet); color: #fff; transform: rotate(0.8deg); }
.plan-premium .tape { top: -12px; right: 1.5rem; font-size: 0.8125rem; transform: rotate(4deg); }

.plan h3 { font-size: 1.6rem; }
.plans-note { max-width: var(--measure); margin-top: clamp(1.25rem, 3svh, 2rem); font-size: 0.9375rem; }

.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.2rem 0.6rem; margin-top: 0.4rem; }
.price .amount { font: 800 clamp(2.2rem, min(4.5vw, 6svh), 3.2rem)/1 var(--display); }
.price .per { font-size: 0.9375rem; color: var(--ink-dim); }
.plan-premium .price .per { color: #fff; }

.plan ul { display: grid; gap: 0.45rem; margin: clamp(0.9rem, 2.5svh, 1.4rem) 0; padding: 0; list-style: none; flex: 1; }
.plan li { display: flex; gap: 0.55rem; align-items: flex-start; line-height: 1.45; }
.plan li svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  fill: none;
  stroke: var(--violet);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plan-premium li svg { stroke: #fff; }
.plan li.tbd { font-style: italic; }

.plan .button { align-self: flex-start; }
.plan-premium .button.soon {
  border-color: #fff;
  background: transparent;
  color: #fff;
  cursor: default;
  filter: none;
}
.plan-premium .button.soon:hover { transform: none; filter: none; }

/* Questions */

.faq { background-color: var(--sheet); }

.faq h2 { font-size: clamp(3rem, min(9vw, 11svh), 6.5rem); align-items: center; }
.faq .strip.s1 { transform: rotate(-2deg); }

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1rem 1.5rem;
  max-width: 72rem;
  margin: clamp(1.5rem, 4svh, 3rem) auto 0;
}

.faq details {
  position: relative;
  border-radius: 4px;
  background-color: var(--lavender);
  background-image: var(--grain);
  filter: var(--rest);
  transform: rotate(-0.5deg);
  transition: transform 200ms var(--ease-out);
}
.faq details:nth-child(even) { transform: rotate(0.6deg); }
.faq details:nth-child(3n) { background-color: #fff4fb; }
.faq details:hover, .faq details[open] { transform: rotate(0); }
.faq details::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 18px;
  width: 64px;
  height: 20px;
  background: var(--tape);
  clip-path: var(--tape-cut);
  transform: rotate(-4deg);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.85rem, 2svh, 1.1rem) 1.3rem;
  cursor: pointer;
  list-style: none;
  font: 700 1.15rem/1.3 var(--display);
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary svg {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 8px;
  background: var(--lavender-2);
  fill: none;
  stroke: var(--violet-deep);
  stroke-width: 2.4;
  stroke-linecap: round;
  transition: transform 220ms var(--ease-out), background-color 220ms ease;
}

.faq details[open] summary svg { transform: rotate(45deg); background: #ded5fb; }

.faq details p { padding: 0 1.4rem 1.3rem; color: var(--ink-dim); max-width: 36rem; }

/* Close: the last sheet, in orange. */

.close { background-color: var(--lavender); background-image: var(--grain); }

.close-sheet {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, min(6vw, 6.5svh), 5rem);
  border-radius: clamp(24px, 4vw, 40px);
  background-color: var(--orange);
  background-image: var(--grain);
  box-shadow: 0 30px 50px -30px rgba(43, 36, 64, 0.5);
}

.close-sheet h2 { font-size: clamp(2.6rem, min(8vw, 9.5svh), 6rem); }
.close-sheet .strip.s1 { background-color: var(--violet); color: #fff; }
.close-sheet .strip.s2 { background-color: var(--sheet); color: var(--ink); }
.close-sheet p { margin-top: clamp(0.9rem, 2.5svh, 1.5rem); max-width: 30rem; font-size: 1.2rem; font-weight: 500; }
.close-sheet .actions { position: relative; z-index: 2; }

.close-mascot {
  position: absolute;
  right: clamp(-40px, -2vw, 0px);
  bottom: 0;
  width: clamp(120px, 16vw, 220px);
  transform: rotate(6deg);
  filter: var(--lift);
}

/* Footer */

.footer {
  padding-bottom: 2.5rem;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  background-color: var(--ink);
  color: #e9e4fb;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

.footer .brand { color: #fff; }
.footer-brand p { margin-top: 1rem; max-width: 20rem; }
.footer-brand .domain { margin-top: 0.4rem; font-weight: 600; color: #fff; }

.footer nav { display: grid; gap: 0.5rem; align-content: start; }
.footer h2 { font: 700 1.1rem/1.2 var(--display); color: #fff; margin-bottom: 0.3rem; }
.footer nav a { color: #d6ccfa; text-decoration: none; }
.footer nav a:hover { color: #fff; text-decoration: underline; }
.footer :focus-visible { outline-color: #fff; }

.footer-legal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.875rem;
  color: #c9c0ea;
}
.footer-legal p { max-width: 34rem; }
.footer-legal p + p { margin-top: 0.4rem; }

/* Motion. The opening pastes the headline strips and the window down like paper,
   then the demo plays: the request, the assistant typing, each layer landing with its label.
   Choosing another request plays it again. Nothing loops forever. */

@keyframes land {
  from { opacity: 0; transform: translateY(-26px) rotate(var(--r-from, -5deg)) scale(1.04); }
}

@keyframes drop {
  0% { opacity: 0; transform: translateY(-34%) rotate(-7deg) scale(1.06); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
}

@keyframes fade { from { opacity: 0; } }

@keyframes paste {
  0% { opacity: 0; transform: translateY(-20px) rotate(-3.5deg) scale(1.02); }
  100% { opacity: 1; transform: rotate(-0.8deg); }
}

@keyframes typing-life {
  0% { visibility: visible; opacity: 0; }
  10%, 90% { visibility: visible; opacity: 1; }
  100% { visibility: hidden; opacity: 0; }
}

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(-8px); background-color: #cfc2fa; }
}

@keyframes wink {
  0%, 20% { opacity: 0; }
  20.5%, 23.5% { opacity: 1; }
  24%, 100% { opacity: 0; }
}

@keyframes paint { to { stroke-dashoffset: 0; } }

@keyframes draw-from-left { from { clip-path: inset(-50% 100% -50% 0); } to { clip-path: inset(-50% 0 -50% 0); } }
@keyframes draw-from-right { from { clip-path: inset(-50% 0 -50% 100%); } to { clip-path: inset(-50% 0 -50% 0); } }

@media (prefers-reduced-motion: no-preference) {
  .hero .strip { animation: land 620ms var(--ease-drop) both; }
  .hero .strip.s1 { animation-delay: 80ms; --r-from: -7deg; }
  .hero .strip.s2 { animation-delay: 230ms; --r-from: 5deg; }
  .hero .strip.s3 { animation-delay: 380ms; --r-from: -4deg; }
  .hero .lead, .hero .actions, .hero .fine { animation: fade 600ms ease-out 650ms both; }

  .window { animation: land 760ms var(--ease-drop) 300ms both; --r-from: 3deg; }
  .hero-mascot { animation: land 700ms var(--ease-drop) 900ms both; --r-from: -10deg; }
  .hero-mascot .wink { animation: wink 6s linear 2.6s 3; }
  .hero-mascot:hover .wink { animation: none; }


  .scene .msg.user { animation: pop 380ms var(--ease-out) 0.7s both; }
  .scene .typing { animation: typing-life 1.1s linear 1.15s both; }
  .scene .typing i { animation: typing-dot 0.9s ease-in-out 1.15s 2; }
  .scene .typing i:nth-child(2) { animation-delay: 1.3s; }
  .scene .typing i:nth-child(3) { animation-delay: 1.45s; }
  .scene .msg.bot:not(.done) { animation: pop 380ms var(--ease-out) 2.1s both; }
  .scene .steps li { animation: pop 320ms var(--ease-out) var(--t) both; }
  .scene .msg.done { animation: pop 420ms var(--ease-out) 5s both; }

  .scene .piece { animation: drop 680ms var(--ease-drop) var(--t) both; }
  .scene .piece.bg { animation: fade 400ms ease-out var(--t) both; }
  .scene .piece .tape { animation: pop 300ms var(--ease-out) calc(var(--t) + 0.45s) both; }

  .scene .layers li { animation: row-in 420ms var(--ease-out) var(--t) both; }

  #modo-manuale:checked ~ .mode-panels .panel-manuale .shot,
  #modo-semi:checked ~ .mode-panels .panel-semi .shot,
  #modo-vibe:checked ~ .mode-panels .panel-vibe .shot {
    animation: paste 520ms var(--ease-drop);
  }

  #modo-manuale:checked ~ .mode-panels .panel-manuale figcaption,
  #modo-semi:checked ~ .mode-panels .panel-semi figcaption,
  #modo-vibe:checked ~ .mode-panels .panel-vibe figcaption {
    animation: fade 300ms ease-out;
  }

  .faq details[open] p { animation: fade 260ms ease-out; }

  /* The ribbons draw themselves in on their own when the page opens, one after another from
     alternating sides (a clip reveal: a dash on a non-scaling stroke renders dotted), then the paint
     keeps flowing slowly along them. */
  .seam svg { animation: draw-from-left 1.4s cubic-bezier(0.65, 0, 0.35, 1) both; }
  .seam.from-right svg { animation-name: draw-from-right; }
  main > .seam:nth-of-type(1) svg { animation-delay: 0.9s; }
  main > .seam:nth-of-type(2) svg { animation-delay: 1.3s; }
  main > .seam:nth-of-type(3) svg { animation-delay: 1.7s; }
  main > .seam:nth-of-type(4) svg { animation-delay: 2.1s; }
  main > .seam:nth-of-type(5) svg { animation-delay: 2.5s; }
  main > .seam:nth-of-type(6) svg { animation-delay: 2.9s; }
  main > .seam:nth-of-type(7) svg { animation-delay: 3.3s; }
  body > .seam svg { animation-delay: 3.7s; }
  .seam path { stroke: url(#paint-flow); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typing { display: none; }
  .button:hover, .button:active, .note:hover { transform: none; }
  .segments .thumb { transition: none; }
  .modes { transition: none; }
}

/* Narrow screens */

@media (max-width: 1100px) {
  /* Stacked hero: shorter copy and a smaller poster keep it within one screen. */
  .hero { grid-template-columns: 1fr; gap: 2.25rem; padding-top: 1.75rem; padding-bottom: 3.75rem; }
  .hero-copy { max-width: 40rem; }
  .demo { max-width: 46rem; }
  .lead-long, .hero .fine { display: none; }
  .lead-short { display: inline; }
  .poster { height: clamp(150px, calc(100svh - 820px), 320px); }
  .composer { display: none; }
}

/* The nav's section links fold into the menu before they would wrap. */
@media (max-width: 1180px) {
  .nav-links { display: none; }
  .menu { display: block; }
}

@media (max-width: 960px) {

  .modes-head { grid-template-columns: 1fr; }
  .segments { grid-column: 1; grid-row: auto; justify-self: start; }

  #modo-manuale:checked ~ .mode-panels .panel-manuale,
  #modo-semi:checked ~ .mode-panels .panel-semi,
  #modo-vibe:checked ~ .mode-panels .panel-vibe {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .shot img { max-height: max(180px, calc(100svh - 620px)); }

  /* The closing mascot moves into the flow, under the buttons, so it never covers them. */
  .close-mascot { position: relative; right: auto; bottom: auto; margin: 1.25rem 0 -1rem auto; width: 120px; }

  .assistant { grid-template-columns: 1fr; gap: 2rem; }
  .assistant-head { position: relative; top: auto; padding-right: 9rem; }
  .assistant-mascot { position: absolute; right: 0; top: -0.5rem; width: 8rem; margin: 0; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .nav-cta { display: none; }

  /* Hero: headline strips stay one line each, both buttons side by side. */
  .hero { min-height: 0; padding-top: 1.1rem; padding-bottom: calc(var(--wave) + 1rem); gap: 1.5rem; }
  .hero h1 { font-size: 7.3vw; }
  .lead { font-size: 1rem; margin-top: 1rem; }
  .hero .actions { flex-wrap: nowrap; margin-top: 1.1rem; }
  .hero .actions .button { flex: 1 1 auto; padding-inline: 0.9rem; min-height: 46px; }
  .button .long { display: none; }
  .hero-mascot { top: -24px; right: -4px; width: 80px; }
  .window-bar { padding: 0.5rem 5.25rem 0.5rem 0.9rem; }
  .window-title { display: none; }

  /* Demo: the request, then the picture, then the answer. */
  .scene { grid-template-columns: 1fr; gap: 0.7rem; padding: 0.85rem; }
  .chat { display: contents; }
  .scene .steps, .scene .typing, .scene .msg.bot:not(.done), .composer { display: none; }
  .poster-col { grid-row: 2; grid-template-columns: auto minmax(0, 1fr); align-items: end; }
  .scene .msg.done { grid-row: 3; }
  .poster { height: clamp(96px, calc(100svh - 660px), 200px); }
  .layers { font-size: 0.75rem; }
  .layers .eye { display: none; }

  /* Requests scroll sideways in one row. */
  .prompts {
    margin-top: 0.8rem;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.2rem var(--gutter) 0.4rem;
  }

  /* How it works: a smaller collage, then three steps to swipe. */
  .how-collage { height: 190px; }
  .c-slip { left: 3%; top: 18%; width: 40%; padding: 0.7rem 0.8rem; font-size: 0.8rem; z-index: 4; }
  .slip-more { display: none; }
  .c-stack { left: 40%; width: 36%; }
  .c-edit { right: 1%; width: 28%; }
  .how-steps {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.25rem var(--gutter) 0.5rem;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .how-step { scroll-snap-align: start; }

  .segments { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); }
  .segments label { padding: 0.65rem 0.4rem; }
  .mode-panel h3 { font-size: 1.9rem; }
  .mode-panel figcaption p { font-size: 1rem; }
  .shot img { max-height: none; width: 100%; }

  /* Inside: the layer rows scroll sideways, three at a time. */
  .feature-layers {
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .feature-layers li { scroll-snap-align: start; grid-template-columns: 44px minmax(0, 1fr); gap: 0.8rem; padding: 0.7rem 0.6rem; }
  .feature-layers .eye { display: none; }
  .feature-layers .thumb { width: 44px; height: 44px; }
  .feature-layers .thumb svg { width: 32px; height: 32px; padding: 6px; }
  .swipe-hint { display: block; margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-dim); }
  .feature-layers h3 { font-size: 1.1rem; }
  .feature-layers p { font-size: 0.9rem; }

  /* Assistant: the notes scroll sideways. */
  .assistant-head { padding-right: 6.5rem; }
  .assistant-mascot { width: 6rem; top: -0.25rem; }
  .notes {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 1rem var(--gutter) 1.25rem;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .note { scroll-snap-align: start; }
  .n2, .n4 { transform: rotate(1deg); }

  /* Pricing: the plans scroll sideways. */
  .plans {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 1rem var(--gutter) 1.25rem;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .plan { scroll-snap-align: start; }
  .pricing-head p { font-size: 1rem; }

  .faq-list { grid-template-columns: 1fr; gap: 0.85rem; }
  .faq summary { font-size: 1.02rem; padding: 0.85rem 1.1rem; }

  .close-sheet .actions { flex-direction: column; }
  .close-sheet .button .long { display: inline; }
  .close-mascot { margin: 1rem -1rem -2.5rem auto; width: 150px; }

  .footer-grid { grid-template-columns: 1fr; }
}

/* Short phones: drop the secondary lines so every section still fits one screen. */
@media (max-width: 640px) and (max-height: 780px) {
  .modes-head p { display: none; }
  .mode-panel figcaption p { margin-top: 0.4rem; }
  .how-collage { height: 160px; }
  .inside-head p { display: none; }
  .hero { gap: 1.25rem; padding-bottom: calc(var(--wave) + 0.5rem); }
  .lead, .scene .msg.done { display: none; }
  .layers li { padding-block: 0.15rem; }
  .hero-mascot { top: -12px; width: 70px; }
  .assistant-head p { display: none; }
  .close-sheet p { margin-top: 1rem; }
  .close-mascot { width: 90px; margin-top: 0.25rem; }
  .pricing-head p { display: none; }
  .plan ul { gap: 0.3rem; margin: 0.7rem 0; }
  .faq h2 { font-size: 2.6rem; }
  .faq-list { gap: 0.6rem; margin-top: 1rem; }
  .faq summary { padding: 0.7rem 1rem; font-size: 0.98rem; }
  .note { padding: 1.4rem 1.2rem 1.2rem; }
}

/* Phones up to 860px tall: the mode's audience tag goes, so the orange sheet fits one screen. */
@media (max-width: 640px) and (max-height: 860px) {
  .mode-panel .for { display: none; }
}

/* Short laptop screens: the line under "Cosa c'è dentro" and the demo's message box go, so
   those sections fit one screen. */
@media (min-width: 641px) and (max-height: 740px) {
  .inside-head p, .composer { display: none; }
}
