:root {
  color-scheme: dark;
  --ink: #eefbff;
  --muted: #acd0dc;
  --deep: #041621;
  --deep-2: #08283a;
  --cyan: #62e5ff;
  --aqua: #22c8ce;
  --coral: #ff765b;
  --yellow: #ffd65a;
  --line: rgba(158, 226, 239, 0.2);
  --glass: rgba(4, 30, 45, 0.56);
  --radius: 2rem;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--deep);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 10%, rgba(34, 200, 206, 0.12), transparent 30rem),
    var(--deep);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--deep);
  transform: translateY(-200%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(calc(100% - 2rem), var(--max));
  padding: 0.65rem 0.8rem 0.65rem 1.1rem;
  border: 1px solid rgba(218, 248, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 28, 42, 0.48);
  box-shadow: 0 1rem 3rem rgba(0, 13, 25, 0.24);
  backdrop-filter: blur(18px) saturate(1.2);
  transform: translateX(-50%);
  transition: background 220ms ease, border-color 220ms ease;
}

.site-header.is-scrolled {
  border-color: rgba(218, 248, 255, 0.28);
  background: rgba(5, 28, 42, 0.86);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

/* The logo: the same drawing as the app icon and the favicon (tools/make-icons.py), not a font glyph. */
.brand-mark {
  display: block;
  width: 2rem;
  height: 2rem;
}

.nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2rem);
}

.nav a {
  color: rgba(238, 251, 255, 0.82);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--cyan);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  padding: 0.8rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-small {
  justify-self: end;
  min-height: 2.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.button-glass {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
}

.button-primary {
  background: linear-gradient(135deg, var(--coral), #ffb453);
  color: #10202b;
  box-shadow: 0 1rem 2.5rem rgba(255, 118, 91, 0.28);
}

.button-primary:hover,
.button-primary:focus-visible {
  box-shadow: 0 1.1rem 3rem rgba(255, 118, 91, 0.42);
}

.hero {
  position: relative;
  display: grid;
  min-height: max(46rem, 100svh);
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  z-index: -4;
  inset: -8%;
  background: url("assets/coral-playground.webp") center / cover no-repeat;
  filter: saturate(0.88) brightness(0.66);
  will-change: transform;
}

.hero-vignette {
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 20, 31, 0.76) 0%, rgba(3, 20, 31, 0.35) 48%, rgba(3, 20, 31, 0.1) 100%),
    linear-gradient(0deg, var(--deep) 0%, transparent 26%, rgba(2, 16, 27, 0.12) 100%);
}

.hero-content {
  width: min(calc(100% - 2.5rem), var(--max));
  padding-top: 5.5rem;
}

.eyebrow,
.kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 2.4rem;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  /* Wide enough for "Розфарбуйте рибку," on one line at full size; it still stops short of the fish on the right. */
  max-width: 1080px;
  margin: 0;
  font-size: clamp(3.5rem, 7.2vw, 7.8rem);
  line-height: 0.92;
  letter-spacing: -0.068em;
}

h1 em {
  color: var(--yellow);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.hero-copy {
  max-width: 650px;
  margin: 2rem 0 0;
  color: rgba(238, 251, 255, 0.82);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.text-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 750;
  text-underline-offset: 0.35rem;
}

.text-link span {
  color: var(--cyan);
  font-size: 1.2rem;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: 100%;
  margin-top: 2.1rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 30, 45, 0.28);
  color: rgba(238, 251, 255, 0.72);
  font-size: 0.88rem;
  backdrop-filter: blur(14px);
}

.hero-note-icon {
  color: var(--yellow);
}

