/* GoPast's website (gopast.se). The app's light palette (app/src/theme/palette.json), its three
   typefaces and its parchment. The site is light only, like the app. */

@font-face {
  font-family: 'IM Fell English';
  src: url(fonts/fell.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'IM Fell English';
  font-style: italic;
  src: url(fonts/fell-italic.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'IM Fell English SC';
  src: url(fonts/fell-sc.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url(fonts/newsreader.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  src: url(fonts/newsreader-italic.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url(fonts/schibsted.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-weight: 600;
  src: url(fonts/schibsted-semibold.woff2) format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #ebe1cc;
  --card: #f3ebdc;
  --card2: #e9dfca;
  --ink: #15171c;
  --body: #2a2d33;
  --muted: #4b4f56;
  --line: #cdbd9b;
  --rule: #b39d72;
  --wave: #c9b996;
  --ornament: #4e3f2a;
  --accent: #99352b;
  --accent-ink: #912d22;
  --on-accent: #fbf6ec;
  --age: 90 60 25;
  --fell: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --fell-sc: 'IM Fell English SC', 'Iowan Old Style', Georgia, serif;
  --news: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --gutter: 18px;
  --wide: 1180px;
  --text: 680px;
}
@media (min-width: 720px) {
  :root {
    --gutter: 36px;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font: 400 19px/1.62 var(--news);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* The parchment, as the app draws it: fine grain, soft mottling and a darker rim. */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background: url(img/paper-grain.png) 0 0 / 96px 96px repeat;
  opacity: 0.45;
}
body::after {
  background: url(img/paper-mottle.png) 0 0 / 100% 100% no-repeat;
  opacity: 0.18;
  box-shadow: inset 0 0 44px rgb(var(--age) / 0.9);
}
img,
video {
  max-width: 100%;
  display: block;
}
a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.measure {
  max-width: var(--text);
}

/* Type */
h1,
h2,
h3 {
  font-family: var(--fell);
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}
h1 {
  font-size: clamp(48px, 8.4vw, 98px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
}
h3 {
  font-size: 28px;
  line-height: 1.15;
}
p {
  margin: 0 0 1em;
}
.overline {
  font: 400 17px/1.3 var(--fell-sc);
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  margin: 0 0 12px;
}
.lead {
  font-size: clamp(21px, 2.3vw, 24px);
  line-height: 1.52;
  color: var(--body);
}
.caption {
  font: italic 400 16px/1.5 var(--fell);
  color: var(--muted);
}
.small {
  font: 400 15px/1.5 var(--sans);
  color: var(--muted);
}
/* Run-in small capitals, as a book starts a paragraph. */
.runin {
  font-family: var(--fell-sc);
  font-size: 1.08em;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.drop::first-letter {
  float: left;
  font: 400 4.1em/0.82 var(--fell);
  color: var(--accent);
  margin: 0.06em 0.08em 0 0;
}
.divider {
  display: block;
  width: 132px;
  height: 18px;
  color: var(--ornament);
  margin: 20px 0 26px;
}

/* Double frame, like the app's Framed: a rule outside, a finer line inside. */
.framed {
  border: 1px solid var(--rule);
  padding: 4px;
}
.framed > .in {
  border: 1px solid var(--line);
  background: rgb(243 235 220 / 0.74);
}

/* Masthead */
.masthead {
  padding-top: 18px;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 3px double var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font: 400 30px/1 var(--fell);
}
.brand:hover {
  color: var(--ink);
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow: 0 2px 7px rgb(var(--age) / 0.25);
}
.masthead nav {
  display: flex;
  gap: 24px;
  font: 400 15px/1 var(--sans);
}
.masthead nav a {
  color: var(--body);
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .masthead nav {
    gap: 16px;
    font-size: 14px;
  }
  .brand {
    font-size: 27px;
  }
}
.masthead nav a:hover,
.masthead nav a[aria-current] {
  color: var(--accent-ink);
}
.masthead nav .extra {
  display: none;
}
@media (min-width: 820px) {
  .masthead nav .extra {
    display: inline;
  }
}

/* Store buttons, black as Apple and Google draw theirs. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.store {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px 10px 15px;
  border-radius: 11px;
  background: var(--ink);
  color: #f6f1e7;
  font: 600 17px/1.15 var(--sans);
  text-decoration: none;
}
a.store:hover {
  color: #fff;
}
.store small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0.75;
}
.store svg {
  width: 22px;
  height: 22px;
  flex: none;
}

/* Hero */
.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px);
}
.hero .wrap {
  display: grid;
  gap: 48px 64px;
  align-items: center;
}
@media (min-width: 940px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}
.hero .lead {
  max-width: 34em;
  margin: 28px 0 34px;
}
.hero .where {
  margin: 20px 0 0;
}
.stage {
  position: relative;
  display: grid;
  justify-items: center;
  margin: 0;
}
.stage .rose {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(640px, 150%);
  translate: -50% -56%;
  opacity: 0.12;
  pointer-events: none;
  animation: turn 300s linear infinite;
}
@keyframes turn {
  to {
    rotate: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage .rose {
    animation: none;
  }
}
.stage figcaption {
  position: relative;
  max-width: 330px;
  margin-top: 14px;
  text-align: center;
}

/* A phone with the app in it: a picture or a recording. */
.phone {
  --w: 300px;
  position: relative;
  width: var(--w);
  aspect-ratio: 1206 / 2622;
  padding: calc(var(--w) * 0.034);
  border-radius: calc(var(--w) * 0.17);
  background: var(--ink);
  box-shadow:
    0 40px 70px -32px rgb(var(--age) / 0.75),
    0 18px 30px -18px rgb(0 0 0 / 0.45),
    inset 0 0 0 1.5px #3a3d44;
}
.phone .screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.137);
  background: var(--ground);
}
.phone .screen img,
.phone .screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The sound button under a recording, in the red of the app's wax seals. It sits below the
   phone, never on the app's own buttons in the film. */
.sound {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px rgb(255 255 255 / 0.16),
    0 6px 14px -6px rgb(0 0 0 / 0.5);
}
.sound svg {
  width: 18px;
  height: 18px;
}
.sound .off {
  display: none;
}
.loud .sound .on {
  display: none;
}
.loud .sound .off {
  display: block;
}

/* Sections */
.section {
  padding: clamp(64px, 10vw, 128px) 0;
}
.section + .section {
  padding-top: 0;
}
.head {
  margin-bottom: clamp(32px, 5vw, 52px);
}
.head .lead {
  margin: 0;
}
.cols {
  display: grid;
  gap: 40px 72px;
}
@media (min-width: 940px) {
  .cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .cols.wide-left {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
}

/* The register: the stories as the app's list draws them, the year first. */
.register {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 940px) {
  .register.two {
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
    align-items: start;
  }
}
.entry > .in {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 12px 14px 12px 12px;
}
.year {
  text-align: left;
  color: var(--accent-ink);
  font-family: var(--fell);
  line-height: 1;
}
.year i {
  display: block;
  font-size: 15px;
  color: var(--accent-ink);
  margin-bottom: 2px;
}
.year b {
  font-weight: 400;
  font-size: 30px;
}
.year b.word {
  font-size: 22px;
}
.entry .name {
  font: 600 19px/1.25 var(--sans);
  color: var(--ink);
  margin: 0;
}
.entry .name a {
  color: inherit;
  text-decoration: none;
}
.entry .name a:hover {
  text-decoration: underline;
  text-decoration-color: var(--rule);
}
.entry .meta {
  font: 400 15px/1.35 var(--sans);
  color: var(--muted);
  margin: 2px 0 0;
}
.seal {
  flex: none;
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--on-accent);
  background: radial-gradient(circle at 50% 42%, #a83d32 0%, var(--accent) 62%, #8a2f26 100%);
  box-shadow:
    inset 0 0 0 2.5px rgb(255 255 255 / 0.13),
    0 4px 10px -4px rgb(var(--age) / 0.9);
  display: grid;
  place-items: center;
}
.seal svg {
  width: 19px;
  height: 19px;
}
.seal .pause,
.playing .seal .go {
  display: none;
}
.playing .seal .pause {
  display: block;
}
.entry .more {
  grid-column: 1 / -1;
  display: none;
  padding: 10px 2px 4px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.entry.open .more {
  display: block;
}
.entry .bar {
  margin: 6px 0 14px;
}
.entry .more p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 10px;
}
.entry .more .small {
  margin: 0;
}

/* Sentences light up while the voice reads them. */
.cued [data-at] {
  transition: color 0.4s;
}
.cued.reading [data-at] {
  color: #6a6e75;
}
.cued.reading [data-at].lit {
  color: var(--ink);
}

/* Progress line */
.bar {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  cursor: pointer;
}
.bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
}
.times {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font: 400 14px/1 var(--sans);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* The film strip: recordings from the app, each with its museum label. */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 262px;
  gap: 34px;
  overflow-x: auto;
  padding: 10px var(--gutter) 30px;
  margin-inline: calc(-1 * var(--gutter));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar {
  display: none;
}
@media (min-width: 1000px) {
  .strip {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    justify-items: center;
  }
}
.strip figure {
  margin: 0;
  scroll-snap-align: center;
}
.strip .phone {
  --w: 262px;
}
.strip figcaption {
  max-width: 262px;
  margin-top: 18px;
}
.strip figcaption b {
  display: block;
  font: 400 23px/1.2 var(--fell);
  color: var(--ink);
  margin-bottom: 4px;
}

/* An engraving, printed on the paper. */
.plate {
  margin: 0;
}
.plate img {
  width: 100%;
  height: auto;
  filter: sepia(0.35) contrast(0.96);
  mix-blend-mode: multiply;
}
.plate figcaption {
  margin-top: 10px;
}

/* A sentence from a story, set large. */
.pull {
  margin: 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--rule);
}
.pull p {
  font: italic 400 clamp(28px, 3.4vw, 38px) / 1.22 var(--fell);
  color: var(--ink);
  margin: 0 0 12px;
}
.pull cite {
  font: 400 15px/1.4 var(--sans);
  font-style: normal;
  color: var(--muted);
}

/* The areas, as a table in an old handbook. */
.areas {
  width: 100%;
  border-collapse: collapse;
  font: 400 16px/1.35 var(--sans);
}
.areas th {
  font: 400 15px/1.2 var(--fell-sc);
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
  padding: 0 0 10px 14px;
  border-bottom: 1px solid var(--rule);
}
.areas th:first-child {
  text-align: left;
  padding-left: 0;
}
.areas td {
  white-space: nowrap;
  padding: 14px 0 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.areas td:first-child {
  white-space: normal;
  text-align: left;
  padding-left: 0;
  color: var(--body);
}
.areas td:first-child b {
  display: block;
  font: 400 23px/1.2 var(--fell);
  color: var(--ink);
}
@media (max-width: 560px) {
  .areas .opt {
    display: none;
  }
}

/* The letter to kommuner */
.letter > .in {
  padding: clamp(26px, 5vw, 56px);
}
.letter p {
  font-size: 20px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 15px 26px;
  border-radius: 10px;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 18px/1 var(--sans);
  box-shadow: 0 8px 18px -10px rgb(var(--age) / 0.9);
}
.cta:hover {
  color: var(--on-accent);
  filter: brightness(1.06);
}

/* A story's own page */
.crumbs {
  margin: 28px 0 0;
  font: 400 15px/1.4 var(--sans);
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
}
.story {
  padding: clamp(28px, 5vw, 56px) 0 clamp(56px, 8vw, 96px);
}
.story .top {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: end;
  margin-bottom: 30px;
}
.story .top .year b {
  font-size: clamp(44px, 6vw, 64px);
}
.story .top .year b.word {
  font-size: clamp(30px, 4vw, 40px);
}
.story .top .year i {
  font-size: 18px;
}
.story h1 {
  font-size: clamp(42px, 6.4vw, 76px);
}
.story .body {
  display: grid;
  gap: 40px 64px;
}
@media (min-width: 980px) {
  .story .body {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .story .body > aside {
    position: sticky;
    top: 24px;
  }
}
.player {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 30px;
}
.player .seal {
  width: 60px;
  height: 60px;
}
.player .seal svg {
  width: 24px;
  height: 24px;
}
.player .track {
  flex: 1;
}
.speed {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
}
.story .text p {
  font-size: 21px;
  line-height: 1.66;
}
.story figure.pic {
  margin: 0 0 30px;
}
.story figure.pic img {
  width: 100%;
  height: auto;
  filter: sepia(0.3) contrast(0.97);
}
.facts {
  font: 400 15px/1.5 var(--sans);
  color: var(--muted);
}
.facts h2 {
  font: 400 17px/1.3 var(--fell-sc);
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  margin: 26px 0 8px;
}
.facts h2:first-child {
  margin-top: 0;
}
.facts p {
  margin: 0 0 8px;
}
.inapp {
  align-self: start;
}
.inapp > .in {
  padding: 24px 24px 26px;
}
.inapp p {
  font-size: 18px;
  margin-bottom: 16px;
}

/* Colophon */
.colophon {
  padding: 56px 0 72px;
  border-top: 3px double var(--rule);
}
.colophon .wrap {
  display: grid;
  gap: 28px;
  align-items: start;
}
@media (min-width: 860px) {
  .colophon .wrap {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}
.colophon p {
  font: 400 15px/1.6 var(--sans);
  color: var(--muted);
  max-width: 720px;
}
.colophon .brand {
  font-size: 26px;
}
.colophon .brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

/* Small layout helpers: the pages carry no inline styles, so a strict Content-Security-Policy
   can forbid them. */
.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.end {
  align-self: end;
}
.center-self {
  align-self: center;
}
.more-link {
  margin-top: 22px;
}
.note {
  margin-top: 18px;
}
.last {
  margin-bottom: 0;
}
.section.after {
  padding-top: 0;
}
.page-title {
  font-size: clamp(44px, 7vw, 80px);
}
.letter {
  max-width: 880px;
}
.film-frame {
  max-width: 1000px;
}
.film-frame > .in {
  background: var(--ink);
}
.film-frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* A recording beside its text. On a phone the text comes first. */
.phone-fig {
  margin: 0;
  display: grid;
  justify-items: center;
}
.phone-fig figcaption {
  max-width: 330px;
  margin-top: 14px;
  text-align: center;
}
.film-pair .phone-fig {
  order: 2;
}
@media (min-width: 940px) {
  .film-pair .phone-fig {
    order: 0;
  }
}
