/* Scents & Semiosis in jistevenson.com's palette and type. The rules after the site header restyle the release's own
   stylesheet (release/scents.css): the same selectors, layout, and timings (the cover fades in over 5 s, the last
   title over 2 s, and the closing options over 4 s), in the site's colors and fonts in place of its golds and Amiri.
   Its desktop layout is kept as it was; on phones, a few rules let it fit. */

@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/newsreader.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Newsreader Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/newsreader-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The story's names and words from other languages: ā, ī, ū, ł, ž, and the like */
@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/newsreader-ext.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Newsreader Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/newsreader-ext-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Hanken Grotesk Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/hanken-grotesk.woff2) format('woff2-variations');
}

:root {
  --ground: #ffffff;
  --surface: #f6f6ee;
  --ink: #1d2114;
  --muted: #51553f;
  --line: #e0e2d4;
  --primary: #4d6a26;
  --primary-deep: #3a501c;
  --tint: #eef2e2;
  --accent: #b02a3a;
  --accent-deep: #8e1f2e;

  --serif: 'Newsreader Variable', 'Iowan Old Style', Georgia, serif;
  --sans: 'Hanken Grotesk Variable', 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
  /* The height of the header and the row under it, which the centered cover keeps clear of */
  --chrome: 154px;

  color-scheme: light;
}

/* Vorple's own stylesheet (vorple.min.css) sets Roboto, black, and blue links; these take their place,
   on the game page (.play) and the About and 404 pages (.info). The release's source pages load this stylesheet
   too, after their style.css, as they did the original, and keep style.css's serif. */
.play,
.play input,
.play label,
.play .font-proportional,
.info {
  font-family: var(--sans);
}

#loader,
body,
input,
label {
  color: var(--ink);
  background-color: var(--ground);
}

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

/* The header below and the row under it are sized as on jistevenson.com, where every box is border-box. Vorple's
   game area keeps the browser's default, as in the release. */
.site-header,
.site-header * {
  box-sizing: border-box;
}

/* site-header:start (written by jistevenson.com's npm run sync-header; edit it there, not here) */
/* The main site's header, for the mini-sites (SPEC.md, Mini-sites): the same links in the same places as on
   jistevenson.com. `npm run sync-header` copies this into each mini-site's stylesheet; edit it here. Self-contained, with
   the main site's colors and fonts as fallbacks, so it looks the same whatever the mini-site defines. */
.site-header {
  border-bottom: 1px solid var(--line, #e0e2d4);
  background: var(--ground, #ffffff);
  font-family: var(--sans, 'Hanken Grotesk Variable', 'Segoe UI', system-ui, sans-serif);
}

.site-header .site-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 8px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px var(--gutter, clamp(16px, 5vw, 48px));
}

.site-header .brand {
  order: 1;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink, #1d2114);
  font-family: var(--serif, 'Newsreader Variable', 'Iowan Old Style', Georgia, serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-header .header-search {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 8px;
  color: var(--ink, #1d2114);
}

.site-header .header-search:hover {
  background: var(--tint, #eef2e2);
}

.site-header .header-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.site-header .header-cta {
  order: 3;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent, #b02a3a);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-header .header-cta:hover {
  background: var(--accent-deep, #8e1f2e);
  color: #ffffff;
}

.site-header .site-nav {
  order: 4;
  display: flex;
  flex-basis: 100%;
  gap: 0 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.site-header .site-nav a {
  padding: 12px 0;
  color: var(--ink, #1d2114);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-header .site-nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent, #b02a3a);
}

.site-header .site-nav a[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent, #b02a3a);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.site-header a:focus-visible {
  outline: 2px solid var(--accent, #b02a3a);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .site-header .site-wrap {
    column-gap: 24px;
  }

  .site-header .brand {
    font-size: 1.5rem;
  }

  .site-header .site-nav {
    order: 2;
    flex-basis: auto;
    gap: 0 22px;
    margin-left: auto;
  }

  .site-header .header-search {
    order: 3;
    margin-left: 0;
  }

  .site-header .header-cta {
    order: 4;
    padding: 0 18px;
  }
}
/* site-header:end */

/* The game's own pages, in a row under the main site's header */
.subnav,
.subnav * {
  box-sizing: border-box;
}

.subnav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--sans);
}

/* As wide as the header above it, so its links line up under the name */
.subnav .wrap {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.subnav a,
.subnav a:visited {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.subnav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.subnav a[aria-current='page'] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
}

/* While Python and the story load, the loader (Vorple's, as in the release) covers the game, not the whole window,
   so the header stays usable. */
#haven {
  position: relative;
}

#loader {
  position: absolute;
  bottom: auto;
  min-height: 70vh;
}

#loader-message {
  margin-top: 64px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

#spinner {
  position: absolute;
  top: 130px;
  color: var(--primary);
}

/* The release's stylesheet, restyled ---------------------------------------------------------------------------- */

#body {
  font-family: var(--serif);
}

.maintext {
  font-family: var(--serif);
  font-size: 18px;
}

#output {
  font-family: var(--serif);
  font-size: 18px;
}

#lineinput-field,
#lineinput-prefix {
  font-family: var(--serif);
  font-size: 18px;
}

/* The command line is hidden, but takes its line at the end of the page while the game waits for a choice. Vorple's
   stylesheet makes its field as wide as the line, and Haven's script then narrowed it to fit beside the prompt; this
   does that here, so the field doesn't drop to a second line. */
#lineinput-field {
  width: calc(100% - 2em);
}

