/* D-1030: an anime road movie. Daylight sky (drawn by the 3D world behind the page), cards drawn like manga panels with an
   ink border and a hard offset shadow, titles in Zen Maru Gothic, text in Inter. Painted episodes, the one in production
   and the storyboards ahead each have their own card. */
@font-face {
  font-family: "Zen Maru Gothic";
  src: url("/roadmap/zen-maru-gothic-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Zen Maru Gothic";
  src: url("/roadmap/zen-maru-gothic-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/roadmap/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #2b2636;
  --paper: #fffdf8;
  --sketch: #f3f1ea;
  --pencil: #6b6876;
  --sky: #2f86e0;
  --sun: #ffd166;
  --coral: #e8735a;
  --leaf: #5aa846;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--sky);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
.card-label,
.to-be-continued,
.bar-title,
.wordmark,
.frame,
.bubble strong {
  font-family: "Zen Maru Gothic", "Inter", system-ui, sans-serif;
}

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  opacity: 0;
  transition: opacity 900ms ease;
}

.world-ready .world {
  opacity: 1;
}

.sky-fallback {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #2f86e0 0%, #9fd3ff 60%, #ffe1c4 100%);
}

.bar {
  position: fixed;
  z-index: 10;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.wordmark svg {
  display: block;
  width: auto;
  height: 26px;
}

.bar-title {
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  text-shadow: 0 2px 0 rgb(43 38 54 / 0.45);
}

.lang {
  margin-inline-start: auto;
  display: inline-flex;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}

.lang button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

main {
  position: relative;
  z-index: 1;
}

/* The opening title card, over the harbour at dawn. */
.opening {
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top, 0px) + 96px) var(--gutter) 32px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 28px;
}

.title-card {
  max-width: 560px;
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-1.2deg);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 900;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 900;
  line-height: 1.15;
}

p {
  margin: 0;
}

.lead {
  max-width: 52ch;
  font-size: 17px;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.facts div {
  display: grid;
  gap: 2px;
}

.facts dt {
  font-size: 13px;
  color: var(--pencil);
}

.facts dd {
  margin: 0;
  font-weight: 650;
}

.meter {
  display: block;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sketch);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: calc(var(--done) * 100%);
  background: repeating-linear-gradient(135deg, var(--sun) 0 8px, #ffb84d 8px 16px);
}

.rulebook {
  font-size: 14px;
  color: var(--pencil);
}

.no-motion {
  display: none;
}

.world-none .no-motion {
  display: block;
  font-size: 14px;
}

.scroll-cue {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 0 rgb(43 38 54 / 0.5);
}

.scroll-cue::after {
  content: "";
  display: block;
  width: 2px;
  height: 40px;
  margin: 10px 0 0 10px;
  background: #fff;
  border-radius: 2px;
}

/* Episodes: each one a screen and a half of road, its card on alternate sides. */
.episode {
  min-height: 150svh;
  padding: 30svh var(--gutter);
  display: flex;
  align-items: flex-start;
}

.episode-right {
  justify-content: flex-end;
}

.card {
  position: sticky;
  top: 96px;
  width: min(440px, 100%);
  display: grid;
  gap: 10px;
  padding: 22px 22px 18px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
}

.episode-left .card {
  transform: rotate(-0.8deg);
}

.episode-right .card {
  transform: rotate(0.8deg);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-label {
  font-weight: 900;
  font-size: 15px;
  color: var(--coral);
}

.stamp {
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.stamp-done {
  background: #d9f2c9;
}

.stamp-now {
  background: var(--sun);
}

.stamp-planned {
  background: var(--sketch);
  border-style: dashed;
  color: var(--pencil);
}

.card-about {
  color: #4a4556;
}

.card-count {
  font-size: 14px;
  color: var(--pencil);
}

.scenes {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
}

.scene {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 4px;
  border-top: 1.5px dashed rgb(43 38 54 / 0.18);
  font-size: 15px;
}

.scene-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--pencil);
}

.scene-when {
  font-size: 13.5px;
  color: var(--pencil);
  text-align: end;
}

.scene-done .scene-name::before {
  content: "✓ ";
  color: var(--leaf);
  font-weight: 800;
}

.scene-now {
  background: linear-gradient(90deg, rgb(255 209 102 / 0.6), transparent);
  border-radius: 4px;
}

.scene-now .scene-name,
.scene-now .scene-when {
  font-weight: 700;
  color: var(--ink);
}

/* The episode in production: key drawings with colour going in. */
.card-now {
  box-shadow: 8px 8px 0 var(--coral);
}

/* Storyboards: pencil on paper, not yet coloured. */
.card-planned {
  background: var(--sketch);
  border: 2px dashed var(--pencil);
  box-shadow: 6px 6px 0 rgb(107 104 118 / 0.45);
  color: #4a4752;
}

.card-planned .card-label,
.card-planned h2 {
  color: #4a4752;
}

.side-story {
  padding: 20svh var(--gutter) 10svh;
  display: flex;
  justify-content: center;
}

.finale {
  min-height: 100svh;
  padding: 10svh var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 120px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 48px;
}

.to-be-continued {
  padding: 14px 28px;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--ink);
  font-weight: 900;
  font-size: clamp(24px, 3vw, 32px);
  transform: rotate(-2deg);
}

.foot {
  max-width: 640px;
  display: grid;
  gap: 6px;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: rgb(255 253 248 / 0.94);
  font-size: 14px;
}

.revision {
  color: var(--pencil);
}

/* The speech bubble over the car. */
.bubble {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  display: grid;
  gap: 2px;
  max-width: 240px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 13.5px;
  pointer-events: none;
  will-change: transform;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

.bubble strong {
  font-size: 17px;
  color: var(--coral);
}

/* The film strip: one frame per episode, painted, in production or sketched. */
.filmstrip {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--ink);
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.25);
}

.frame {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
  transition: transform 160ms ease;
}

.frame-done {
  background: linear-gradient(180deg, #8fd0ff, #c9f0a8);
}

.frame-now {
  background: var(--sun);
}

.frame-planned {
  background: var(--sketch);
  color: var(--pencil);
}

.frame-on {
  transform: translateY(-4px);
  outline: 2px solid #fff;
}

.noscript {
  padding: var(--gutter);
}

@media (max-width: 700px) {
  .episode {
    min-height: 130svh;
    padding-top: 55svh;
  }

  .episode-right {
    justify-content: flex-start;
  }

  .card,
  .episode-left .card,
  .episode-right .card {
    position: relative;
    top: auto;
    transform: none;
  }

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

  .bar-title {
    display: none;
  }

  /* On a phone the cards scroll under the bar: a strip of paper behind it keeps both readable. */
  .bar {
    top: 0;
    left: 0;
    right: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 10px;
    background: rgb(255 253 248 / 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 2.5px solid var(--ink);
  }

  .bar .wordmark,
  .bar .lang {
    box-shadow: none;
  }

  .frame {
    width: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world,
  .frame {
    transition: none;
  }
}
