/* Imaginalis: paper by day, as in the app (ios/Shared/Tokens.swift). */

@font-face {
  font-family: 'Goudy Bookletter 1911';
  src: url('/fonts/GoudyBookletter1911.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/fonts/LibreCaslonText.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/fonts/LibreCaslonText-Italic.woff2') format('woff2');
  font-style: italic;
  font-display: swap;
}

:root {
  --paper0: #efe6d5;
  --paper1: #f7f1e5;
  --paper2: #fcf8f0;
  --paper3: #e3d3b6;
  --ink: #45301f;
  --ink-secondary: #65543f;
  --vermilion: #b23a25;
  --cut-shadow: 58 42 30;
  --rule: rgb(69 48 31 / 0.14);
  --display: 'Goudy Bookletter 1911', 'Iowan Old Style', Georgia, serif;
  --prose: 'Libre Caslon Text', 'Iowan Old Style', Georgia, serif;
  --column: 42rem;
  --gutter: 20px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper0) url('/images/paper.webp') repeat;
  background-size: 170px;
  color: var(--ink);
  font: 17px/1.6 var(--prose);
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: rgb(69 48 31 / 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-color: var(--ink);
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: normal;
  line-height: 1.15;
  margin: 0;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  background: var(--paper2);
  padding: 6px 12px;
  z-index: 2;
}

/* A sheet of paper lying on the ground: lighter, with a short hard warm
   shadow and a faint lift (PaperSheet). */
.sheet {
  background: var(--paper1) url('/images/sheet.webp') repeat;
  background-size: 170px;
  border-radius: 14px;
  box-shadow:
    0 1.25px 0 rgb(var(--cut-shadow) / 0.24),
    0 2.25px 6px rgb(var(--cut-shadow) / 0.1);
}

.column {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin-inline: auto;
}

/* The small header of an inner page. */
.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0 22px;
}
.masthead a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.masthead img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow: 0 1.25px 0 rgb(var(--cut-shadow) / 0.24);
}
.masthead span {
  font: 26px/1 var(--display);
}

/* An inner page's text. */
.page {
  padding: 36px 24px 40px;
}
.page h1 {
  font-size: 40px;
}
.page .lede {
  color: var(--ink-secondary);
  font-style: italic;
  margin: 10px 0 0;
}
.page h2 {
  font-size: 27px;
  margin: 1.8em 0 0.4em;
}
.page h3 {
  font-size: 21px;
  margin: 1.6em 0 0.3em;
}
.page p,
.page ul {
  margin: 0 0 0.9em;
}
.page ul {
  padding-left: 1.2em;
}
.page li {
  margin-bottom: 0.45em;
}
.page li::marker {
  color: var(--ink-secondary);
}
.page strong {
  font-weight: normal;
  font-style: italic;
}
.page .contents {
  margin-top: 28px;
  padding: 16px 0 4px;
  border-block: 1px solid var(--rule);
  columns: 2;
  column-gap: 24px;
  list-style: none;
  padding-left: 0;
  font-size: 15px;
}
.page .contents li {
  break-inside: avoid;
  margin: 0;
  padding: 3px 0;
}
.page .after-contents {
  margin-top: 1.6em;
}
.address {
  white-space: nowrap;
}

/* A fleuron between parts, as in the app's Library. */
.fleuron {
  display: block;
  width: 14px;
  height: 17px;
  margin: 2.4em auto 0;
  opacity: 0.75;
}

.footer {
  padding: 28px 0 44px;
  color: var(--ink-secondary);
  font-size: 15px;
  text-align: center;
}
.footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-bottom: 10px;
}
.footer p {
  margin: 0;
}

/* The landing page. */

/* The Path's land from the app: mountains, hills and the road under a pale
   sky with the sun, cut from paper, as in LandscapeTheme.path. */
.scene {
  position: relative;
  height: 400px;
  overflow: hidden;
  background: linear-gradient(#e2d8c6, #efe9dc 78%);
}
.scene .strip,
.scene .sun {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  height: auto;
  pointer-events: none;
}
.scene .far {
  width: 140%;
  bottom: 62px;
}
.scene .mid {
  width: 125%;
  bottom: 30px;
}
.scene .near {
  width: 120%;
  bottom: -2px;
}
.scene .sun {
  width: 40px;
  left: 88%;
  top: 34px;
}

.title {
  position: absolute;
  inset: 44px var(--gutter) auto;
  text-align: center;
}
.title img {
  width: 76px;
  height: 76px;
  border-radius: 17px;
  box-shadow:
    0 1.25px 0 rgb(var(--cut-shadow) / 0.24),
    0 3px 8px rgb(var(--cut-shadow) / 0.12);
}
.title h1 {
  font-size: 46px;
  margin-top: 12px;
}
.title .kicker {
  font: italic 18px/1.3 var(--prose);
  color: var(--ink-secondary);
  margin: 4px 0 0;
}

.landing {
  position: relative;
  margin-top: -44px;
  padding: 32px 24px 34px;
}
.landing .subtitle {
  font: 27px/1.2 var(--display);
  text-align: center;
  margin: 0 0 20px;
}
.landing p {
  margin: 0 0 1em;
}
.landing .facts {
  color: var(--ink-secondary);
  font-size: 15px;
  text-align: center;
  margin: 26px 0 0;
}

/* Until the App Store has the app: a quiet line in place of the badge.
   After approval, swap it for the badge link (see index.html). */
.store {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}
.store .soon {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper2);
  font: 18px/1.2 var(--display);
}
.store .badge img {
  display: block;
  height: 54px;
  width: auto;
}

@media (min-width: 720px) {
  body {
    font-size: 18px;
  }
  .scene-wrap {
    padding-top: 32px;
  }
  .scene {
    height: 540px;
    border-radius: 14px 14px 0 0;
  }
  .scene .far {
    bottom: 90px;
  }
  .scene .mid {
    bottom: 48px;
  }
  .title {
    top: 56px;
  }
  .title h1 {
    font-size: 58px;
  }
  .landing {
    padding: 44px 64px 44px;
  }
  .page {
    padding: 52px 64px 56px;
  }
  .page h1 {
    font-size: 48px;
  }
}

@media (max-width: 719px) {
  .scene-wrap .column {
    width: 100%;
  }
  .landing {
    width: min(100% - 2 * 12px, var(--column));
  }
  .page {
    padding-inline: 22px;
  }
  .page .contents {
    font-size: 14px;
    column-gap: 14px;
  }
}

@media (prefers-contrast: more) {
  body,
  .sheet {
    background-image: none;
  }
  .sheet {
    box-shadow: 0 0 0 1px rgb(69 48 31 / 0.6);
  }
}