@keyframes float {
  0%,
  100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

.bubbles {
  position: absolute;
  z-index: -2;
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid rgba(215, 250, 255, 0.6);
  border-radius: 50%;
  box-shadow:
    1.8rem -3rem 0 -0.08rem rgba(215, 250, 255, 0.25),
    -1rem -6rem 0 0.12rem rgba(215, 250, 255, 0.18),
    2.7rem -9.4rem 0 -0.14rem rgba(215, 250, 255, 0.3),
    0.4rem -13rem 0 0.18rem rgba(215, 250, 255, 0.16);
  animation: bubble-rise 9s linear infinite;
}

.bubbles-a {
  right: 9%;
  bottom: 4%;
}

.bubbles-b {
  left: 45%;
  bottom: -3%;
  animation-delay: -4s;
  animation-duration: 12s;
}

@keyframes bubble-rise {
  from { transform: translateY(5rem); opacity: 0; }
  12% { opacity: 1; }
  to { transform: translateY(-36rem); opacity: 0; }
}

.scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  display: grid;
  width: 2rem;
  height: 3.15rem;
  place-items: start center;
  padding-top: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue span {
  width: 0.25rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--cyan);
  animation: scroll-dot 1.7s ease-in-out infinite;
}

@keyframes scroll-dot {
  0% { translate: 0 0; opacity: 0.3; }
  60% { translate: 0 1.2rem; opacity: 1; }
  100% { translate: 0 1.2rem; opacity: 0; }
}

.section {
  position: relative;
  padding: clamp(6rem, 10vw, 9rem) max(1.25rem, calc((100% - var(--max)) / 2));
}

section[id] {
  scroll-margin-top: 6.5rem;
}

.section-how {
  background:
    radial-gradient(circle at 15% 20%, rgba(98, 229, 255, 0.1), transparent 25rem),
    linear-gradient(180deg, var(--deep), #06263a);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  gap: 2rem;
  align-items: start;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 4.5rem 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  list-style: none;
}

.step {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(5, 31, 47, 0.94);
}

.step-visual {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.step-visual::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(3, 22, 35, 0.62));
  content: "";
  pointer-events: none;
}

.step-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), filter 300ms ease;
}

.step:hover .step-visual img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.step-number {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border: 1px solid rgba(213, 247, 255, 0.34);
  border-radius: 50%;
  background: rgba(3, 23, 36, 0.76);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
}

.step-copy {
  min-height: 10.7rem;
  padding: 1.45rem 1.4rem 1.7rem;
}

.step h3 {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.story-panel {
  position: relative;
  display: grid;
  min-height: 48rem;
  padding: clamp(6rem, 11vw, 10rem) max(1.25rem, calc((100% - var(--max)) / 2));
  align-content: center;
  isolation: isolate;
  overflow: hidden;
}

.story-background {
  position: absolute;
  z-index: -3;
  inset: -9%;
  background: url("assets/glowing-garden.webp") center / cover no-repeat;
  filter: saturate(0.9) brightness(0.55);
  will-change: transform;
}

.story-panel::after {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 19, 31, 0.86), rgba(3, 19, 31, 0.2) 65%),
    linear-gradient(180deg, var(--deep) 0%, transparent 18%, transparent 82%, var(--deep) 100%);
  content: "";
}

.story-content {
  max-width: 850px;
}

