:root {
  /* Brand palette (designer's token sheet). --color-primary #5C7A66 is
     intentionally absent: it only appears inside footer/logo artwork. */
  --color-text: #565e4c;
  --color-accent: #b96956;
  --color-action: #a85b4a;
  --color-action-hover: #9e5241;
  --color-surface: #faf7f1;
  --color-border: #eeeae4;
  --color-muted: #8f9385;
  --white: #ffffff;

  /* Type scale: fluid between the design sheet's mobile and desktop sizes. */
  --fs-display: clamp(36px, 33px + 1vw, 48px);
  --fs-h1: clamp(32px, 30px + 0.7vw, 40px);
  --fs-h2: clamp(26px, 24px + 0.55vw, 32px);
  --fs-h3: clamp(22px, 21.5px + 0.2vw, 24px);
  --fs-h4: clamp(19px, 18.7px + 0.1vw, 20px);
  --fs-lead: clamp(18px, 17.4px + 0.18vw, 20px);
  --fs-body: clamp(16px, 15.4px + 0.18vw, 18px);
  --fs-small: 14px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 80px;
  --space-11: 96px;
  --space-12: 128px;

  /* Outer margin 20px (mobile) → 150px (desktop), then grows to center
     content at an 1140px max width. */
  --page-padding: max(clamp(20px, 10vw, 150px), calc((100vw - 1140px) / 2));
  --section-space: clamp(var(--space-9), 8vw, var(--space-11));
  --footer-overlap: 220px;
}

.section {
  padding-block: var(--section-space);
  padding-inline: var(--page-padding);
}

/* Decorative images (birds, edge blobs). The parent must be a positioning
   context; add .deco-anchor to it. Each image sets only the offsets it needs
   via custom properties, e.g. style="--top: 10%; --right: 5%; --w: 90px". */
.deco-anchor {
  position: relative;
}

/* Compound selector so its width wins over container rules like
   `.contact-container img { width: 200px }` that target content images. */
.deco-anchor > .deco {
  position: absolute;
  top: var(--top, auto);
  right: var(--right, auto);
  bottom: var(--bottom, auto);
  left: var(--left, auto);
  width: var(--w, 100px);
  /* Reset styling that container img rules would otherwise leak onto the
     decoration (forced height, circular borders, etc.). */
  height: auto;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  z-index: var(--z, 0);
  pointer-events: none;
}

/* Decorations intentionally bleed past the right edge; clip instead of
   letting them create a horizontal scrollbar. */
html,
body {
  overflow-x: clip;
}

body {
  background-color: var(--white);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-family: "Nunito Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.25;
  font-weight: 600;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 600;
  text-align: center;
  padding: 20px;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.33;
  font-weight: 600;
}

h4 {
  font-size: var(--fs-h4);
  line-height: 1.4;
  font-weight: 600;
}

small {
  font-size: var(--fs-small);
  line-height: 1.5;
  font-weight: 400;
}

/* header */
header {
  position: relative;
  z-index: 10;
}

.logo {
  max-height: 60px;
  width: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 50px;
}

.header-nav {
  display: flex;
  gap: 40px;
}

/* Hamburger button and drawer ornament exist for the mobile drawer only. */
.menu-toggle,
.menu-bird {
  display: none;
}

.header-nav a {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.nav-link.active {
  border-bottom: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
}

/* footer */
footer {
  height: 630px;
  /* Transparent above the wave by default, so the section behind shows through.
     Pages whose last section is not white opt into a matching backdrop instead. */
  background:
    var(--footer-image, url(../images/common/footer.png)) center / cover
      no-repeat,
    var(--footer-backdrop, transparent);
  position: relative;
  margin-top: calc(var(--footer-overlap) * -1);
  pointer-events: none;
}

.footer-on-beige {
  --footer-backdrop: var(--color-surface);
}

.footer-with-dani {
  --footer-image: url(../images/common/footer-with-dani.png);
}

/* An opaque backdrop paints over the section behind it, so the last section
   has to clear the overlap. Only needed where a backdrop is set. */
.footer-on-beige main > :last-child {
  padding-bottom: calc(var(--section-space) + var(--footer-overlap));
}

/* Left column stacks logo over copyright; the nav occupies the right column
   and is pulled down to the bottom edge of that stack. */
.footer-container {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
  padding: 0px 50px;
  position: absolute;
  bottom: 20px;
  pointer-events: auto;
}

.footer-logo {
  grid-column: 1;
  grid-row: 1;
}

.copyright {
  grid-column: 1;
  grid-row: 2;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--white);
  margin-bottom: 30px;
  text-align: center;
}

