/* Worlds — page styles. Loaded after the shared portal chrome.
   One reading surface: white, navy #174A7E, turquoise #D2F9F6, Fredoka. */

:root {
  --wm-navy: #174A7E;
  --wm-turquoise: #D2F9F6;
  --wm-soft: #EDFCFA;
  --wm-ink: #17324D;
  --wm-white: #fff;
  --wm-pad: clamp(16px, 4vw, 60px);
}

html { scroll-behavior: smooth; }

body.worlds-page {
  margin: 0;
  background: var(--wm-white);
  color: var(--wm-ink);
  font-family: Fredoka, system-ui, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* Page content is border-box: an element that is 100% wide and has padding must
   not add that padding to the viewport width (that was the mobile overflow).
   The shared chrome declares its own box-sizing, so this stops at <main>. */
.worlds-page main,
.worlds-page main *,
.worlds-page main *::before,
.worlds-page main *::after { box-sizing: border-box; }

.worlds-page img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--wm-navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; outline: 3px solid var(--wm-navy); outline-offset: 3px; }

.wm-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--wm-pad); }

/* Shared headings and actions ------------------------------------------- */

.wm-h1, .wm-h2, .wm-h3 {
  margin: 0;
  color: var(--wm-navy);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.08;
}
.wm-h1 { font-size: clamp(30px, 4.4vw, 56px); }
.wm-h2 { font-size: clamp(26px, 3.4vw, 46px); }
.wm-h3 { font-size: clamp(20px, 1.6vw, 26px); line-height: 1.2; }

.wm-head { max-width: 780px; margin: 0 auto; text-align: center; }
.wm-head .wm-h2 { margin-bottom: 10px; }
.wm-lead { margin: 0; color: var(--wm-ink); font-size: clamp(17px, 1.5vw, 22px); }

.wm-eyebrow {
  margin: 0 0 8px;
  color: var(--wm-navy);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wm-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 0; padding: 0; list-style: none; }

.wm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 48px;
  padding: 12px 26px;
  border: 2px solid var(--wm-navy);
  border-radius: 999px;
  background: var(--wm-navy);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease, color .16s ease;
}
.wm-btn:hover { background: #123c68; border-color: #123c68; transform: translateY(-1px); }
.wm-btn--ghost { background: #fff; color: var(--wm-navy); }
.wm-btn--ghost:hover { background: #EAF7FF; color: var(--wm-navy); border-color: var(--wm-navy); }
.wm-btn--sm { min-height: 44px; padding: 10px 22px; font-size: 17px; }
.wm-btn:focus-visible,
.wm-listen > summary:focus-visible,
.wm-friend a:focus-visible { outline: 3px solid var(--wm-navy); outline-offset: 3px; }

/* 1 — hero --------------------------------------------------------------- */

.wm-hero { position: relative; background: #EAF6FF; }
.wm-hero__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 50%;
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 85%, transparent 100%);
}
.wm-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(22px, 5vw, 48px) var(--wm-pad) clamp(28px, 6vw, 56px);
  background: linear-gradient(180deg, #FFFFFF 0%, #EAF6FF 100%);
}
.wm-hero__lead { margin: 0; max-width: 34ch; font-size: clamp(17px, 1.5vw, 22px); }

@media (min-width: 900px) {
  .wm-hero { height: min(86vh, 62vw); min-height: 440px; max-height: 700px; }
  .wm-hero__copy {
    position: absolute;
    inset: 0;
    max-width: 56%;
    padding: clamp(28px, 5vw, 72px);
    background:
      radial-gradient(125% 95% at 8% 46%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.62) 42%, rgba(255,255,255,0) 74%),
      linear-gradient(90deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 46%);
  }
  .wm-hero__lead { font-size: clamp(18px, 1.55vw, 23px); }
}

/* 2 — discover our world ------------------------------------------------- */

.wm-discover {
  position: relative;
  padding: clamp(46px, 7vw, 96px) 0 clamp(40px, 6vw, 84px);
  background: linear-gradient(180deg, #EAF6FF 0%, #FFFFFF 26%, #F4FEFD 58%, #FFFFFF 100%);
}
.wm-discover::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 45% at 50% 0%, rgba(210,249,246,.85) 0%, rgba(210,249,246,0) 70%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.wm-discover > * { position: relative; }

.wm-materials {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.6vw, 38px);
  margin: clamp(30px, 4vw, 54px) 0 0;
  padding: 0;
  list-style: none;
}
.wm-material { display: flex; flex-direction: column; align-items: center; text-align: center; }
.wm-material__frame {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: clamp(215px, 20vw, 300px);
  margin-bottom: 18px;
}
.wm-material__frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 20px 28px rgba(23,74,126,.20));
}
.wm-material--book img { transform: rotate(-1.8deg); }
.wm-material--paper img { transform: rotate(1.4deg); }
.wm-material--paper .wm-material__frame { align-items: center; }
.wm-material--audio .wm-material__frame img { transform: rotate(-.6deg); }