/* The cover, which fades in over 5 s once you press a key after the Heavy Petal card. Centered in the window below
   the header, as the release centers it in the window; on a phone it takes the window's width less the margins. */
.petalfade {
  position: fixed;
  top: calc(50% + var(--chrome) / 2);
  left: 50%;
  width: calc(100vw - 2 * var(--gutter));
  max-width: 619px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 5s ease-in-out;
}

.petalfade img {
  max-height: calc(100vh - var(--chrome) - 150px);
  object-fit: contain;
}

.choicelist {
  border: none;
  padding: 10px;
}

/* On a phone, each choice is a 44 px target; from a tablet up they sit as close together as in the release. */
.choicelist a,
.interrupt-choice a,
.initial-options a,
.finoptions a {
  display: inline-block;
  padding-block: 9px;
}

a,
a:visited {
  font-weight: 600;
  color: var(--primary);
}

a:hover {
  font-weight: 600;
  color: var(--primary-deep);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

.bannertext {
  line-height: 1.3;
  display: block;
}

/* About and the endnote: the floral strip beside a panel */
.abouttable {
  border: none;
  padding: 10px;
  background-color: var(--surface);
  font-size: 16px;
}

td.flowerbar {
  width: 64px;
  vertical-align: top;
}

.abootbox {
  font-size: 30px;
  bottom: 0;
  right: 0;
  color: white;
  background-color: var(--surface);
  position: fixed;
  border: 5px solid var(--surface);
}

/* The closing title, which fades in over 2 s */
.fin {
  opacity: 0;
  padding-top: 50px;
  font-size: 36px;
  text-align: center;
  transition: opacity 2s ease-in-out;
}

.lastlist {
  margin-left: 0;
}

/* The options under the closing list, which fade in over 4 s */
.finoptions {
  padding-top: 50px;
  opacity: 0;
  text-align: center;
  font-size: 18px;
  border: none;
  margin: 0 auto;
  transition: opacity 4s ease-in-out;
}

/* The title page's row of links: source code, about, play, modes, and content */
.initial-options {
  padding-top: 32px;
  text-align: center;
  font-size: 18px;
  border: none;
  margin: 0 auto;
}

.initial-options tr,
.finoptions tr {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

td.thicc {
  padding: 6px 10px;
}

.fadein {
  opacity: 1;
}

.flex-container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
}

.modeimg {
  margin-right: 15px;
}

/* On a phone, each mode's picture sits above its name and description, and the modes are spaced apart */
.modechoices .clearfix {
  margin-bottom: 28px;
}

.modeimg .vorple-image {
  line-height: 0;
}

.modetxt h2 {
  margin: 0;
  padding-top: 12px;
}

/* The release's stylesheet also gives .modetxt `padding 70px 30px 70px`, without the colon, so browsers never
   applied it; it's left out here, so the modes sit as they did. */

.clearfix::after {
  content: '';
  clear: both;
  display: table;
}

h2 {
  padding-top: 20px;
  color: var(--primary);
  font-family: var(--serif);
  font-weight: 600;
}

/* From a tablet up, the release's own layout */
@media (min-width: 640px) {
  .choicelist a,
  .interrupt-choice a,
  .initial-options a,
  .finoptions a {
    display: inline;
    padding-block: 0;
  }

  .maintext,
  #output,
  #lineinput-field,
  #lineinput-prefix {
    font-size: 20px;
  }

  .abouttable {
    font-size: 17px;
  }

  td.flowerbar {
    width: 170px;
  }

  .fin {
    font-size: 45px;
  }

  .lastlist {
    margin-left: 50px;
  }

  .finoptions {
    padding-left: 30px;
    padding-right: 30px;
    margin: 0;
    transform: translate(25%);
  }

  .initial-options {
    padding-top: 50px;
    padding-left: 30px;
    padding-right: 30px;
    margin: 0;
    transform: translate(25%);
  }

  .initial-options tr,
  .finoptions tr {
    display: table-row;
  }

  td.thicc {
    padding: 0 15px;
  }

  .modeimg {
    float: left;
  }

  .modechoices .clearfix {
    margin-bottom: 0;
  }

  .modeimg .vorple-image {
    line-height: inherit;
  }

  .modetxt h2 {
    margin: 0.83em 0;
    padding-top: 20px;
  }
}

/* From 900 px the header is one row */
@media (min-width: 900px) {
  :root {
    --chrome: 110px;
  }
}

/* The About page (about.html), laid out like the site's own pages --------------------------------------------------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px var(--gutter) 56px;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.page p,
.page ul {
  margin: 0 0 16px;
}

.page h1 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(2.125rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.page h2 {
  margin: 40px 0 12px;
  padding-top: 0;
  color: var(--ink);
  font-size: clamp(1.5rem, 3.6vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
}

.page .eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page .lead {
  color: var(--muted);
  font-size: 1.1875rem;
}

.page ul {
  padding-left: 1.25em;
}

.page li + li {
  margin-top: 8px;
}

.page li::marker {
  color: var(--accent);
}

.page a,
.page a:visited,
.foot a,
.foot a:visited {
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.foot p {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}