.footer-nav {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, auto));
  gap: 12px 40px;
  /* Bottom-aligned with the copyright line, matching its 30px offset. */
  margin-bottom: 30px;
}

/* Desktop split: Home / Game — Research / Team / Updates. */
.footer-nav a:nth-child(1) {
  grid-area: 1 / 1;
}
.footer-nav a:nth-child(2) {
  grid-area: 2 / 1;
}
.footer-nav a:nth-child(3) {
  grid-area: 1 / 2;
}
.footer-nav a:nth-child(4) {
  grid-area: 2 / 2;
}
.footer-nav a:nth-child(5) {
  grid-area: 3 / 2;
}

.footer-nav a {
  color: var(--white);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.color-font {
  color: var(--color-accent);
  font-weight: 700;
}

.bold-font {
  font-weight: 600;
}

/* button */
.button {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  max-width: 240px;
  min-width: 200px;
  height: 50px;
  padding: 8px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  text-align: center;
  text-decoration: none;
  background-color: var(--color-action);
  border-radius: 32px;
  transition: background-color 0.5s ease;
}

.button:hover {
  background-color: var(--color-action-hover);
}

/* Secondary call to action: same shape, no fill, so it never competes with
   the primary button sitting above it. */
.button-outline {
  color: var(--color-action);
  background-color: transparent;
  border: 2px solid var(--color-action);
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

.button-outline:hover {
  color: var(--white);
  background-color: var(--color-action);
}

.button.is-disabled {
  background-color: var(--color-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* home */
.top-container {
  display: flex;
  justify-content: center;
  position: relative;
  margin-top: -130px;
  /* Special adjustment: Top offsets the header overlay / Bottom adds spacing for the overlapping clouds.
   Overriding default vertical padding from .section */
  padding-block: 120px 100px;
  background: url(../images/home/bg-top.png) center / cover;
  align-items: center;
}

.top-container::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 2560 / 580;
  background: url(../images/home/cloud.png) bottom / 100% auto no-repeat;
  transform: translateY(35%);
  pointer-events: none;
}

.top-column-flex {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 50%;
}

.top-column-flex p {
  font-size: var(--fs-h2);
  line-height: 1.35;
  font-weight: 400;
}

.top-container img {
  width: 400px;
}

.video-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
}

.video-container p {
  max-width: 840px;
  margin-block: var(--space-6);
  text-align: center;
  font-size: var(--fs-h2);
  line-height: 1.35;
  font-weight: 400;
  z-index: 2; /* to prevent clouds from blocking p tag */
}

.video-container iframe,
.video-container video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 24px;
  margin-top: var(--space-7);
}

.pillars {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28%;
  max-width: 270px;
  padding: 50px 30px;
  text-align: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 30px;
}

.pillar img {
  width: 120px;
  margin-bottom: var(--space-4);
}

.pillar h3 {
  margin-bottom: var(--space-3);
}

#pillar h2 {
  margin-bottom: var(--space-6);
}

.how-container {
  height: 800px;
  /* Stretched, not "cover": cover crops to the box ratio and eats the waves. */
  background: url(../images/home/bg-how.png) center / 100% 100% no-repeat;
}

.how-content {
  margin-top: 100px;
}

.hows {
  display: flex;
  justify-content: space-between;
}

.how {
  display: flex;
  flex-direction: column;
}

.how img {
  width: 150px;
}

/* Full-bleed: cancels the section's inline padding to span the viewport
   (padding-based instead of 100vw, which overflows by the scrollbar width). */
.path-img {
  display: block;
  width: calc(100% + 2 * var(--page-padding));
  max-width: none;
  margin-inline: calc(-1 * var(--page-padding));
}

/* Mobile-only vertical timeline: hidden on desktop. */
.hows-mobile {
  display: none;
}

/* Research: picture element inherits the container img width rule. */
.design-process-container picture img {
  width: 100%;
}