/* A preview is a real link to the same destination as its button. */
a.wm-material__frame { color: inherit; text-decoration: none; }
a.wm-material__frame:focus-visible { outline: 3px solid var(--wm-navy); outline-offset: 4px; border-radius: 14px; }

.wm-material__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 26px rgba(23,74,126,.30);
  pointer-events: none;
}
.wm-material__play svg { width: 22px; height: 22px; fill: var(--wm-navy); }

.wm-material__name { margin: 0 0 4px; color: var(--wm-navy); font-size: clamp(19px, 1.5vw, 24px); font-weight: 600; line-height: 1.2; }
.wm-material__note { margin: 0 0 14px; max-width: 30ch; font-size: 15.5px; line-height: 1.45; }
.wm-material .wm-btn { margin-top: auto; }

/* Audio card: the whole card is one native <summary>, so the picture, the label,
   the keyboard and the touch target open the same native controls. No autoplay. */
.wm-listen { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: auto; }
.wm-material--audio .wm-listen,
.wm-material--audio .wm-listen > summary { flex: 1 1 auto; }
.wm-listen > summary { display: flex; flex-direction: column; align-items: center; width: 100%; cursor: pointer; list-style: none; }
.wm-listen > summary::-webkit-details-marker { display: none; }
.wm-listen__cue::after { content: " ▾"; font-size: .85em; }
.wm-listen[open] .wm-listen__cue::after { content: " ▴"; }
.wm-listen__body { margin-top: 12px; }
.wm-listen__body audio { width: min(320px, 100%); }

.wm-all-materials { margin: clamp(30px, 4vw, 52px) 0 0; text-align: center; }

/* 3 — explore the worlds ------------------------------------------------- */

.wm-explore {
  position: relative;
  padding: clamp(44px, 6vw, 92px) 0 clamp(44px, 6vw, 92px);
  background: linear-gradient(180deg, #FFFFFF 0%, #EFFCFA 30%, #E4FBF7 62%, #FFFFFF 100%);
}

.wm-worlds {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(26px, 3.4vw, 52px) clamp(18px, 2.4vw, 34px);
  margin: clamp(32px, 4.4vw, 60px) 0 0;
  padding: 0;
  list-style: none;
}
.wm-world { grid-column: span 2; display: flex; flex-direction: column; }
.wm-world:nth-child(4) { grid-column: 2 / 4; }
.wm-world:nth-child(5) { grid-column: 4 / 6; }

.wm-world__art { display: block; width: 100%; height: auto; margin-bottom: 18px; mix-blend-mode: multiply; }
.wm-world__name { margin: 0 0 6px; color: var(--wm-navy); font-size: clamp(22px, 2vw, 30px); font-weight: 600; line-height: 1.1; }
.wm-world__copy { margin: 0 0 8px; font-size: 16.5px; line-height: 1.45; }
.wm-world__meta {
  margin: 0 0 16px;
  color: #2F6FA3;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .06em;
}
.wm-world .wm-btn { margin-top: auto; align-self: flex-start; }

/* 4 — one friend, more to explore --------------------------------------- */

.wm-tilo {
  position: relative;
  padding: clamp(44px, 6vw, 92px) 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6FEFD 40%, #EAFBF6 100%);
}
.wm-tilo__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 3vw, 46px);
  margin: clamp(32px, 4.4vw, 58px) 0 0;
  padding: 0;
  list-style: none;
  align-items: start;
}
.wm-tilo__item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.wm-tilo__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(228px, 24vw, 330px);
  margin-bottom: 18px;
}
.wm-tilo__media img { max-height: clamp(228px, 24vw, 330px); width: auto; max-width: 100%; height: auto; }

/* A preview is a real link to the same destination as its button. */
.wm-tilo__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: inherit;
  text-decoration: none;
}
.wm-tilo__link:focus-visible { outline: 3px solid var(--wm-navy); outline-offset: 6px; border-radius: 16px; }

.wm-tablet {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 14px 14px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #FBFDFF 0%, #E7EEF5 100%);
  box-shadow: 0 22px 40px rgba(23,74,126,.20), inset 0 0 0 1px rgba(23,74,126,.10);
}
.wm-tablet img { display: block; width: 100%; height: auto; border-radius: 10px; }
.wm-tablet::before {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(23,74,126,.18);
  transform: translateX(-50%);
}
.wm-tilo--book img { transform: rotate(-1.5deg); filter: drop-shadow(0 20px 30px rgba(23,74,126,.22)); }
.wm-tilo--page img { filter: drop-shadow(0 20px 30px rgba(23,74,126,.20)); }

