/*!
 * MonoLisa 3.000
 * This font is subject to a EULA. A user licence can be acquired at:
 * https://www.monolisa.dev/license
 * © 2026 FaceType Foundry. All Rights Reserved.
 */

@font-face {
  font-family: "MonoLisaCode";
  src: local("MonoLisaCode"), local("MonoLisa Code"),
       url("assets/fonts/0-MonoLisaCode-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0020-007F;
}

@font-face {
  font-family: "MonoLisaCode";
  src: local("MonoLisaCode Italic"), local("MonoLisa Code Italic"),
       url("assets/fonts/1-MonoLisaCode-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0020-007F;
}

@font-face {
  font-family: "MonoLisaCode";
  src: url("assets/fonts/2-MonoLisaCode-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0080-00FF;
}

@font-face {
  font-family: "MonoLisaCode";
  src: url("assets/fonts/3-MonoLisaCode-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0080-00FF;
}

@font-face {
  font-family: "MonoLisaCode";
  src: url("assets/fonts/4-MonoLisaCode-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0100-017F;
}

@font-face {
  font-family: "MonoLisaCode";
  src: url("assets/fonts/5-MonoLisaCode-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 1 900;
  font-display: swap;
  unicode-range: U+0100-017F;
}

:root {
  color-scheme: dark;
  --bg: #282c34;
  --fg: #bbc2cf;
  --fg2: #abb2bf;
  --muted: #5B6268;
  --muted2: #5c6370;
  --blue: #61AFEF;
  --green: #A3BE8C;
  --green2: #98c379;
  --teal: #8FBCBB;
  --teal2: #56b6c2;
  --peach: #D08770;
  --yellow: #e5c07b;
  --red: #e06c75;
  --sel: #3e4451;
  --font: "MonoLisaCode", ui-monospace, monospace;
  --gutter: 0.7rem;
  --mod: 5.2rem;
  --grid: color-mix(in srgb, var(--muted) 38%, transparent);
  --line: color-mix(in srgb, var(--muted2) 80%, transparent);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #d5d8de;
  --fg: #3a4048;
  --fg2: #4a5058;
  --muted: #5B6268;
  --muted2: #5c6370;
  --blue: #3d8ec4;
  --green: #6a8a58;
  --green2: #5f8a42;
  --teal: #4a8a88;
  --teal2: #3a8f99;
  --peach: #b56a52;
  --yellow: #b08a3a;
  --red: #c04e58;
  --sel: #c4c8d0;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  overflow-x: hidden;
}

.skip {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 80;
  padding: 0.4rem 0.7rem;
  background: var(--yellow);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-220%);
}

.skip:focus { transform: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.marks {
  position: fixed;
  inset: 0.45rem;
  z-index: 40;
  pointer-events: none;
}

.marks .c {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
}

.marks .c::before,
.marks .c::after {
  position: absolute;
  background: var(--muted2);
  content: "";
}

.marks .c::before { width: 1.15rem; height: 1px; }
.marks .c::after { width: 1px; height: 1.15rem; }

.marks .tl { top: 0; left: 0; }
.marks .tr { top: 0; right: 0; }
.marks .tr::before, .marks .tr::after { right: 0; }
.marks .bl { bottom: 0; left: 0; }
.marks .bl::before, .marks .bl::after { bottom: 0; }
.marks .br { bottom: 0; right: 0; }
.marks .br::before { right: 0; bottom: 0; }
.marks .br::after { right: 0; bottom: 0; }

.reg {
  position: absolute;
  top: 0.15rem;
  left: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border: 1px solid var(--muted);
  transform: translateX(-50%);
}

.reg::before,
.reg::after {
  position: absolute;
  background: var(--muted);
  content: "";
}

.reg::before {
  top: 50%;
  left: -0.28rem;
  right: -0.28rem;
  height: 1px;
  transform: translateY(-50%);
}

.reg::after {
  left: 50%;
  top: -0.28rem;
  bottom: -0.28rem;
  width: 1px;
  transform: translateX(-50%);
}

.inks {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inks li { width: 0.62rem; height: 0.62rem; }
.inks li:nth-child(1) { background: var(--blue); }
.inks li:nth-child(2) { background: var(--green); }
.inks li:nth-child(3) { background: var(--teal); }
.inks li:nth-child(4) { background: var(--yellow); }
.inks li:nth-child(5) { background: var(--red); }

.sheet-edge {
  position: fixed;
  inset: 1.15rem;
  z-index: 1;
  border: 1px solid var(--line);
  pointer-events: none;
}

.sheet {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto;
  gap: var(--gutter);
  width: min(100%, 92rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 3.2rem 2.6rem 2.4rem;
}

.gridpaper {
  position: absolute;
  inset: 3.2rem 2.6rem 2.4rem;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: calc(100% / 12) var(--mod);
  pointer-events: none;
}

.cols,
.rows {
  position: relative;
  z-index: 3;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  pointer-events: none;
}

.cols {
  grid-column: 1 / -1;
  grid-template-columns: repeat(12, 1fr);
}

.cols li {
  padding: 0 0 0.15rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.rows {
  position: absolute;
  top: 5.4rem;
  left: 0.55rem;
  bottom: 2.4rem;
  grid-template-rows: repeat(8, 1fr);
  align-items: start;
}

.rows li {
  width: 1.05rem;
  height: 1.05rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--muted);
}

.cut {
  grid-column: 1 / -1;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 0.7rem auto 1fr auto 0.7rem;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--yellow);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  pointer-events: none;
}

.cut i {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--yellow);
}

.cut b {
  height: 1px;
  background: var(--yellow);
}

.field {
  position: relative;
  z-index: 4;
  grid-column: 1 / 9;
  grid-row: span 1;
  min-height: calc(var(--mod) * 3);
  padding: 0.9rem 1rem 1.1rem;
  background: var(--sel);
  border: 1px solid var(--fg);
  overflow: hidden;
}

.field .tag {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field .tag span {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.15rem;
  background: var(--yellow);
  color: var(--bg);
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--fg);
  font-size: clamp(4.6rem, 13vw, 11.2rem);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.1em;
}

h1 em {
  display: block;
  margin-top: 0.02em;
  color: var(--peach);
  font-style: italic;
  font-weight: 600;
  font-feature-settings: "ss01" 1;
  letter-spacing: -0.08em;
}

.dim {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.1rem 0 0;
  color: var(--teal);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.dim i {
  flex: 1;
  height: 1px;
  background: var(--teal);
  position: relative;
}

.dim i::before,
.dim i::after {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--teal);
  content: "";
}

.dim i::before { left: 0; }
.dim i::after { right: 0; }

.notes {
  position: relative;
  z-index: 4;
  grid-column: 9 / 13;
  margin: 0;
  padding: 0.85rem 0.9rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
}

.notes li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
  color: var(--fg2);
  font-size: 0.72rem;
}

.notes li:last-child { margin-bottom: 0; }

.notes b {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.notes em {
  color: var(--yellow);
  font-style: italic;
  font-feature-settings: "ss01" 1;
}

.mod {
  position: relative;
  z-index: 4;
  min-height: calc(var(--mod) * 2.2);
  padding: 0.8rem 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
}

.mod .num {
  margin: 0 0 0.25rem;
  color: var(--muted2);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
}

.mod .room {
  margin: 0 0 0.55rem;
  color: var(--teal);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mod h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.mod .run {
  position: relative;
  z-index: 1;
  max-width: 28ch;
  margin: 0.7rem 0 0;
  color: var(--fg2);
  font-size: 0.78rem;
  font-style: italic;
}

.hatch {
  position: absolute;
  inset: auto 0.7rem 0.7rem 0.7rem;
  height: 2.4rem;
  pointer-events: none;
}

.hatch-h {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 4px,
    color-mix(in srgb, var(--blue) 42%, transparent) 4px 5px
  );
}

.hatch-v {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 4px,
    color-mix(in srgb, var(--peach) 42%, transparent) 4px 5px
  );
}

.m01 {
  grid-column: 1 / 5;
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
}

.m01 h2 { color: var(--blue); }

.m02 {
  grid-column: 5 / 9;
}

.m03 {
  grid-column: 9 / 13;
  border-color: color-mix(in srgb, var(--peach) 50%, var(--line));
}

.m03 h2 { color: var(--peach); font-weight: 600; }
.m03 h2 em { font-feature-settings: "ss01" 1; }

.m04 {
  grid-column: 1 / 8;
}

.ascii {
  margin: 0;
  color: var(--green2);
  font-family: inherit;
  font-size: clamp(0.58rem, 1vw, 0.74rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.galley {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.2rem;
}

.galley p {
  margin: 0;
  color: var(--fg2);
  font-size: 0.82rem;
}

.galley em { color: var(--blue); font-feature-settings: "ss01" 1; }
.galley b { color: var(--green); font-weight: 700; }
.galley i { color: var(--yellow); font-style: italic; }

.elev {
  position: relative;
  z-index: 4;
  grid-column: 8 / 13;
  padding: 0.75rem 0.8rem 0.7rem;
  border: 1px solid var(--line);
}

.lbl {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lbl span {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.08rem 0.28rem;
  background: var(--sel);
  color: var(--fg);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 7.2rem;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--fg);
}

.bars i { display: block; width: 100%; }

.b1 { height: 78%; background: var(--blue); }
.b2 { height: 42%; background: var(--green); }
.b3 { height: 92%; background: var(--teal); }
.b4 { height: 28%; background: var(--yellow); }
.b5 { height: 64%; background: var(--peach); }
.b6 { height: 50%; background: var(--red); }

.edim {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-align: center;
}

.sched {
  position: relative;
  z-index: 4;
  grid-column: 1 / 7;
  padding: 0.75rem 0.8rem 0.85rem;
  border: 1px solid var(--line);
  overflow: auto;
}

.sched table {
  width: 100%;
  border-collapse: collapse;
  color: var(--fg2);
  font-size: 0.7rem;
}

.sched th,
.sched td {
  padding: 0.32rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.sched th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.sched td:first-child { color: var(--green2); }
.sched td:last-child { color: var(--yellow); text-align: right; }
.sched th:last-child { text-align: right; }

.key {
  position: relative;
  z-index: 4;
  grid-column: 7 / 9;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
}

.key ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.key li {
  aspect-ratio: 1;
  border: 1px solid var(--muted);
}

.key li.on { background: var(--blue); border-color: var(--blue); }

.scale {
  position: relative;
  z-index: 4;
  grid-column: 9 / 13;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.45rem 0.8rem;
  align-items: end;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
}

.north {
  grid-row: 1 / 3;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  margin: 0;
  color: var(--fg);
  font-size: 0.72rem;
  font-weight: 700;
}

.north b {
  width: 0.7rem;
  height: 1.6rem;
  background: var(--fg);
}

.sbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  margin: 0;
  height: 0.55rem;
  border: 1px solid var(--fg);
}

.sbar i:nth-child(odd) { background: var(--fg); }
.sbar i:nth-child(even) { background: transparent; }

.slbl {
  margin: 0;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.stack {
  position: relative;
  z-index: 3;
  grid-column: 1 / 4;
  height: 5.6rem;
  pointer-events: none;
}

.stack i {
  position: absolute;
  width: 42%;
  height: 58%;
  border: 1px solid var(--teal2);
  background: color-mix(in srgb, var(--teal) 16%, transparent);
}

.stack i:nth-child(1) { left: 0; top: 28%; }
.stack i:nth-child(2) { left: 18%; top: 14%; }
.stack i:nth-child(3) { left: 36%; top: 0; }

.tblock {
  position: relative;
  z-index: 5;
  grid-column: 4 / 13;
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 0.7fr 0.7fr 1.1fr 0.7fr;
  border: 1px solid var(--fg);
}

.tblock .cell {
  margin: 0;
  padding: 0.55rem 0.6rem 0.6rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.tblock .cell:last-child { border-right: 0; }

.tblock .k {
  margin: 0 0 0.28rem;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
}

.tblock p { margin: 0; font-size: 0.72rem; }
.tblock em { color: var(--yellow); font-style: italic; font-weight: 700; }

.tblock .ink {
  display: block;
  width: 100%;
  border: 0;
  border-left: 0;
  background: var(--sel);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tblock .ink:hover { background: color-mix(in srgb, var(--yellow) 18%, var(--sel)); }

.ink-word {
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .sheet { padding: 2.8rem 1.6rem 1.8rem; }
  .gridpaper { inset: 2.8rem 1.6rem 1.8rem; }
  .rows { display: none; }
  .field { grid-column: 1 / -1; }
  .notes { grid-column: 1 / -1; }
  .m01, .m02, .m03, .m04, .elev, .sched, .key, .scale, .stack, .tblock {
    grid-column: 1 / -1;
  }
  .tblock { grid-template-columns: 1fr 1fr 1fr; }
  .tblock .cell { border-bottom: 1px solid var(--line); }
  .galley { grid-template-columns: 1fr; }
  h1 { font-size: clamp(3.4rem, 18vw, 7rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
