@font-face {
  font-family: 'FS Hakumo';
  src: url('fonts/FsHakumoRegular-V49Ky.ttf') format('truetype');
  /* only one cut exists; the range stops browsers faking bold on top of it */
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* served from this site rather than Google Fonts, so pages make no third-party requests */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/ibm-plex-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fefae0;
  --ink: #283618;
  --muted: #606c38;
  --line: #606c38;
  --magenta: #bc6c25;
  --olive: #606c38;
  --teal: #dda15e;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --display: "FS Hakumo", "Courier New", monospace;
  /* the paper's dot grain, painted as a background so it always sits under text and images */
  --grain: radial-gradient(rgba(74, 90, 84, .14) .55px, transparent .75px) 0 0 / 5px 5px;
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent
}

a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation
}

.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--grain), var(--paper);
  border: 1px solid var(--ink);
  isolation: isolate
}

.screen:before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(95, 108, 102, .5);
  pointer-events: none;
  z-index: 50
}

.screen:after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(95, 108, 102, .18);
  pointer-events: none;
  z-index: 50
}

.topline {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 52px;
  height: 1px;
  background: rgba(86, 99, 95, .35);
  z-index: 10
}

.site-nav {
  position: absolute;
  top: 12px;
  left: 20px;
  display: flex;
  gap: 4px;
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 60
}

.site-nav a {
  padding: 10px
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px
}

.progress-rail {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px
}

.progress-ascii {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.1;
  color: var(--muted);
  white-space: pre
}

.progress-ascii span {
  color: var(--magenta)
}

.progress-label {
  font-family: var(--display);
  font-size: 12px;
  color: var(--magenta);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: .05em;
  text-transform: lowercase
}

main,
.scene {
  position: absolute;
  inset: 0
}

.scene {
  display: none;
  opacity: 0
}

.scene.active {
  display: block;
  opacity: 1
}

.scene.entering {
  animation: sceneIn .42s both
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.tiny-kicker {
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 13px
}

.magenta {
  color: var(--magenta)
}

.olive {
  color: var(--olive)
}

.site-footer {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 22px;
  font-size: 11px;
  color: var(--muted);
  z-index: 60
}

.site-footer a {
  padding: 6px 0;
  transition: color .2s
}

.site-footer a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px
}

.site-footer a:hover {
  color: var(--magenta)
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  line-height: .88;
  letter-spacing: -.01em;
  /* the headline font's capitals look poor, so titles always set in lowercase */
  text-transform: lowercase;
  margin: 0
}

/* fixed character geometry: art is measured in columns, not arbitrary pixels */
.ascii-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 1;
  opacity: 0.12
}

.ascii-art {
  font-family: var(--mono);
  font-weight: 400;
  white-space: pre;
  font-size: 1.5vw;
  line-height: 1;
  letter-spacing: 0;
  tab-size: 1;
  margin: 0;
  font-variant-ligatures: none;
  user-select: none;
  text-rendering: geometricPrecision;
  width: 100%;
  height: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: var(--teal)
}

/* HOME */
.home-copy {
  position: absolute;
  left: 8.7vw;
  right: 6vw;
  top: 18vh;
  z-index: 8
}

.home-copy h1 {
  font-size: clamp(44px, 7.4vw, 106px)
}

.home-copy h1 span {
  display: block
}

.home-copy p {
  margin: 10px 0 0 6px;
  font-size: 14px;
  max-width: 440px;
  line-height: 1.5;
  color: var(--muted)
}

.home-stage .ascii-orbit {
  color: #8ca69e;
  transition: transform .2s ease-out;
  position: absolute;
  right: 0;
  top: 0;
  text-align: right
}

/* DAYLINE */
.dayline-layout {
  position: absolute;
  inset: 13vh 7vw 9vh 8.5vw
}

.dayline-title {
  position: absolute;
  left: 0;
  top: 1vh;
  max-width: 500px;
  z-index: 8
}

.dayline-title h2 {
  font-size: clamp(46px, 8vw, 114px)
}

.caption {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin: 15px 0 0 5px;
  text-wrap: pretty
}

.feature-list {
  list-style: none;
  margin: 14px 0 0 5px;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink)
}

.feature-list li {
  padding-left: 18px;
  text-indent: -18px
}

.feature-list li:before {
  content: "\25B8";
  display: inline-block;
  width: 18px;
  text-indent: 0;
  color: var(--magenta)
}

.store-links {
  display: flex;
  gap: 15px;
  margin-top: 22px;
  margin-left: 5px;
  align-items: center
}

.store-links .tiny-kicker {
  margin: 0
}

.store-links img {
  height: 38px;
  width: 38px;
  opacity: 0.75;
  filter: grayscale(100%) contrast(1.5);
  transform: scale(1.15)
}

.small-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  margin: 6px 0 0 5px;
  font-size: 11px;
  color: var(--muted)
}

.small-links a {
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px
}

.small-links a:hover {
  color: var(--magenta)
}

/* Two phones on the right, drawn like the site's windows: an ink outline and a hard shadow. */
.dayline-shots {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2.2vw;
  margin: 0;
  z-index: 8
}

.dayline-shots img {
  display: block;
  height: min(58vh, 30vw);
  width: auto;
  border: 1px solid var(--ink);
  border-radius: 6%/2.8%;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink)
}

.dayline-shots img:first-child {
  height: min(50vh, 26vw);
  margin-top: 8vh
}

.railway-stage pre {
  color: var(--teal);
  transition: transform .2s
}

.rail-particles {
  position: absolute;
  inset: 0
}

.rail-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--teal);
  opacity: .9;
  box-shadow: 0 0 0 2px rgba(55, 164, 142, .08)
}