.wm-tilo__name { margin: 0 0 4px; color: var(--wm-navy); font-size: clamp(20px, 1.7vw, 26px); font-weight: 600; line-height: 1.15; }
.wm-tilo__copy { margin: 0 0 6px; max-width: 32ch; font-size: 16.5px; line-height: 1.45; }
.wm-tilo__age { margin: 0 0 14px; color: #2F6FA3; font-size: 13.5px; font-weight: 600; letter-spacing: .06em; }
.wm-tilo__item .wm-btn { margin-top: auto; }

/* 5 — find your favorite friend ----------------------------------------- */

.wm-friends-section {
  position: relative;
  padding: clamp(44px, 6vw, 92px) 0;
  background: linear-gradient(180deg, #EAFBF6 0%, #FFFFFF 34%, #FFFFFF 66%, #EFFAF9 100%);
}
.wm-friends {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 26px);
  margin: clamp(30px, 4vw, 54px) 0 0;
  padding: 0;
  list-style: none;
}
.wm-friend { display: flex; flex-direction: column; align-items: center; }
.wm-friend a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--wm-navy);
  text-decoration: none;
  border-radius: 18px;
  transition: transform .16s ease;
}
.wm-friend a:hover { transform: translateY(-3px); }
.wm-friend img {
  display: block;
  height: clamp(118px, 13vw, 186px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 10px;
}
.wm-friend__name { font-size: clamp(18px, 1.5vw, 24px); font-weight: 600; line-height: 1.1; }
.wm-friend__name::after { content: " →"; }
.wm-friend__place { margin-top: 2px; color: var(--wm-ink); font-size: 14.5px; }

/* 6 — not sure where to start ------------------------------------------- */

.wm-start {
  position: relative;
  padding: clamp(48px, 6vw, 96px) 0 clamp(90px, 11vw, 160px);
  background: linear-gradient(180deg, #FFFFFF 0%, #EFF9FD 32%, #CFE4F2 68%, #174A7E 100%);
}
.wm-start__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 3.4vw, 56px); align-items: center; }
.wm-start__copy { position: relative; }
.wm-start__sub { margin: 6px 0 0; color: var(--wm-navy); font-size: clamp(20px, 1.8vw, 27px); font-weight: 600; line-height: 1.2; }
.wm-start__text { margin: 14px 0 0; max-width: 42ch; font-size: clamp(16.5px, 1.4vw, 20px); }
.wm-start__meta { margin: 10px 0 0; color: #2F6FA3; font-size: 14.5px; font-weight: 600; }
.wm-start .wm-actions { margin-top: 22px; }

.wm-start__cover {
  display: block;
  width: clamp(120px, 14vw, 190px);
  margin: 0 0 18px;
  transform: rotate(-2.4deg);
  filter: drop-shadow(0 18px 28px rgba(23,74,126,.26));
}
.wm-start__art { display: flex; justify-content: center; }
.wm-start__art img {
  display: block;
  width: min(100%, 620px);
  height: auto;
  -webkit-mask-image: radial-gradient(125% 120% at 58% 46%, #000 58%, rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(125% 120% at 58% 46%, #000 58%, rgba(0,0,0,0) 100%);
  mix-blend-mode: multiply;
}

/* Tablet and phone ------------------------------------------------------ */

@media (max-width: 1000px) {
  .wm-materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-world, .wm-world:nth-child(4), .wm-world:nth-child(5) { grid-column: auto; }
  .wm-tilo__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-tilo__item:last-child { grid-column: 1 / -1; max-width: 460px; margin: 0 auto; }
  .wm-friends { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; }
  .wm-start__grid { grid-template-columns: 1fr; }
  .wm-start__art { order: -1; }
  .wm-start__copy { text-align: center; }
  .wm-start__cover { margin: 0 auto 18px; }
  .wm-start__text, .wm-start__sub { margin-left: auto; margin-right: auto; }
  .wm-start .wm-actions { justify-content: center; }
}

@media (max-width: 719px) {
  .wm-materials { grid-template-columns: 1fr; gap: 34px; }
  .wm-material__frame { height: auto; min-height: 0; }
  .wm-material__frame img { max-height: 320px; }
  .wm-worlds { grid-template-columns: 1fr; gap: 34px; }
  .wm-tilo__grid { grid-template-columns: 1fr; gap: 38px; }
  .wm-tilo__item:last-child { max-width: none; }
  .wm-friends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-actions { flex-direction: column; align-items: stretch; }
  .wm-actions .wm-btn { width: 100%; }
  .wm-world .wm-btn { align-self: stretch; }
  .wm-start { padding-bottom: clamp(70px, 16vw, 130px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wm-friend a:hover, .wm-btn:hover { transform: none; }
}
