@font-face {
  font-family: "Bitter";
  src: url("fonts/bitter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bitter";
  src: url("fonts/bitter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/chakra-petch-latin-ext-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --black: #000000;
  --bg: #1b1714;
  --panel: #27221e;
  --text: #efe8dc;
  --muted: #a89f92;
  --accent: #d2772f;
  --font: "Bitter", Georgia, serif;
  --display: "Chakra Petch", "Bitter", Georgia, serif;
  --fade: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
html.js { background: var(--fade); }
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
code, kbd, samp, pre { font-family: inherit; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, .brand, .know, .insight, .button, .upgrade .name, .bar p { font-family: var(--display); font-weight: 600; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2.4rem; margin-bottom: 0; }
.call-me { color: var(--muted); font-size: 1.15rem; margin: 4px 0 1.2rem; }
h2 { font-size: 1.7rem; margin-top: 0; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: .4rem; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
input { font: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.pre-done .start { display: none; }
html.pre-done .bar { display: flex !important; }
html.pre-done .site-header { display: flex !important; }
.lost { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.lost h1 { margin-top: 24px; }

.skip-link {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: var(--black); padding: 8px 12px; z-index: 20;
}
.skip-link:focus { top: 16px; }

.button, button.button {
  display: inline-block;
  background: var(--accent); color: var(--black);
  border: 2px solid var(--accent); border-radius: 4px;
  padding: 10px 18px; min-height: 44px;
  text-decoration: none; white-space: nowrap; font-weight: 600;
}
.button:hover { background: transparent; color: var(--accent); }
.linkish {
  background: none; border: 0; padding: 0; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; min-height: 44px;
}

/* start screen and game */
.start {
  position: relative; height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: 1fr auto;
  padding: 16px;
}
.hud { position: absolute; top: 16px; left: 0; right: 0; max-width: 920px; margin: 0 auto; padding: 0 16px; }
.insight { font-size: 1.5rem; margin: 0; white-space: nowrap; }
.clock { color: var(--muted); font-size: 1rem; font-family: var(--font); font-weight: 400; margin-left: 12px; }
.message { margin: 4px 0 0; color: var(--accent); min-height: 1.6em; }
.middle {
  grid-row: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; text-align: center;
}
.compass { color: var(--accent); flex: none; }
.compass-big { width: 96px; height: 96px; cursor: pointer; touch-action: manipulation; }
.know {
  background: transparent; color: var(--accent);
  border: 2px solid var(--accent); border-radius: 6px;
  padding: 14px 28px; font-size: 1.4rem;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  white-space: nowrap;
}
.know:hover, .know:active { background: var(--accent); color: var(--black); }
.start-hint { color: var(--muted); margin: 0; visibility: hidden; }
.start-hint.show { visibility: visible; }
.skip-game {
  grid-row: 2; justify-self: center; color: var(--muted); font-size: 16px; padding: 12px 0; text-align: center;
}
.skip-game:hover { color: var(--accent); }
html:not(.js) .start { display: none; }

/* desktop: the game panel sits in the page flow under the start area */
.drawer { max-width: 920px; margin: 0 auto; padding: 0 16px 24px; display: grid; gap: 16px; }
.edge { display: none; }

@media (max-width: 799px) {
  html.playing, html.playing body { height: 100%; overflow: hidden; }
  .start { padding-bottom: 64px; }
  html.playing .start { position: fixed; inset: 0; }
  html.open-right .edge-bottom, html.open-bottom .edge-right { display: none; }
  html.playing .site-header, html.playing .site-footer { display: none; }
  
  .drawer {
    position: fixed; z-index: 15; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
    padding: 16px;
  }
  .drawer-right {
    top: 0; right: 0; bottom: 0; width: min(420px, 85vw);
    border-left: 1px solid var(--muted);
    transform: translateX(100%);
  }
  html.open-right .drawer-right { transform: none; }
  html.playing main {
    position: fixed; left: 0; right: 0; bottom: 0; height: 85vh; height: 85dvh; z-index: 15;
    margin: 0; max-width: none; padding: 16px 16px 48px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg); border-top: 1px solid var(--muted);
    transform: translateY(100%);
  }
  html.playing main > section { max-width: 920px; margin: 0 auto; }
  html.playing.open-bottom main { transform: none; }
  
  .edge {
    position: fixed; z-index: 16; display: flex; align-items: center; justify-content: center;
    background: var(--bg); color: var(--muted); border: 1px solid var(--muted);
    padding: 0; touch-action: manipulation;
  }
  .edge-right { right: 0; top: 50%; width: 44px; height: 72px; margin-top: -36px; border-right: 0; border-radius: 6px 0 0 6px; }
  .edge-bottom { bottom: 0; left: 50%; width: 72px; height: 44px; margin-left: -36px; border-bottom: 0; border-radius: 6px 6px 0 0; }
  .edge:hover { color: var(--accent); }
  .edge.alert { color: var(--accent); }
  html.open-right .edge-right { right: min(420px, 85vw); }
  html.open-right .edge-right svg { transform: scaleX(-1); }
  html.open-bottom .edge-bottom { bottom: 85vh; bottom: 85dvh; }
  html.open-bottom .edge-bottom svg { transform: scaleY(-1); }
  .drawer { max-width: none; margin: 0; display: block; }
  .edge { display: flex; }
}

.upgrades, .splits { background: var(--panel); border: 1px solid var(--muted); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; }
@media (min-width: 800px) { .drawer { grid-template-columns: 3fr 2fr; } .upgrades, .splits { margin-bottom: 0; } }
.upgrades h2, .splits h2 { font-size: 1.1rem; margin-bottom: 8px; }
.upgrades ul { list-style: none; padding: 0; margin: 0; }
.upgrade {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto;
  gap: 0 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--muted); border-radius: 4px;
  padding: 8px 12px; margin-bottom: 8px; min-height: 44px;
  touch-action: manipulation;
}
.upgrade:hover:not(:disabled) { border-color: var(--accent); }
.upgrade:disabled { color: var(--muted); cursor: default; background: transparent; }
.upgrade .name { min-width: 0; }
.upgrade .cost { white-space: nowrap; text-align: right; font-size: 16px; }
.upgrade .line, .upgrade .owned { grid-column: 1 / -1; color: var(--muted); font-size: 16px; }
.upgrade:disabled .name { color: var(--muted); }
.splits ol { margin: 0; padding-left: 1.4rem; }
.splits li.done { color: var(--muted); }
.splits li.done .split-time { color: var(--text); }
.split-time { float: right; white-space: nowrap; margin-left: 12px; }

/* finished bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
  background: var(--panel); border-bottom: 1px solid var(--muted);
  padding: 8px 16px;
}
.bar p { margin: 0; white-space: nowrap; }
.bar a, .bar .linkish { white-space: nowrap; min-height: 0; padding: 8px 0; }

/* header */
.site-header {
  max-width: 920px; margin: 0 auto; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.2rem; white-space: nowrap;
  min-height: 44px;
}
.site-header nav { display: flex; gap: 0 16px; flex-wrap: wrap; flex-basis: 100%; order: 3; }
.site-header nav a, .play { white-space: nowrap; padding: 10px 0; display: inline-block; }
.play { margin-left: auto; }
html.skipped .unlock-line { display: none; }
html.js:not(.started):not(.skipped) .site-footer { display: none; }

/* content */
main { max-width: 920px; margin: 0 auto; padding: 8px 16px 48px; }
section { padding: 24px 0; border-top: 1px solid var(--muted); }
section:first-child { border-top: 0; }
html.js [data-tier].locked { display: none; }
.unlock-line { color: var(--accent); margin-bottom: 1rem; }
html:not(.js) .unlock-line { display: none; }

dl { margin: 0 0 1rem; display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; }
dt { color: var(--muted); }
dd { margin: 0; }

.project { display: grid; gap: 16px; margin-bottom: 32px; }
.project:last-child { margin-bottom: 0; }
.meta { color: var(--muted); }
.meta span { white-space: nowrap; }
.shot { border: 1px solid var(--muted); border-radius: 4px; overflow: hidden; }
.shot-placeholder {
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-style: dashed;
}
.job { margin-bottom: 24px; }
.job .meta span::before { content: "·"; margin: 0 .5em; }
.sub { margin-top: 32px; }

.hall-note { color: var(--muted); }
.hall-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.hall-form label { flex-basis: 100%; }
.hall-form input {
  background: var(--bg); color: var(--text); border: 1px solid var(--muted); border-radius: 4px;
  padding: 10px 12px; min-height: 44px; flex: 1 1 200px; min-width: 0;
}
.hall-form input:focus { border-color: var(--accent); outline: none; }
.hall-list { padding-left: 1.6rem; }
.hall-list li { display: flex; gap: 16px; }
.hall-list .time { margin-left: auto; white-space: nowrap; }
.hall-list .you { color: var(--accent); }
.hall-list .date { color: var(--muted); white-space: nowrap; }
.hall-empty { color: var(--muted); list-style: none; margin-left: -1.6rem; }

.site-footer { max-width: 920px; margin: 0 auto; padding: 24px 16px; border-top: 1px solid var(--muted); }
.fine { color: var(--muted); font-size: 14px; margin: 0; }

@media (min-width: 600px) {
  .site-header nav { flex-basis: auto; order: 0; margin-left: auto; }
  .play { margin-left: 0; }
  html.pre-skipped .start { display: none; }
  .project { grid-template-columns: 1fr 1fr; align-items: start; }
  .project-text-only { grid-template-columns: 1fr; }
  .hall-form label { flex-basis: auto; }
}
@media (min-width: 800px) {
  body { font-size: 19px; }
  h1 { font-size: 3rem; }
  .project { grid-template-columns: 3fr 2fr; }
}

@media (prefers-reduced-motion: no-preference) {
  html.js { transition: background-color .6s linear; }
  html.drawers .drawer, html.drawers main, html.drawers .edge { transition: transform .25s ease, right .25s ease, bottom .25s ease; }
  .edge.alert { animation: breathe 1.8s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: .35; } }
  .know { transition: background-color .1s, color .1s; }
  .know.bump { animation: bump .12s; }
  @keyframes bump { 50% { transform: scale(.96); } }
}