/* ABOUT */
.about-layout {
  position: absolute;
  inset: 15vh 9vw 9vh 9vw;
  z-index: 10
}

.about-layout.text-heavy {
  display: flex;
  flex-direction: column;
  overflow-y: auto
}

/* auto margins centre the content but never push it out of reach when it overflows */
.about-layout.text-heavy > :first-child {
  margin-top: auto
}

.about-layout.text-heavy > :last-child {
  margin-bottom: auto
}

.about-header h2 {
  font-size: clamp(46px, 8vw, 114px)
}

.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8vw;
  margin-top: 25px
}

.about-col p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 12px 0
}

.about-col h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 24px 0 8px 0;
  letter-spacing: .02em;
  text-transform: lowercase
}

.about-col h3:first-child {
  margin-top: 0
}

.portrait-stage pre {
  color: #92aaa0;
  text-align: right
}

/* CONTACT */
.contact-layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-align: center;
  z-index: 10
}

.contact-email {
  font-family: var(--display);
  font-size: clamp(20px, 4.8vw, 66px);
  letter-spacing: 0;
  color: var(--magenta);
  overflow-wrap: anywhere;
  transition: color .2s
}

.contact-email:hover {
  color: var(--olive)
}

/* LEGAL PAGES */
.legal-content {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  padding: 96px max(24px, 6vw) 24px
}

.legal-content h1 {
  font-size: clamp(30px, 5vw, 60px);
  text-wrap: balance
}

.legal-date {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: .07em;
  color: var(--muted)
}

/* two columns where there's room, one on narrow screens */
.legal-columns {
  columns: 2 360px;
  column-gap: 4vw;
  margin-top: 28px
}

.legal-columns section {
  break-inside: avoid;
  margin-bottom: 20px
}

.legal-columns h2 {
  font: 700 12px/1.5 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase
}

.legal-columns p {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.6
}

.legal-content a {
  text-decoration: underline;
  text-underline-offset: 3px
}

.legal-content a:hover {
  color: var(--magenta)
}

.legal-bg {
  position: fixed
}

.return {
  display: inline-block;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em
}

/* headings take focus when a scene opens from the menu; the scene change already shows where you are */
[tabindex="-1"]:focus {
  outline: none
}

/* 404 */
.error-ascii {
  color: var(--magenta)
}

.error-copy {
  top: 32vh
}

.error-copy h1 {
  font-size: clamp(40px, 7vw, 96px)
}

.error-copy a {
  font-size: 12px;
  text-decoration: underline;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink)
}

a:focus-visible {
  outline: 1px solid var(--magenta);
  outline-offset: 3px
}

@media(max-width:980px) {
  .progress-rail {
    left: 15px
  }

  .home-copy {
    left: 12vw
  }

  .home-stage {
    left: 44vw;
    right: 5vw
  }

  .about-columns {
    grid-template-columns: 1fr;
    gap: 0
  }

  .portrait-stage {
    display: none
  }

  .about-layout {
    inset: 70px 8vw 90px
  }
}

/*
  FLOW: phones, small tablets, short landscape windows and the legal pages.
  The scenes stack and the page scrolls normally; the frame and menu stay put.
*/
.flow,
.flow body {
  height: auto;
  overflow: visible
}

.flow .screen {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  border: 0
}

/* the frame stays on the glass; the paper ring masks content scrolling under the edge */
.flow .screen:before,
.flow .screen:after {
  position: fixed
}

.flow .screen:before {
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--ink)
}

.flow .site-nav {
  position: fixed;
  top: 7px;
  left: 7px;
  right: 7px;
  height: 45px;
  padding: 0 6px;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  background: var(--paper);
  z-index: 45
}

.flow .topline {
  position: fixed;
  z-index: 46
}

.flow .progress-rail {
  display: none
}

.flow main,
.flow .scene {
  position: relative;
  inset: auto
}

.flow .scene {
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 1;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px max(24px, 8vw) 56px;
  animation: none
}

.flow .home-copy,
.flow .dayline-layout,
.flow .dayline-title,
.flow .about-layout,
.flow .contact-layout {
  position: relative;
  inset: auto;
  left: auto;
  top: auto
}

.flow .home-copy h1 {
  font-size: min(13vw, 100px)
}

.flow .home-copy p,
.flow .caption,
.flow .about-col p {
  font-size: 15px;
  line-height: 1.6
}

.flow .feature-list {
  font-size: 14px
}

.flow .dayline-title h2,
.flow .about-header h2 {
  font-size: min(13vw, 100px)
}

.flow .dayline-shots {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  justify-content: center;
  gap: 5vw;
  margin: 40px 0 0
}

.flow .dayline-shots img {
  height: auto;
  width: min(40vw, 240px)
}

.flow .dayline-shots img:first-child {
  height: auto;
  width: min(36vw, 216px);
  margin-top: 40px
}

/* bigger characters so the art still reads on a narrow screen; translate leaves transform free for the pointer parallax */
.flow #homeOrbit,
.flow #railAscii {
  font-size: 3vw
}

.flow #homeOrbit {
  left: 50%;
  right: auto;
  width: auto;
  translate: -50% 0
}

.flow .about-layout.text-heavy {
  overflow: visible
}

.flow .about-columns {
  grid-template-columns: 1fr;
  gap: 0
}

.flow .contact-layout {
  padding: 0
}

.flow .site-footer {
  position: relative;
  inset: auto;
  padding: 16px 24px 32px;
  column-gap: 18px;
  font-size: 12px
}

.flow .site-footer a {
  padding: 10px 0
}

@media(prefers-reduced-motion:reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important
  }
}
