@font-face {
  font-family: "SYM Montserrat";
  src: url("assets/fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SYM Montserrat";
  src: url("assets/fonts/Montserrat-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "SYM Montserrat", sans-serif;
  font-synthesis: none;
  background: #1c1c1e;
  color: #e9e8e5;
  --muted: #92918f;
  --line-height: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 280px; min-height: 100%; }
body { min-height: 100svh; }
button { font: inherit; }
::selection { background: #514b2f; color: #fff; }

.page {
  width: min(100% - 112px, 1280px);
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.masthead {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.identity { display: flex; align-items: center; gap: 16px; }
.brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; }
.edition { font-size: 11px; letter-spacing: .06em; color: var(--muted); }

.editor { min-height: 0; flex: 1; display: flex; flex-direction: column; border-block: 1px solid #39383a; }
.editor-heading { height: 62px; flex: 0 0 62px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-inline: 4px; font-size: 11px; color: var(--muted); }
.file-name { color: #c3c0b9; display: flex; align-items: center; gap: 14px; }
.file-symbol { font-family: monospace; color: #d6b956; font-size: 14px; }
.language { font-size: 10px; letter-spacing: .06em; }

.code-viewport { height: clamp(300px, calc(100svh - 322px), 920px); overflow: hidden; padding: 12px 0 16px; scroll-behavior: auto; overscroll-behavior: contain; }
body[data-motion="paused"] .code-viewport { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #666468 transparent; }
.code-lines { padding-bottom: 2px; }
.code-line { display: grid; grid-template-columns: 55px minmax(0, 1fr); align-items: start; line-height: var(--line-height); min-height: var(--line-height); }
.line-number { color: #666468; padding-left: 4px; font-size: 11px; font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; user-select: none; font-variant-numeric: tabular-nums; }
.code-line code { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: clamp(13px, 1.22vw, 17px); letter-spacing: -.15px; color: #d3d0ce; font-weight: 400; }
.comment { color: #838781; }
.keyword { color: #b6a2c5; }
.string { color: #b8bca5; }
.number { color: #d4b779; }
.function { color: #a9bbc6; }
.code-monkey { width: 1.32em; height: 1.32em; display: inline-block; vertical-align: -.31em; margin-inline: .13em; object-fit: contain; }
.active-line code::after { content: ""; display: inline-block; width: 1.5px; height: 1.12em; background: #ffca00; vertical-align: -.18em; margin-left: 2px; }
body[data-motion="running"] .active-line code::after { animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.editor-footer { margin-top: auto; min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 10px; color: var(--muted); }
.session-label { display: flex; align-items: center; gap: 10px; letter-spacing: .02em; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #ffca00; margin-inline: 4px; }
body[data-motion="paused"] .status-dot { background: #92918f; }
.session-separator { margin-inline: 3px; color: #666468; }
.loop-count { font-variant-numeric: tabular-nums; }
.motion-control { min-height: 44px; min-width: 82px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; background: none; border: 0; color: #aaa8a4; cursor: pointer; padding: 8px 4px 8px 12px; font-size: 11px; }
.motion-control[hidden] { display: none; }
.motion-control:hover { color: #fff; }
.motion-control:focus-visible { outline: 1px solid #ffca00; outline-offset: 3px; }
.control-icon { width: 8px; height: 9px; border-inline: 2px solid currentColor; }
body[data-motion="paused"] .control-icon { width: 0; height: 0; border: 0; border-left: 7px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.page-footer { min-height: 68px; display: flex; align-items: center; justify-content: space-between; color: #85827f; font-size: 10px; letter-spacing: .025em; }
.infinity { font: 21px Georgia, serif; color: #99958d; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-height: 1100px) { .editor { flex: 0; } .page-footer { margin-top: auto; } }
@media (max-width: 700px) {
  :root { --line-height: 29px; }
  .page { width: calc(100% - 44px); }
  .masthead { min-height: 101px; }
  .brand-mark { width: 30px; height: 30px; }
  .identity { gap: 12px; }
  .edition { display: none; }
  .editor-heading { height: 53px; flex-basis: 53px; }
  .code-viewport { height: calc(100svh - 270px); min-height: 260px; padding-top: 8px; }
  .code-line { grid-template-columns: 37px minmax(0, 1fr); }
  .code-line code { font-size: 12px; letter-spacing: -.2px; }
  .line-number { font-size: 9px; padding-left: 1px; }
  .editor-footer { min-height: 59px; }
  .page-footer { min-height: 57px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-motion="running"] .active-line code::after { animation: none; }
  .code-viewport { scroll-behavior: auto; }
}
