/* Golden Hour, issue No. 1: the site as a painted picture comic. */

@font-face { font-family: "Yatra One"; src: url("/fonts/yatra-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/fonts/kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/fonts/kalam-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --indigo: #1f2c5c;     /* cover stock */
  --indigo-deep: #141d40;
  --yellow: #f6c445;     /* process yellow: masthead, captions */
  --red: #d23a22;        /* title ink */
  --teal: #2a9d8f;
  --ink: #141414;        /* keyline and lettering */
  --sheet: #fffdf8;      /* interior page stock */
  --art: #f1e9e2;        /* the turnaround's own paper */
  --line: 3px;           /* panel border */
  --gutter: clamp(10px, 1.4vw, 18px);
  --edge: clamp(12px, 2.4vw, 32px);
  --title: "Yatra One", "Kalam", serif;
  --letter: "Kalam", "Comic Sans MS", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--yellow) var(--indigo-deep); }
body {
  margin: 0;
  background: var(--indigo);
  color: var(--ink);
  font: 400 1.125rem/1.4 var(--letter);
  overflow-x: clip;
}
::selection { background: var(--yellow); color: var(--ink); }
img, video, canvas, svg { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--yellow); color: var(--ink); padding: 8px 12px; font-weight: 700; }
.skip:focus { left: 8px; }

/* Panels: black keyline, image fills */
.panel {
  position: relative; overflow: hidden;
  border: var(--line) solid var(--ink);
  background: var(--art);
}
.panel img, .panel video { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }

/* Lettering */
.caption {
  position: absolute; z-index: 2; left: -1px; top: -1px; margin: 0;
  max-width: min(78%, 22rem);
  padding: 0.45em 0.7em;
  background-color: var(--yellow);
  border: var(--line) solid var(--ink); border-width: 0 var(--line) var(--line) 0;
  font: 700 clamp(0.9rem, 1.25vw, 1.125rem)/1.25 var(--letter); text-transform: uppercase; letter-spacing: 0.02em;
}
.speech {
  position: absolute; z-index: 2; top: 8%; right: 8%; margin: 0;
  padding: 0.6em 0.9em;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 50%;
  font: 700 clamp(0.95rem, 1.3vw, 1.2rem)/1.15 var(--letter); text-transform: uppercase; text-align: center;
}

