/* ============================================================
   THE TRUING STAND — shared styles
   Twine narrative pages + wheel simulator frames
   ============================================================ */

/* --- Reset -------------------------------------------------- */

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

/* --- Base --------------------------------------------------- */

:root {
  --bg:        #111009;   /* warm dark — workshop at end of day  */
  --text:      #e8e4d9;   /* off-white — aged paper              */
  --accent:    #005EC4;   /* Park Tool blue                      */
  --rule:      #2a2820;   /* slightly lighter than bg for rules  */
  --dim:       #7a7570;   /* muted — secondary labels            */
  --font:      "Courier New", Courier, monospace;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font);
  font-weight: normal;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

h1 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
}

h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}

h3 {
  font-size: 0.9rem;
  color: var(--dim);
}

p {
  max-width: 52ch;
}

p + p {
  margin-top: 1em;
}

/* --- Links -------------------------------------------------- */

a, a:visited {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

a:hover, a:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

/* --- Horizontal rule --------------------------------------- */

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}

/* --- Page layout ------------------------------------------- */

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* --- Work order card --------------------------------------- */
/* Mimics a job card pinned to a corkboard.                   */
/* Sparse. Text only. One thin rule above.                    */

.work-order {
  border-top: 1px solid var(--accent);
  padding-top: 1.5em;
  margin-top: 2em;
}

.work-order__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
  margin-bottom: 0.6em;
}

.work-order__body {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text);
}

/* --- Buttons ----------------------------------------------- */

button, .button {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 0.45em 1.1em;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  border-bottom: 1px solid var(--accent); /* override link rule */
}

button:hover, .button:hover,
button:focus, .button:focus {
  background-color: var(--accent);
  color: var(--bg);
  outline: none;
}

/* --- Simulator frame --------------------------------------- */
/* Container for the P5 iframe. Sized for the canvas.         */

.simulator-frame {
  /* Break out of .page's max-width so the canvas fills the full viewport */
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: 2em;
  border: 1px solid var(--rule);
  background: #0d0d0f; /* match P5 canvas background */
  line-height: 0;      /* remove gap beneath iframe  */
}

.simulator-frame iframe {
  display: block;
  width: 100%;
  border: none;
}

/* --- Simulator hint text ----------------------------------- */
/* Sits below the simulator frame in the Twine narrative flow. */

.sim-hint {
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.7;
  margin-top: 1em;
}

/* --- Consequence text -------------------------------------- */
/* Delivered by Twine result pages after simulator evaluation. */

.consequence {
  margin-top: 1.5em;
  font-size: 0.9rem;
  color: var(--text);
  font-style: italic;
}

/* --- Utility labels ---------------------------------------- */

.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* --- Twine tw-passage overrides ---------------------------- */
/* Harlowe injects its own wrapper elements. Rein them in.    */

tw-story, tw-passage {
  background: transparent !important;
  font-family: var(--font) !important;
  font-size: inherit !important;
  color: inherit !important;
}

tw-link, tw-link:visited {
  color: var(--accent) !important;
  font-family: var(--font) !important;
}

tw-link:hover {
  text-decoration: underline !important;
}