.contact-container {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.contact-flex {
  display: flex;
  align-items: center;
  gap: 40px;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.contact-flex p {
  max-width: 360px;
  font-size: var(--fs-h2);
  line-height: 1.3;
}

/* The newsletter invite is the lower-commitment option, so it reads one step
   down from the contact line above it. */
.contact-action--secondary p {
  font-size: var(--fs-lead);
}

.contact-flex .button {
  margin-top: var(--space-5);
}

.contact-action--secondary .button {
  margin-top: var(--space-4);
}

.contact-container img {
  width: 350px;
}

/* Game */
.games-top-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

.games-top-container::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 2560 / 565;
  background: url(../images/game/cloud-b.png) bottom / 100% auto no-repeat;
  transform: translateY(35%);
  pointer-events: none;
}

.media-row {
  display: flex;
  padding: 40px 0;
  align-items: center;
  gap: 40px;
}

.media-row:nth-child(even) {
  flex-direction: row-reverse;
}

.mirror > img {
  width: 50%;
}

.garden-container img {
  width: 40%;
}

/* Image left / text right (overrides the even-row reverse), with extra
   bottom room so the birds clear the content. */
.garden-container {
  padding-bottom: calc(var(--section-space) + var(--space-7));
}

.garden-container .media-row {
  flex-direction: row;
}

.garden-container .game-content {
  max-width: 440px;
}

.mirror {
  display: flex;
}

.mirror-speechs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mirror-speech {
  position: relative;
}

.mirror-speech p {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Keep the text inside the bubble artwork (max ~3 lines). */
  width: 72%;
  font-size: 15px;
  line-height: 1.4;
}

.mission-container {
  background-color: var(--color-surface);
}

.mission-container .subtitle,
.mission-container > p {
  text-align: center;
}

.mission-container .subtitle {
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.mission-container > p:last-of-type {
  margin-top: var(--space-8);
}

.game-content {
  display: flex;
  flex-direction: column;
}

/* Wraps the hero sentence to 3-4 lines next to the drawing gif. */
.game-content h1 {
  max-width: 460px;
  font-weight: 400;
}

.drawing-gif {
  width: 520px;
  max-width: 46%;
  border-radius: 24px;
}

.emotions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
}

.emotions .emotion {
  flex: 0 0 calc((100% - 120px) / 4);
}

.emotion img,
.reflection-gif {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 40px;
}

.reflections {
  display: flex;
  justify-content: space-evenly;
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

/* Section lead: h2-sized but not bold, wrapped to two centered lines. */
.reflection-container h2 {
  font-weight: 400;
  max-width: 660px;
  margin-inline: auto;
  margin-top: var(--space-8);
}

.emotion,
.reflection,
.member {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reflection {
  position: relative;
}

/* Captions under the reflection gifs: h2-sized, wrapped to two lines. */
.reflection p {
  margin-top: 20px;
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 400;
  text-align: center;
  max-width: 260px;
}

.frame {
  position: absolute;
  width: 150px;
  z-index: 1;
}

.reflection-gif {
  z-index: 2;
}

.reflection-container {
  background: url(../images/game/bg-y.png) center / 100% 100% no-repeat;
}

.frame-dot {
  position: absolute;
  width: 200px;
  z-index: 3;
}

.green-dot {
  top: -10px;
  left: 25px;
}

.green-frame {
  top: 5px;
  left: -25px;
}

.red-dot {
  top: 10px;
  left: 20px;
}

.red-frame {
  top: -15px;
  left: -20px;
}

.blue-dot {
  top: -5px;
  left: 25px;
}

.blue-frame {
  top: 15px;
  left: -20px;
}

.member img {
  width: 200px;
}

.feedback-container {
  display: flex;
  align-items: center;
  gap: 40px;
}

.feedback {
  position: relative;
  display: inline-block;
  /* One step down from the artwork's natural ~750px render. */
  width: 620px;
  max-width: 100%;
}

.feedback > img {
  width: 100%;
}

.overlay-text {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.app-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

.app-image small {
  display: block;
  margin-left: 100px;
}

.coming-soon {
  display: flex;
  flex-direction: column;
}

.coming-soon-font {
  font-size: var(--fs-display);
  font-weight: 600;
}

.app-image {
  width: 40%;
}

.distribute {
  display: flex;
  gap: 20px;
}

.distribute img {
  width: 150px;
}

/* Research */
.research-top-container {
  display: flex;
  justify-content: center;
  position: relative;
  margin-top: -130px;
  /* Special adjustment: Top offsets the header overlay / Bottom adds spacing for the overlapping clouds.
   Overriding default vertical padding from .section */
  background: url(../images/research/bg-g.png) center / cover;
  align-items: center;
  padding: 300px 100px;
}

.research-question-container {
  /* Stretched, not "cover": cover crops to the box ratio and eats the waves. */
  background: url(../images/research/bg-y.png) center / 100% 100% no-repeat;
  padding: 300px 100px 220px;
  margin-top: -130px;
  /* Overlaps the section above, so it must be positioned for z-index to apply. */
  position: relative;
  z-index: 3;
}

.research-question-container p {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
  font-size: var(--fs-h2);
  line-height: 1.35;
  font-weight: 400;
}

.design-process-container {
  position: relative;
}

.design-process-container img {
  width: 100%;
}

.design-process-container::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 2560 / 565;
  background: url(../images/game/cloud-b.png) bottom / 100% auto no-repeat;
  transform: translateY(35%);
  pointer-events: none;
}

.research-themes-container {
  background-color: var(--color-surface);
}

.theme-container {
  display: flex;
  gap: var(--space-9);
  padding: 3rem 0;
  align-items: center;
}

.research-content {
  max-width: 460px;
}

.research-content .subtitle {
  margin-block: var(--space-3);
}

.research-content small {
  display: block;
  margin-top: var(--space-4);
}

.theme-container:nth-child(odd) {
  flex-direction: row-reverse;
}

.theme-container img {
  width: 400px;
  height: 450px;
  border-radius: 30px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Team */
.quote-container {
  display: flex;
  position: relative;
}

/* The quote mark sits behind the text; the quote's opening overlaps it. */
.quote-mark {
  position: absolute;
  width: 20%;
  top: var(--section-space);
  left: var(--page-padding);
}

.team-container {
  display: flex;
  gap: 120px;
}

.quote {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  margin-top: 80px;
  margin-left: 12%;
  margin-bottom: var(--space-7);
}

.quote p {
  font-size: var(--fs-h2);
  line-height: 1.4;
}

.quote p:last-child {
  font-weight: 400;
  text-align: right;
  margin-top: var(--space-3);
}

.social {
  display: flex;
  gap: 20px;
}

.member > p {
  text-align: center;
  margin-block: var(--space-4);
}

.member > img {
  border-radius: 50%;
  height: 250px;
  width: 250px;
  border: 10px solid var(--color-accent);
  margin-bottom: var(--space-4);
}

.social img {
  width: 40px;
}

.collaborators-container {
  display: flex;
  flex-direction: column;
}

.collaborator-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: var(--space-8);
  column-gap: var(--space-5);
}

.collaborator {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* 3列。端数の最終行は justify-content:center で中央寄せ */
  width: calc((100% - 2 * var(--space-5)) / 3);
}

.collaborator img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 5px solid var(--color-accent);
}

/* Collaborator names: h3 in the outline (peer of member names), h4-sized. */
.collaborator h3 {
  font-size: var(--fs-h4);
  line-height: 1.4;
}

/* Updates */
.updates-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 80px;
  row-gap: var(--space-8);
}

.updates-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px;
  background-color: var(--color-surface);
  border-radius: 20px;
}

