/* So You Need To… — colours and type from BRAND.md */
:root {
  --navy: #173961;
  --blue: #004e98;
  --yellow: #ffd84d;
  --white: #ffffff;
  --sky: #eaf3ff;
  --sky-top: #bfe3ff;

  --l-sky: #d6ecfd;
  --l-high: #b4d9f3;
  --l-ground: #a9d48c;
  --l-under: #8a5a36;
  --l-sea: #0d5a8a;
  --deep: #062d48;

  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sky);
  color: var(--navy);
  font: 18px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* the video captions' look: white or yellow fill, navy outline drawn behind it */
.outlined {
  -webkit-text-stroke: 0.15em var(--navy);
  paint-order: stroke fill;
}

/* ---- top bar ------------------------------------------------------------------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--sky-top);
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark img { border-radius: 9px; }
.mark span { font: 700 21px/1 var(--display); }
.yt {
  font: 600 16px/1 var(--display);
  text-decoration: none;
  background: var(--navy); color: var(--white);
  padding: 10px 16px; border-radius: 999px;
}
.yt:hover { background: var(--blue); }
@media (max-width: 480px) { .yt-long { display: none; } .mark span { font-size: 18px; } }

/* ---- the question ------------------------------------------------------------------ */

.hero {
  background: linear-gradient(var(--sky-top), var(--sky) 70%);
  padding: clamp(24px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(48px, 7vw, 96px);
}
.ask {
  margin: 0 auto;
  max-width: 1100px;
  text-align: center;
  font: 700 clamp(40px, 7.4vw, 96px)/1.04 var(--display);
  color: var(--white);
  -webkit-text-stroke: 0.15em var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0.12em rgba(10, 30, 60, 0.25);
}
.lead { display: block; }
.pick-wrap { position: relative; display: inline-block; }
.pick {
  padding: 0; margin: 0;
  background: none; border: 0;
  font: inherit; line-height: inherit; text-align: inherit;
  color: var(--yellow);
  cursor: pointer;
  border-radius: 0.2em;
}
.pick:focus-visible { outline: 4px solid var(--blue); outline-offset: 6px; }
.nowrap { white-space: nowrap; }
.caret {
  display: inline-block;
  width: 0.42em; height: 0.42em;
  margin-left: 0.18em;
  vertical-align: 0.12em;
  background: var(--navy);
  clip-path: polygon(0 20%, 100% 20%, 50% 85%);
  transition: rotate 0.15s;
}
.pick[aria-expanded="true"] .caret { rotate: 180deg; }

/* the open list: plain text, none of the headline's outline */
.pick-list {
  position: absolute; z-index: 20;
  top: calc(100% + 14px); left: 50%; translate: -50% 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(62vh, 560px); overflow-y: auto;
  margin: 0; padding: 8px; list-style: none;
  background: var(--white);
  border: 3px solid var(--navy); border-radius: 18px;
  box-shadow: 0 18px 40px rgba(10, 30, 60, 0.25);
  text-align: left;
  font: 400 17px/1.3 var(--body);
  color: var(--navy);
  -webkit-text-stroke: 0; text-shadow: none;
}
.pick-list:focus { outline: none; }
.pick-group {
  padding: 12px 12px 4px;
  font: 600 13px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.6;
}
.pick-option {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  font: 600 19px/1.25 var(--display);
  cursor: pointer;
}
.pick-option::before { content: "…"; margin-right: -8px; }
.pick-option span { flex: 1; }
.pick-option small { font: 400 14px/1 var(--body); opacity: 0.65; white-space: nowrap; }
.pick-option.active { background: var(--sky); }
.pick-option[aria-selected="true"] { background: var(--yellow); }
.tag {
  margin: 20px auto 0;
  text-align: center;
  font-size: clamp(18px, 2.2vw, 22px);
}
.another {
  margin-left: 6px;
  padding: 0;
  font: inherit; font-weight: 700;
  color: var(--blue);
  background: none; border: 0;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px;
  cursor: pointer;
}

/* ---- the answer: frame + chain --------------------------------------------------------- */

.answer {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
  max-width: 1000px;
  margin: clamp(32px, 5vw, 56px) auto 0;
}
.frame {
  position: relative;
  border-radius: 18px;
  border: 4px solid var(--navy);
  overflow: hidden;
  background: var(--l-high);
  aspect-ratio: 9 / 16;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play-area {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 0 16px;
  background: none; border: 0; cursor: pointer;
}
.play-area:focus-visible { outline: 4px solid var(--yellow); outline-offset: -8px; border-radius: 14px; }
.play {
  position: relative;
  white-space: nowrap;
  font: 600 17px/1 var(--display);
  background: var(--navy); color: var(--white);
  padding: 11px 16px 11px 34px; border-radius: 999px;
}
.play::before {
  content: ""; position: absolute; left: 15px; top: 50%; translate: 0 -50%;
  width: 11px; height: 13px; background: var(--yellow);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.play-area:hover .play { background: var(--blue); }
.play-area:disabled { cursor: default; }
.play-area:disabled .play { background: rgba(255, 255, 255, 0.92); color: var(--navy); padding-left: 16px; }
.play-area:disabled .play::before { display: none; }
.frame.playing img, .frame.playing .play-area { display: none; }

.setup { margin: 4px 0 18px; font-size: clamp(20px, 2.4vw, 24px); font-weight: 700; }
.end { margin: 22px 0 0; font: 600 clamp(22px, 2.6vw, 28px)/1.25 var(--display); }

.chain { list-style: none; margin: 0; padding: 0; position: relative; }
.chain::before {
  content: ""; position: absolute; left: 31px; top: 14px; bottom: 14px;
  border-left: 3px solid color-mix(in srgb, currentColor 22%, transparent);
}
.chain li { position: relative; padding: 8px 0 8px 82px; }
.k {
  position: absolute; left: 0; top: 9px;
  width: 64px; padding: 5px 0 6px;
  text-align: center;
  font: 600 15px/1 var(--display);
  border-radius: 999px;
}
.k-but { background: var(--yellow); color: var(--navy); }
.k-so { background: var(--blue); color: var(--white); }
.k-and { background: var(--white); color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }

.answer.swap .steps, .answer.swap .frame img { animation: rise 0.35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .answer.swap .steps, .answer.swap .frame img { animation: none; } }

@media (max-width: 760px) {
  .answer { grid-template-columns: 1fr; }
  .frame { width: min(64vw, 280px); margin: 0 auto; }
}

/* ---- the world, top to bottom --------------------------------------------------------- */

.world { background: var(--l-sky); padding-top: clamp(40px, 6vw, 72px); }
.world-title {
  margin: 0 max(clamp(16px, 4vw, 40px), (100% - 1100px) / 2);
  font: 700 clamp(28px, 4vw, 44px)/1.1 var(--display);
}

/* each layer has a jagged, low-poly top edge in its own colour, like the cutaways */
.layer {
  position: relative;
  background: var(--bg);
  color: var(--fg, var(--navy));
  padding: clamp(28px, 4vw, 44px) clamp(16px, 4vw, 40px) clamp(48px, 6vw, 72px);
}
.layer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -27px; height: 28px;
  background: var(--bg);
  clip-path: var(--edge);
}
.layer-sky { --bg: var(--l-sky); }
.layer-sky::before { display: none; }
.layer-high {
  --bg: var(--l-high);
  --edge: polygon(0 60%, 9% 30%, 18% 55%, 31% 20%, 44% 50%, 57% 25%, 70% 55%, 83% 15%, 92% 45%, 100% 30%, 100% 100%, 0 100%);
}
.layer-ground {
  --bg: var(--l-ground);
  --edge: polygon(0 40%, 12% 70%, 22% 35%, 35% 60%, 48% 30%, 61% 65%, 74% 40%, 86% 70%, 100% 35%, 100% 100%, 0 100%);
}
.layer-under {
  --bg: var(--l-under); --fg: #fff3e4;
  --edge: polygon(0 55%, 7% 25%, 19% 60%, 27% 30%, 41% 70%, 53% 20%, 66% 55%, 78% 25%, 90% 65%, 100% 40%, 100% 100%, 0 100%);
}
.layer-sea {
  --bg: var(--l-sea); --fg: var(--white);
  background: linear-gradient(var(--l-sea), var(--deep));
  --edge: polygon(0 50%, 10% 35%, 20% 50%, 30% 35%, 40% 50%, 50% 35%, 60% 50%, 70% 35%, 80% 50%, 90% 35%, 100% 50%, 100% 100%, 0 100%);
}
.layer-name {
  max-width: 1100px; margin: 0 auto 18px;
  font: 600 15px/1 var(--display);
  letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.8;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  max-width: 1100px; margin: 0 auto;
  list-style: none; padding: 0;
}
@media (max-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; text-decoration: none; }
.card img {
  aspect-ratio: 9 / 16; width: 100%; object-fit: cover;
  border-radius: 14px;
  border: 3px solid var(--navy);
  background: color-mix(in srgb, var(--bg) 70%, var(--navy));
  transition: transform 0.15s ease-out;
}
.layer-under .card img, .layer-sea .card img { border-color: rgba(255, 255, 255, 0.85); }
.card:hover img, .card:focus-visible img { transform: translateY(-4px); }
.card-need { margin: 10px 2px 0; font: 600 19px/1.2 var(--display); }
.card-need::before { content: "…"; }
.card-meta { margin: 4px 2px 0; font-size: 15px; opacity: 0.75; }

/* ---- about, at the bottom of the sea ------------------------------------------------- */

.about {
  background: var(--deep); color: var(--white);
  padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 40px);
}
.about h2, .about p { max-width: 680px; margin-left: max(0px, (100% - 1100px) / 2); margin-right: auto; }
.about h2 { margin-top: 0; margin-bottom: 12px; font: 700 28px/1.1 var(--display); }
.about p { margin-top: 0; margin-bottom: 14px; font-size: 19px; color: rgba(255, 255, 255, 0.88); }

.foot {
  background: #041f33; color: rgba(255, 255, 255, 0.8);
  padding: 28px clamp(16px, 4vw, 40px);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 16px;
}
.foot p { margin: 0; }
.foot b { font-family: var(--display); font-weight: 600; color: var(--white); }
.contact { flex-basis: 100%; }
.contact a { color: var(--white); }
.credit { flex-basis: 100%; font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.credit a { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.credit img { box-sizing: content-box; padding: 4px 5px; background: #fff; border-radius: 6px; }
.book {
  display: inline-flex; align-items: center; gap: 16px;
  margin-top: 22px;
  padding: 10px 22px 10px 12px; border-radius: 12px;
  background: var(--yellow); color: var(--navy);
  font: 600 18px/1.2 var(--display); text-decoration: none;
  box-shadow: inset 0 0 0 3px var(--navy);
}
.book img {
  width: 60px; height: auto; aspect-ratio: 180 / 255;
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--navy), 3px 3px 0 2px var(--navy);
  transition: transform 0.15s ease-out;
}
.book small { display: block; margin-top: 5px; font: 400 15px/1 var(--body); }
.book:hover { background: #ffe680; }
.book:hover img { transform: translateY(-2px) rotate(-3deg); }
.book[hidden] { display: none; }