.story-content h2,
.faq-intro h2,
.final-cta h2,
.case-intro h2,
.toy-intro h2 {
  margin: 0;
  font-size: clamp(2.8rem, 5.7vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.story-content > p:last-child {
  max-width: 680px;
  margin: 2rem 0 0;
  color: rgba(238, 251, 255, 0.78);
  font-size: 1.15rem;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(960px, 100%);
  margin: 5rem 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(213, 247, 255, 0.2);
  border-radius: 1.5rem;
  background: rgba(213, 247, 255, 0.17);
  backdrop-filter: blur(16px);
  list-style: none;
}

.platforms > li {
  display: grid;
}

.platform {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.2rem 1rem;
  align-content: center;
  padding: 1.4rem 1.5rem;
  background: rgba(3, 25, 39, 0.68);
  color: inherit;
  text-decoration: none;
  transition: background 180ms ease;
}

a.platform:hover,
a.platform:focus-visible {
  background: rgba(9, 52, 74, 0.82);
}

.platform-icon {
  display: grid;
  grid-row: 1 / 3;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.9rem;
  place-items: center;
}

.platform-icon svg {
  width: 1.85rem;
  height: 1.85rem;
}

.platform-web {
  background: linear-gradient(150deg, var(--cyan), #1f9fc4);
  color: #03202f;
}

.platform-apple {
  background: linear-gradient(165deg, #22cbff, #1766ef);
  color: #ffffff;
}

.platform-play {
  background: #f3f7fa;
}

.platform-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.platform-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.platform-tag {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 214, 90, 0.16);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.platform-tag.is-live {
  background: rgba(98, 229, 255, 0.16);
  color: var(--cyan);
}

.platforms-free {
  margin: 1.1rem 0 0;
  color: rgba(238, 251, 255, 0.72);
  font-size: 0.95rem;
}

.hero-note strong,
.platforms-free strong {
  color: var(--ink);
  font-weight: 800;
}

/* My face on a fish: the story on the left, the real in-game picture on the right with the editor over its corner. */
.section-face {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 4.5rem;
  align-items: center;
  background:
    radial-gradient(circle at 78% 42%, rgba(255, 214, 90, 0.11), transparent 30rem),
    linear-gradient(180deg, var(--deep), #061d2f);
}

.face-copy h2 {
  margin: 0;
  font-size: clamp(2.5rem, 4.6vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.face-lead {
  max-width: 34rem;
  margin: 1.6rem 0 0;
  color: rgba(238, 251, 255, 0.8);
  font-size: 1.15rem;
}

.face-steps {
  display: grid;
  gap: 1.1rem;
  margin: 2.2rem 0 0;
  padding: 0;
  list-style: none;
}

.face-steps li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 1rem;
  align-items: start;
}

.face-step-number {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #10202b;
  font-weight: 850;
}

.face-steps p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.face-steps b {
  color: var(--ink);
}

.face-private {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 34rem;
  margin: 2.2rem 0 0;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(8, 40, 58, 0.7);
  color: rgba(238, 251, 255, 0.82);
  font-size: 0.95rem;
}

.face-private svg {
  flex: none;
  margin-top: 0.1rem;
  color: var(--cyan);
}

.face-visual {
  position: relative;
  padding-bottom: 4.5rem;
}

.face-visual figure {
  margin: 0;
}

.face-shot img,
.face-editor img {
  display: block;
  width: 100%;
  height: auto;
}

.face-shot {
  overflow: hidden;
  border: 1px solid rgba(213, 247, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 2.2rem 4.5rem rgba(0, 8, 16, 0.4);
}

.face-editor {
  position: absolute;
  bottom: 0;
  left: -2.2rem;
  width: 48%;
  padding: 0.55rem 0.55rem 0.7rem;
  border-radius: 1.3rem;
  background: #fbfaf6;
  box-shadow: 0 1.6rem 3.2rem rgba(0, 8, 16, 0.45);
  rotate: -3deg;
}

.face-editor img {
  border-radius: 0.85rem;
}

.face-editor figcaption {
  margin: 0.55rem 0.2rem 0;
  color: #34495a;
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.section-cases {
  background:
    radial-gradient(circle at 90% 35%, rgba(255, 118, 91, 0.1), transparent 28rem),
    #061d2f;
}

/* Section intros on wide screens: the heading gets the wide column and the lead text sits beside it, level with
   the heading's last line, so a long heading neither piles up in a narrow column nor leaves half the screen empty. */
.case-intro,
.toy-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.5rem 3.5rem;
  align-items: end;
}

.case-intro h2,
.toy-intro h2 {
  /* The content column stops growing at 1240px (from about 1440px wide), so the heading stops growing there too. */
  font-size: clamp(2.6rem, 5.1vw, 4.6rem);
}

.case-intro .kicker,
.toy-intro .kicker {
  grid-column: 1 / -1;
}

.case-intro > p:last-child {
  max-width: 34rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 4.5rem;
  perspective: 1200px;
}

.case-card {
  position: relative;
  min-height: 25rem;
  padding: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 229, 255, 0.12), transparent 16rem),
    #08283a;
  box-shadow: 0 1.4rem 3.5rem rgba(0, 10, 20, 0.14);
  transform-style: preserve-3d;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.case-card:nth-child(2),
.case-card:nth-child(5) {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 214, 90, 0.16), transparent 15rem),
    #092c40;
}

.case-card:hover {
  border-color: rgba(98, 229, 255, 0.48);
  box-shadow: 0 2rem 4.5rem rgba(0, 10, 20, 0.24);
}

.case-card-wide {
  grid-column: span 2;
}

.case-index {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.case-symbol {
  display: grid;
  width: 4.8rem;
  height: 4.8rem;
  margin: 2.2rem 0 2rem;
  place-items: center;
  border: 1px solid rgba(98, 229, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  font-family: Georgia, serif;
  font-size: 2rem;
  background: rgba(98, 229, 255, 0.05);
}

.case-card-wide .case-symbol {
  color: var(--coral);
  border-color: rgba(255, 118, 91, 0.32);
  background: rgba(255, 118, 91, 0.06);
}

.case-label {
  margin: 0 0 0.6rem;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-card h3 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.case-card > p:last-child {
  max-width: 650px;
  margin: 1rem 0 0;
  color: var(--muted);
}

.section-faq {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4rem;
  background: #06263a;
}

.faq-intro {
  position: sticky;
  top: 8rem;
  align-self: start;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  padding: 1.6rem 3.5rem 1.6rem 0;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 750;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
  content: "+";
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  transition: transform 180ms ease;
}

.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq-item p {
  max-width: 650px;
  margin: -0.4rem 0 1.8rem;
  color: var(--muted);
}

.final-cta {
  position: relative;
  display: grid;
  min-height: 46rem;
  padding: clamp(6rem, 10vw, 9rem) max(1.25rem, calc((100% - var(--max)) / 2));
  place-items: center start;
  isolation: isolate;
  overflow: hidden;
}

.cta-background {
  position: absolute;
  z-index: -4;
  inset: -8%;
  background: url("assets/shipwreck.webp") center / cover no-repeat;
  filter: saturate(0.74) brightness(0.5);
  will-change: transform;
}

.cta-overlay {
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 18, 29, 0.92), rgba(3, 18, 29, 0.1) 80%),
    linear-gradient(180deg, #06263a 0%, transparent 18%, transparent 80%, var(--deep) 100%);
}

.cta-content {
  max-width: 860px;
}

.cta-content > p:not(.kicker) {
  max-width: 620px;
  margin: 1.8rem 0 0;
  color: rgba(238, 251, 255, 0.78);
  font-size: 1.1rem;
}

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

.cta-fish {
  position: absolute;
  z-index: -1;
  right: -3%;
  bottom: 6%;
  width: min(40vw, 34rem);
  filter: drop-shadow(0 1.7rem 2rem rgba(0, 8, 18, 0.38));
  transform: scaleX(-1) rotate(-4deg);
  animation: float 7s ease-in-out infinite;
}

.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 2rem;
  align-items: center;
  padding: 2.2rem max(1.25rem, calc((100% - var(--max)) / 2));
  border-top: 1px solid var(--line);
  background: var(--deep);
}

.site-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  gap: 1.2rem;
}

.site-footer nav a {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--cyan);
}

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .hero-content {
    padding-top: 7rem;
  }

  .hero-vignette {
    background:
      linear-gradient(90deg, rgba(3, 20, 31, 0.72), rgba(3, 20, 31, 0.3)),
      linear-gradient(0deg, var(--deep) 0%, transparent 30%);
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .case-intro,
  .toy-intro,
  .section-faq,
  .section-face {
    grid-template-columns: 1fr;
  }

  .section-face {
    gap: 3rem;
  }

  .face-editor {
    left: 1rem;
  }

  .toy-intro p:last-child,
  .case-intro > p:last-child {
    margin: 0.5rem 0 0;
  }

  .case-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-card-wide {
    grid-column: span 2;
  }

  .faq-intro {
    position: static;
  }

  .cta-fish {
    right: -10%;
    width: 45vw;
    opacity: 0.7;
  }

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

@media (max-width: 560px) {
  .site-header {
    top: 0.55rem;
    width: calc(100% - 1rem);
  }

  .button-small {
    display: none;
  }

  .hero {
    min-height: 48rem;
    align-items: end;
  }

  .hero-content {
    padding-bottom: 6rem;
  }

  h1 {
    /* "Розфарбуйте" must fit the narrowest phones (340 px) without spilling past the gutter. */
    font-size: clamp(2.9rem, 14.5vw, 5rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-note {
    align-items: flex-start;
    width: 100%;
    border-radius: 1.1rem;
  }

  .scroll-cue {
    display: none;
  }

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

  .step {
    min-height: auto;
  }

  .step-visual {
    aspect-ratio: 4 / 3;
  }

  .step-copy {
    min-height: auto;
  }

  .story-panel,
  .final-cta {
    min-height: 42rem;
  }

  .platforms,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .case-card-wide {
    grid-column: auto;
  }

  .case-card {
    min-height: auto;
  }

  .face-visual {
    padding-bottom: 0;
  }

  .face-editor {
    position: relative;
    left: auto;
    width: 82%;
    margin: -2.5rem auto 0;
  }

  .cta-fish {
    right: -20%;
    bottom: 3%;
    width: 17rem;
    opacity: 0.5;
  }

  .cta-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .site-footer nav {
    flex-wrap: wrap;
  }
}

@supports (animation-timeline: view()) {
  .case-card {
    animation: card-enter both ease-out;
    animation-range: entry 12% cover 34%;
    animation-timeline: view();
  }

  @keyframes card-enter {
    from {
      opacity: 0;
      transform: translateY(2.5rem) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .parallax-layer {
    transform: none !important;
  }
}

/* ── Живі рибки й розмальовка (play.js) ───────────────────────────── */

.hero-tank {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

/* The fish swim behind the text: a soft shadow keeps the letters readable when a bright fish passes under them. */
.hero .eyebrow,
.hero h1,
.hero-copy {
  text-shadow: 0 2px 14px rgba(2, 20, 34, 0.55);
}

.tank-fish {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 1.2rem 1rem rgba(1, 13, 24, 0.35));
  will-change: transform;
}

.fish-orange {
  top: 16%;
  right: 1%;
  width: clamp(11rem, 20vw, 22rem);
}

.fish-cool {
  right: 20%;
  bottom: 9%;
  width: clamp(7rem, 12vw, 13rem);
}

.fish-tang {
  top: 50%;
  right: 31%;
  width: clamp(8rem, 13vw, 14rem);
}

/* The farthest fish: smaller, paler and a touch soft, so the tank has depth. */
.fish-gold {
  top: 11%;
  right: 35%;
  width: clamp(5rem, 8vw, 9rem);
  filter: drop-shadow(0 0.8rem 0.8rem rgba(1, 13, 24, 0.3)) saturate(0.8) brightness(0.8) blur(0.4px);
}

.hero-hint,
.toy-tank-hint {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(4, 30, 45, 0.5);
  color: rgba(238, 251, 255, 0.84);
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 600ms ease, translate 600ms ease;
}

.hero-hint {
  right: max(1.25rem, calc((100% - var(--max)) / 2));
  bottom: 2.1rem;
}

.toy-tank-hint {
  left: 1rem;
  bottom: 1rem;
}

.hero-hint.is-gone,
.toy-tank-hint.is-gone {
  opacity: 0;
  translate: 0 0.6rem;
}

.flake {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 5px;
  margin: -2px 0 0 -4px;
  border-radius: 2px;
  background: #f2b25c;
  box-shadow: 0 0 0 1px rgba(122, 64, 12, 0.3);
  pointer-events: none;
}

.pop-bubble {
  position: absolute;
  border: 1.5px solid rgba(215, 250, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.06) 45%, transparent 62%);
  pointer-events: none;
  animation: pop-rise 1.7s ease-out forwards;
}

@keyframes pop-rise {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 0.95; }
  to { transform: translate(calc(-50% + var(--drift, 0px)), calc(-50% - 7rem)) scale(1.1); opacity: 0; }
}

.toy-intro p:last-child {
  max-width: 34rem;
  margin: 0 0 0.45rem;
  color: rgba(238, 251, 255, 0.78);
  font-size: 1.15rem;
}

.toy {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.toy-paper {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: #fbfaf6;
  color: #1b1d22;
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.3);
}

.toy-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toy-tabs button {
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(16, 32, 43, 0.14);
  border-radius: 999px;
  background: transparent;
  color: #22303d;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.toy-tabs button[aria-selected="true"] {
  border-color: #10202b;
  background: #10202b;
  color: #fff;
}

.toy-canvas {
  margin: 0.9rem 0;
}

.toy-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: manipulation;
}

.toy-canvas .part {
  cursor: pointer;
  transition: fill 160ms ease;
}

.toy-canvas .part.is-filled {
  animation: fill-pop 280ms ease;
}

@keyframes fill-pop {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.toy-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.crayon {
  width: 2.35rem;
  height: 2.35rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(16, 32, 43, 0.18), 0 0.3rem 0.6rem rgba(16, 32, 43, 0.14);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.crayon[aria-checked="true"] {
  box-shadow: 0 0 0 2px #10202b, 0 0.4rem 0.8rem rgba(16, 32, 43, 0.22);
  transform: scale(1.18);
}

.toy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.button-compact {
  min-height: 2.8rem;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
}

.toy-paper .button-glass {
  border-color: rgba(16, 32, 43, 0.16);
  background: rgba(16, 32, 43, 0.05);
  color: #10202b;
}

.toy-tank {
  position: relative;
  min-height: 26rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: url("assets/tropical-lagoon.webp") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px var(--line), 0 2rem 4rem rgba(0, 0, 0, 0.35);
  cursor: crosshair;
  touch-action: manipulation;
  isolation: isolate;
}

.toy-tank::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, rgba(3, 20, 31, 0.5), transparent 45%);
  content: "";
  pointer-events: none;
}

.toy-tank .tank-fish {
  width: 30%;
}

.toy-tank .tank-fish:nth-of-type(1) {
  top: 22%;
  left: 10%;
}

.toy-tank .tank-fish:nth-of-type(2) {
  top: 56%;
  right: 10%;
  width: 24%;
}

.toy-more {
  margin: 1.5rem 0 0;
}

@media (max-width: 860px) {
  /* The text takes the middle of the screen: the fish keep to the top and the bottom edge. */
  .fish-orange {
    top: 9%;
    right: -6%;
    width: clamp(10rem, 26vw, 15rem);
  }

  .fish-tang {
    top: 18%;
    right: auto;
    left: 5%;
    width: clamp(6.5rem, 15vw, 9rem);
  }

  .fish-gold {
    top: 7%;
    right: 46%;
  }

  .fish-cool {
    right: 7%;
    bottom: 3%;
    width: clamp(6rem, 14vw, 9rem);
  }

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

  .toy-tank {
    min-height: 21rem;
  }
}

@media (max-width: 560px) {
  /* A phone: the text fills the screen; the fish keep to the free strips above and below it. */
  .fish-orange {
    top: 9%;
    right: -4%;
    width: 11rem;
  }

  .fish-cool {
    top: 8.5%;
    right: auto;
    bottom: auto;
    left: 3%;
    width: 5rem;
  }

  .fish-tang {
    top: auto;
    right: 6%;
    bottom: 2.5%;
    left: auto;
    width: 6.5rem;
  }

  .fish-gold {
    display: none;
  }

  .hero-hint {
    display: none;
  }

  .toy-paper {
    padding: 1rem;
  }

  .crayon {
    width: 2.1rem;
    height: 2.1rem;
  }
}