.updates-card img {
  width: 100%;
  border-radius: 16px;
  height: 300px;
  object-fit: cover;
}

/* Updates - article (single) */
.article-container {
  /* Article column caps at 800px for readable line length; the outer
     page padding stays outside the cap. */
  max-width: calc(800px + 2 * var(--page-padding));
  margin-inline: auto;
}

.breadcrumb {
  margin-bottom: 24px;
  color: var(--color-text);
}

.breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px;
  background-color: var(--color-surface);
  border-radius: 20px;
}

.article-thumb {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 16px;
}

.article-title {
  margin-top: 8px;
}

.article-date {
  font-size: var(--fs-small);
  color: var(--color-muted);
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

/* Body images: centered and rounded like the thumbnail; tall portrait
   shots are capped instead of dominating the scroll. */
.article-body img {
  margin-inline: auto;
  border-radius: 16px;
  max-height: 560px;
  width: auto;
}

.article-back {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Hidden from view but announced by screen readers (do not use display:none). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Type-scale exceptions: elements whose outline level is heavier than their
   visual role. Hero sentences (h1) and catch-copy (.subtitle) render as the
   design sheet's "Lead" style, not as display headings. */
.subtitle,
.top-column-flex h1,
.game-content h1 {
  font-size: var(--fs-lead);
  line-height: 1.55;
  font-weight: 500;
}

/* Hero statement matches the section headings (h2 size), centered. */
.research-top-container h1 {
  font-size: var(--fs-h2);
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
}

.game-content h2 {
  text-align: left;
  padding: 0;
  margin-bottom: var(--space-5);
}

/* Page title keeps the centered section-heading layout it had as an h2. */
.updates-top-container > h1 {
  text-align: center;
  padding: 20px;
  margin-bottom: var(--space-6);
}

/* Flex-item z-index keeps the heading above the overlapping cloud art. */
.video-container h2 {
  z-index: 2;
  font-weight: 400;
}

/* Card titles use the H3 size regardless of outline level. */
.updates-card h2 {
  font-size: var(--fs-h3);
  line-height: 1.33;
  text-align: left;
  padding: 0;
}

/* Step captions under "How it works". */
.hows h3 {
  font-size: var(--fs-h4);
  line-height: 1.4;
}

/* ---------- Responsive (design grid: tablet 768-1199, mobile <768) ---------- */

@media (max-width: 1199px) {
  /* Fixed 400px images no longer fit beside a text column. */
  .theme-container img {
    width: 40%;
    height: auto;
    aspect-ratio: 8 / 9;
  }

  .emotions .emotion {
    flex: 0 0 calc((100% - 80px) / 3);
  }

  .emotion img {
    width: min(100%, 200px);
    height: auto;
    aspect-ratio: 1;
  }

  .team-container {
    gap: 60px;
  }
}

/* Header switches to the burger + drawer below 820px (tablet 768 included,
   820+ keeps the inline nav). */
@media (max-width: 819px) {
  /* Logo (second in DOM) on the left via row-reverse, burger on the right. */
  .header-container {
    margin: 16px 20px;
    gap: 16px;
    flex-direction: row-reverse;
  }

  /* width:100% on .logo would stretch it across the container. */
  .header-logo .logo {
    width: auto;
    max-height: 44px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
    z-index: 30;
  }

  .menu-toggle span {
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--color-text);
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  .home .menu-toggle span {
    background: var(--white);
  }

  /* Open state: olive X on every page (white would vanish on the cream
     drawer), closable via the same button. */
  body.menu-open .menu-toggle span {
    background: var(--color-text);
  }

  body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  body.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Drawer: slides in from the right over ~80% of the screen. */
  .header-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: 80vw;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
    padding: 96px 32px 40px;
    background: var(--color-surface);
    box-shadow: -8px 0 30px rgb(0 0 0 / 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 20;
  }

  body.menu-open .header-nav {
    transform: translateX(0);
  }

  body.menu-open {
    overflow: hidden;
  }

  .header-nav .menu-bird {
    display: block;
    position: absolute;
    right: 24px;
    bottom: 32px;
    width: 120px;
  }
}

@media (max-width: 767px) {
  /* Ornaments stay on mobile but shrink; the offsets are still the desktop
     ones (scale is visual only, absolute position is unchanged). Add
     .deco-pc-only to any ornament that clutters small screens. */
  .deco {
    transform: scale(0.55);
  }

  /* Per-image mobile offset overrides. An ornament can set --m-top / --m-right
     / --m-bottom / --m-left / --m-w / --m-z inline to move only on mobile; any
     axis left unset falls back to its desktop value. scale(0.55) still applies. */
  .deco-anchor > .deco {
    top: var(--m-top, var(--top, auto));
    right: var(--m-right, var(--right, auto));
    bottom: var(--m-bottom, var(--bottom, auto));
    left: var(--m-left, var(--left, auto));
    width: var(--m-w, var(--w, 100px));
    z-index: var(--m-z, var(--z, 0));
  }

  .deco-pc-only {
    display: none;
  }

  /* home */
  .top-container {
    flex-direction: column;
    gap: 24px;
    text-align: center;
    padding-block: 140px 120px;
  }

  .top-column-flex {
    width: 100%;
    align-items: center;
  }

  .top-container img {
    width: min(320px, 80%);
  }

  .pillars {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .pillar {
    width: 100%;
    max-width: 320px;
  }

  .how-container {
    height: auto;
  }

  /* Desktop How It Works layout hidden on mobile */
  .hows-images,
  .hows-text,
  .path-img {
    display: none;
  }

  /* Mobile vertical timeline */
  .hows-mobile {
    display: block;
    position: relative;
    padding-left: 60px; /* Space for the path-v vertical line */
  }

  .path-v-img {
    position: absolute;
    left: 0px;
    top: 50px; /* Center of first icon (100px icon / 2 = 50px) */
    bottom: 140px; /* Center of last icon (leaving space for h3, p, etc.) */
    width: 60px;
    object-fit: fill; /* Stretch the wavy line to align circles perfectly */
  }

  .hows-mobile-steps {
    display: flex;
    flex-direction: column;
    gap: 48px;
    flex-grow: 1;
  }

  .hows-mobile-steps .how {
    display: flex;
    flex-direction: column;
    width: 75%;
    gap: 8px;
    margin-left: 20px;
  }

  .hows-mobile-steps .how img {
    width: 100px;
    height: 100px;
    object-fit: contain;
  }

  .contact-flex {
    flex-direction: column;
    text-align: center;
  }

  .contact-container img {
    width: 260px;
  }

  .contact-flex .button {
    margin-inline: auto;
  }

  /* game */
  .media-row,
  .media-row:nth-child(even),
  .garden-container .media-row {
    flex-direction: column;
  }

  .garden-container img {
    width: 100%;
  }

  .drawing-gif {
    width: 100%;
    max-width: 100%;
  }

  .mirror {
    flex-direction: column;
    align-items: center;
  }

  .mirror > img {
    width: 80%;
  }

  .emotions {
    gap: 20px;
  }

  .emotions .emotion {
    flex: 0 0 calc((100% - 20px) / 2);
  }

  .reflections {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  .feedback-container {
    position: relative;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
  }

  .feedback-container > div:first-of-type {
    position: absolute;
    top: 40px;
    left: 24px;
    z-index: 1;
  }

  .feedback-container > div:first-of-type img {
    width: 140px;
    height: auto;
  }

  .feedback {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 320px;
  }

  .feedback picture img {
    width: 100%;
    display: block;
  }

  .feedback .overlay-text {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    text-align: left;
  }

  .app-container {
    flex-direction: column;
    align-items: center;
  }

  .app-image {
    width: 100%;
    max-width: 360px;
  }

  .app-image small {
    margin-left: 0;
  }

  /* research: the oversized cloud paddings shrink with the viewport */
  .research-top-container {
    padding: 160px 24px 140px;
  }

  .research-question-container {
    padding: 160px 24px 120px;
  }

  .theme-container,
  .theme-container:nth-child(odd) {
    flex-direction: column;
  }

  .theme-container img {
    width: 100%;
    max-width: 400px;
    aspect-ratio: auto;
  }

  .research-content {
    max-width: 100%;
  }

  /* team */
  .team-container {
    flex-direction: column;
    align-items: center;
    gap: 48px;
  }

  .quote {
    margin-top: 40px;
    margin-left: 6%;
  }

  .collaborator {
    width: calc((100% - var(--space-5)) / 2);
  }

  /* updates */
  .updates-list {
    grid-template-columns: 1fr;
  }

  .updates-card img,
  .article-thumb {
    height: 220px;
  }

  /* footer — mobile: swap to mobile background, stack vertically
     (logo → 2-column menu → copyright), all centered. */
  footer {
    height: 620px;
    margin-top: 0;
    background-position: center top 90px;
    --footer-image: url(../images/common/footer-m.png);
  }

  .footer-with-dani footer {
    --footer-image: url(../images/common/footer-with-dani-m.png);
  }

  /* Back to a single centered stack: the desktop grid columns do not apply. */
  .footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
  }

  /* Logo first, centered */
  .footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-nav {
    margin-bottom: 0;
    gap: 12px 32px;
  }

  /* Mobile split: Home / Game / Research — Team / Updates. */
  .footer-nav a:nth-child(3) {
    grid-area: 3 / 1;
  }
  .footer-nav a:nth-child(4) {
    grid-area: 1 / 2;
  }
  .footer-nav a:nth-child(5) {
    grid-area: 2 / 2;
  }

  .copyright {
    text-align: center;
    margin-bottom: 0;
  }
}