/* Cover */
.cover { height: 520vh; }
.cover-sheet {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; grid-template-rows: auto 1fr; gap: var(--gutter);
  padding: var(--edge);
}
.masthead {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 24px;
  padding: clamp(10px, 1.6vw, 20px) clamp(14px, 2vw, 28px) clamp(8px, 1.2vw, 16px);
  background-color: var(--yellow);
  border: var(--line) solid var(--ink);
}
.title { margin: 0; font-weight: 400; line-height: 0.8; }
.title span { display: block; font-family: var(--title); }
.title-first { font-size: clamp(3.4rem, 8.6vw, 7.6rem); color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.title-last { font-size: clamp(1.5rem, 3.4vw, 3rem); margin-top: 0.12em; letter-spacing: 0.06em; text-transform: uppercase; }
.tagline {
  grid-column: 1; margin: 6px 0 0;
  font: 700 clamp(0.85rem, 1.2vw, 1.05rem)/1.2 var(--letter); text-transform: uppercase; letter-spacing: 0.08em;
}
.issue {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  display: grid; justify-items: center; gap: 4px;
  padding: 8px 12px 10px; background: #fff; border: var(--line) solid var(--ink);
  text-transform: uppercase; text-align: center;
}
.issue-no { font: 700 0.9rem/1 var(--letter); }
.issue-no b { display: block; font: 400 clamp(2.4rem, 4vw, 3.4rem)/0.85 var(--title); color: var(--red); }
.issue-name { font: 700 0.75rem/1 var(--letter); letter-spacing: 0.08em; }

.cover-art { display: grid; place-items: center; min-height: 0; background: linear-gradient(90deg, #eee6de, #f0e8e0 45%, #f4ece4); }
.turn {
  height: 100%; width: auto; aspect-ratio: 9 / 16; max-width: 100%;
  /* the clip's paper isn't perfectly flat; fade its side edges into the panel */
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.cover-caption { max-width: 17rem; font-size: clamp(1rem, 1.6vw, 1.4rem); }
.balloon {
  position: absolute; z-index: 3;
  left: calc(50% + clamp(60px, 6vw, 110px)); top: 4%;
  width: clamp(230px, 22vw, 320px); aspect-ratio: 3 / 2;
}
.balloon-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.balloon-shape path { fill: #fff; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.roles { position: absolute; inset: 9% 11% 27%; list-style: none; margin: 0; padding: 0; display: grid; place-items: center; }
.roles li {
  grid-area: 1 / 1; text-align: center;
  font: 700 clamp(0.95rem, 1.35vw, 1.2rem)/1.15 var(--letter); text-transform: uppercase;
  opacity: 0; transform: scale(0.92); transition: opacity 0.25s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.roles li b { display: block; font-family: var(--title); font-weight: 400; font-size: 1.6em; line-height: 1; color: var(--red); text-transform: none; margin-bottom: 2px; }
.roles li.is-on { opacity: 1; transform: none; }
.turn-hint {
  position: absolute; z-index: 2; bottom: -1px; right: -1px; margin: 0;
  padding: 0.5em 0.8em;
  background: var(--yellow); border: var(--line) solid var(--ink); border-width: var(--line) 0 0 var(--line);
  font: 700 0.85rem/1 var(--letter); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink);
  transition: opacity 0.4s;
}
.cover.is-turning .turn-hint { opacity: 0; }
/* cover blurb: the starburst every newsstand cover shouts from */
.burst {
  position: absolute; z-index: 2; left: clamp(20px, 5vw, 80px); bottom: clamp(20px, 8%, 70px);
  width: clamp(170px, 15vw, 230px); aspect-ratio: 1;
  display: grid; place-items: center; text-align: center;
  rotate: -8deg;
}
.burst svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.burst polygon { fill: var(--red); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.burst p { position: relative; margin: 0; max-width: 62%; color: #fff; font: 700 clamp(0.9rem, 1.15vw, 1.1rem)/1.1 var(--letter); text-transform: uppercase; }
.burst b { display: block; font: 400 1.5em/1 var(--title); color: var(--yellow); text-transform: none; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }

/* Interior pages */
.page { padding: 0 var(--edge) clamp(40px, 8vh, 96px); }
.sheet {
  max-width: 1240px; margin: 0 auto;
  padding: var(--gutter);
  background: var(--sheet);
  box-shadow: 0 2px 4px rgba(5, 8, 20, 0.35), 0 18px 50px rgba(5, 8, 20, 0.45);
}
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gutter); }
.p-wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.p-face { grid-column: 1 / 3; aspect-ratio: 4 / 5; }
.p-ride { grid-column: 3 / -1; background: #faf2ea; }
.p-bend { grid-column: 1 / 5; aspect-ratio: 4 / 3; }
.p-tall { grid-column: 5 / -1; }
.p-end {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px;
  padding: clamp(18px, 3vw, 36px) clamp(18px, 3vw, 40px);
  background: var(--indigo); color: #fff;
}
.continued { margin: 0; font: 400 clamp(2rem, 5vw, 4rem)/1 var(--title); color: var(--yellow); }
.next { margin: 0; font: 700 clamp(1rem, 1.6vw, 1.35rem)/1.3 var(--letter); text-transform: uppercase; letter-spacing: 0.04em; }
.p-face .speech {
  top: 40%; bottom: auto; left: 0; right: 0; margin: 0 auto; width: min(86%, 13rem);
  padding: 0; border: 0; border-radius: 0; background: none;
  aspect-ratio: 2 / 1; display: grid; place-items: center;
}
.p-face .speech svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.p-face .speech path { fill: #fff; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.p-face .speech span { position: relative; padding: 18% 10% 0; }
.sfx {
  position: absolute; z-index: 2; left: 5%; top: 6%; margin: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  font: 400 clamp(1.4rem, 3.2vw, 2.8rem)/0.95 var(--title); text-transform: uppercase;
  color: var(--yellow); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
  transform: rotate(-6deg);
}
.sfx span { display: inline-block; }
.sfx span:nth-child(2) { margin-left: 0.4em; }
.sfx span:nth-child(3) { margin-left: 0.8em; }
.folio {
  max-width: 1240px; margin: 10px auto 0; text-align: center;
  font: 700 0.95rem/1 var(--letter); color: #c9d0ea;
}

/* the ink goes down before the colour: panels arrive as line art, then fill */
.js .page .panel img, .js .page .panel video { filter: grayscale(1) contrast(1.35) brightness(1.08); transition: filter 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.js .page .panel.is-inked img, .js .page .panel.is-inked video { filter: none; }
.js .page .panel .caption, .js .page .panel .speech { opacity: 0; translate: 0 -6px; transition: opacity 0.35s 0.5s, translate 0.45s 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.js .page .panel.is-inked .caption, .js .page .panel.is-inked .speech { opacity: 1; translate: 0 0; }
.is-inked .sfx span { animation: thump 0.9s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.is-inked .sfx span:nth-child(2) { animation-delay: 0.15s; }
.is-inked .sfx span:nth-child(3) { animation-delay: 0.3s; }
@keyframes thump { 0%, 60%, 100% { transform: none; } 20% { transform: translateY(-0.12em) scale(1.06); } }

/* Back cover */
.back { padding: clamp(40px, 8vh, 96px) var(--edge) var(--edge); background: var(--indigo-deep); }
.back-sheet { max-width: 1240px; margin: 0 auto; color: #fff; }
.back-title {
  margin: 0 0 clamp(16px, 3vh, 28px);
  font: 400 clamp(2.4rem, 6vw, 5rem)/0.95 var(--title); color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.series { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gutter); }
.mini {
  display: grid; grid-template-rows: auto 1fr auto; height: 100%;
  aspect-ratio: 2 / 3;
  border: var(--line) solid var(--ink); background: var(--art); color: var(--ink);
  text-decoration: none; overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s;
}
.mini img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 30%); min-height: 0; }
.mini-band {
  display: flex; justify-content: space-between; align-items: start; gap: 6px;
  padding: 8px 10px 7px; background-color: var(--band); border-bottom: var(--line) solid var(--ink);
  color: var(--band-ink, var(--ink));
}
.mini-title { min-height: 1.9em; font: 400 clamp(1.15rem, 1.8vw, 1.7rem)/0.95 var(--title); }
.mini-no { flex: none; padding: 2px 5px 1px; background: #fff; color: var(--ink); border: 2px solid var(--ink); font: 700 0.7rem/1 var(--letter); text-transform: uppercase; text-align: center; }
.mini-no b { display: block; font: 400 1.25rem/0.9 var(--title); color: var(--red); }
.mini-where {
  display: grid; gap: 4px;
  padding: 8px 10px 9px; background: #fff; border-top: var(--line) solid var(--ink);
  font: 700 0.9rem/1 var(--letter); text-transform: uppercase; letter-spacing: 0.06em;
}
.mini-line { min-height: 2.5em; font: 400 0.95rem/1.25 var(--letter); text-transform: none; letter-spacing: 0; }
.mini:hover, .mini:focus-visible { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); }
.letters {
  margin-top: clamp(24px, 5vh, 48px); padding: clamp(16px, 2.4vw, 28px);
  background: var(--sheet); color: var(--ink); border: var(--line) solid var(--ink);
  max-width: 40rem;
}
.letters h3 { margin: 0 0 6px; font: 400 clamp(1.4rem, 2.4vw, 2rem)/1 var(--title); color: var(--red); }
.letters p { margin: 0; font-size: 1.2rem; }
.letters a { font-weight: 700; overflow-wrap: anywhere; }
.letters a:hover { color: var(--red); }

/* Phones */
@media (max-width: 760px) {
  .tagline { grid-column: 1 / -1; }
  .issue { padding: 6px 8px; }
  .cover-caption { max-width: 60%; }
  .balloon { left: auto; right: 4px; top: 30%; width: min(58vw, 230px); }
  .burst { display: none; }
  .p-face { grid-column: 1 / 3; aspect-ratio: auto; }
  .p-ride { grid-column: 3 / -1; }
  .p-ride video { aspect-ratio: 4 / 5; }
  .p-wide { aspect-ratio: 4 / 3; }
  .p-bend { grid-column: 1 / -1; }
  .p-tall { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .sfx { font-size: 1.05rem; left: 4%; top: 4%; }
  .p-face .speech { width: 92%; top: 42%; font-size: 0.74rem; }
  .turn-hint { font-size: 0.75rem; }
  .series { grid-template-columns: repeat(2, 1fr); }
  .series li:last-child { grid-column: 1 / -1; }
  .series li:last-child .mini { aspect-ratio: 16 / 11; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover { height: auto; }
  .cover-sheet { position: relative; }
  .turn-hint { display: none; }
  .roles { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 0.1em 0.35em; }
  .roles li { opacity: 1; transform: none; font-size: 0; }
  .roles li b { font-size: clamp(0.85rem, 1.1vw, 1.05rem); margin: 0; }
  .js .page .panel img, .js .page .panel video { filter: none; transition: none; }
  .js .page .panel .caption, .js .page .panel .speech { opacity: 1; translate: none; transition: none; }
  .is-inked .sfx span { animation: none; }
  .roles li, .mini { transition: none; }
}
