@font-face {
  font-family: "Noto Sans Mono";
  src: url("assets/fonts/NotoSansMono-Variable.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --field: #f5f1e8;
  --paper: #fffdf8;
  --ink: #181917;
  --muted: #6f716a;
  --line: #c9c4b8;
  --faint: #e8e3d8;
  --green: #456858;
  --mint: #b8e3ce;
  --amber: #c4862d;
  --blue: #53758b;
  --red: #9a5345;
  --shadow: rgba(24, 25, 23, .12);
  --terminal-font: "Noto Sans Mono", "Courier New", monospace;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--field);
  color: var(--ink);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--field);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(111, 113, 106, .12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(111, 113, 106, .1) 1px, transparent 1px),
    var(--field);
  background-size: 84px 84px;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.mono,
.eyebrow,
.system-line,
.console-log,
.console-form {
  font-family: var(--terminal-font);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  min-height: 92px;
  padding: 18px clamp(20px, 3.5vw, 56px);
  border-bottom: 1px solid var(--ink);
  background: rgba(245, 241, 232, .92);
}

.mark {
  width: max-content;
  font-size: clamp(29px, 3vw, 47px);
  font-weight: 800;
  line-height: .86;
  text-decoration: none;
}

.mark span {
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
}

.system-line {
  justify-self: end;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
  text-transform: uppercase;
}

.system-line::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(69, 104, 88, .12);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-transform: uppercase;
}

h1 {
  max-width: 6ch;
  margin: clamp(64px, 11vh, 140px) 0 0;
  font-size: clamp(4.7rem, 10vw, 10.5rem);
  font-weight: 760;
  line-height: .78;
  letter-spacing: 0;
}

/* Console */
.console-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #5f625c;
  color: #aeb2aa;
  font-size: 10px;
  text-transform: uppercase;
}

.console-head span:last-child { color: var(--mint); }

.console-log {
  align-self: center;
  min-height: 340px;
  max-width: 760px;
  padding: 50px 0;
  font-size: clamp(.95rem, 1.4vw, 1.15rem);
  line-height: 1.8;
}

.console-log p { margin: 0 0 18px; }
.console-log .system { color: var(--mint); }
.console-log .echo { color: #8c9087; }
.console-log .room-result { font-family: Arial, Helvetica, sans-serif; font-size: clamp(2.2rem, 5vw, 5.4rem); font-weight: 700; line-height: .9; }

.console-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid #5f625c;
}

.console-form label { color: var(--mint); }

.console-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Console shell */
.console-page {
  height: 100svh;
  overflow: hidden;
}

.console-page .site-header {
  height: 92px;
  grid-template-columns: 1fr auto;
}

.console-page .status-counts { min-width: 150px; }
.console-page .status-counts span { display: inline; }

.console-frame {
  position: relative;
  height: calc(100svh - 136px);
  min-height: 520px;
  overflow: hidden;
}

.console-intro {
  position: absolute;
  z-index: 3;
  inset: 0 auto 0 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(42px, 7vw, 112px) clamp(24px, 5vw, 80px);
  border-right: 1px solid transparent;
  background: var(--field);
  text-align: center;
  transition: width .95s cubic-bezier(.72, 0, .18, 1), padding .95s cubic-bezier(.72, 0, .18, 1), border-color .2s linear .75s, transform .75s cubic-bezier(.72, 0, .18, 1), opacity .45s ease;
}

.console-intro .intro-lockup { width: 100%; }
.console-intro h1 { max-width: none; margin: 0; animation: ready-sequence 2.05s ease both; }
.console-intro h1 span { display: inline-block; }
.console-intro .eyebrow,
.console-intro .subline { opacity: 0; transform: translateY(8px); transition: opacity .4s ease 1.05s, transform .4s ease 1.05s; }

.console-page.is-ready .console-intro {
  width: 39%;
  justify-content: flex-start;
  border-color: var(--ink);
  text-align: left;
}

.console-page.is-ready .console-intro h1 {
  max-width: 6ch;
  animation: none;
}

.console-page.is-ready .console-intro h1 span {
  display: block;
  width: max-content;
}

.console-page.is-ready .console-intro .eyebrow,
.console-page.is-ready .console-intro .subline { opacity: 1; transform: translateY(0); }
.console-page.is-ready .console-intro .eyebrow { margin-bottom: clamp(38px, 7vh, 84px); }

.console-shell {
  position: absolute;
  inset: 0 0 0 39%;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(28px, 4vw, 64px);
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: translateX(50px);
  transition: opacity .5s ease .75s, transform .72s cubic-bezier(.2, .75, .2, 1) .75s;
}

.console-page.is-ready .console-shell { opacity: 1; transform: translateX(0); }
.console-page.lights-low .console-intro {
  background: #222520;
  color: var(--paper);
}
.console-page.lights-low .console-intro .eyebrow { color: #aeb2aa; }
.console-body { align-self: center; min-width: 0; }
.console-shell .console-log { min-height: 180px; max-width: none; padding: 26px 0; }

.console-shell .console-body {
  width: min(100%, 760px);
  justify-self: center;
}

.console-shell .console-log:empty {
  min-height: 0;
  padding: 0;
}

.console-shell .console-log:not(:empty) {
  min-height: 130px;
  padding: 0 0 34px;
}

.console-shell .console-log .directory-output {
  white-space: pre-wrap;
  color: var(--paper);
  line-height: 2;
}

.console-shell .console-form {
  grid-template-columns: auto 1fr;
  width: 100%;
  padding: 18px 0;
  border-top: 1px solid #5f625c;
  border-bottom: 1px solid #5f625c;
}

.console-shell .console-form input {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  caret-color: var(--mint);
}

.command-entry {
  position: relative;
  display: block;
  min-width: 0;
}

.command-entry input { position: relative; z-index: 1; }
.command-entry:not(.has-value) input { caret-color: transparent; }

.block-cursor {
  position: absolute;
  z-index: 2;
  left: 1px;
  top: 50%;
  width: 9px;
  height: 1.2em;
  background: var(--mint);
  pointer-events: none;
  transform: translateY(-50%);
  animation: terminal-cursor .9s steps(1, end) infinite;
}

.command-entry.has-value .block-cursor { display: none; }

.level-keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #5f625c;
}

.level-keys button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  min-height: 55px;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #5f625c;
  border-bottom: 1px solid #5f625c;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.level-keys button:nth-child(2n) { border-right: 0; }
.level-keys button span { color: var(--mint); font: 10px var(--terminal-font); }
.level-keys button:hover,
.level-keys button:focus-visible { background: #292b28; outline: none; }

.console-footer {
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(18px, 3.5vw, 56px);
  border-top: 1px solid var(--ink);
  background: var(--field);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.console-footer > span:last-child { justify-self: end; }
.console-footer .strapline { color: var(--ink); }

.who-terminal {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: max-height .45s cubic-bezier(.2, .8, .2, 1), opacity .18s linear, margin .45s ease, visibility 0s linear .45s;
}

.console-body.who-active .who-terminal {
  max-height: min(56vh, 560px);
  margin-bottom: 18px;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.console-body.who-active .console-log { display: none; }

.who-image-wrap {
  position: relative;
  width: 100%;
  max-height: min(49vh, 490px);
  overflow: hidden;
  opacity: 1;
  transition: max-height .42s cubic-bezier(.72, 0, .18, 1), opacity .18s linear;
}

.who-image-wrap img {
  display: block;
  width: 100%;
  height: min(49vh, 490px);
  object-fit: contain;
  filter: grayscale(1) contrast(1.08);
  mix-blend-mode: screen;
}

.who-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 44.2% 27%, rgba(255, 26, 18, .92) 0 1px, rgba(205, 12, 8, .56) 2px, transparent 14px),
    radial-gradient(circle at 55.8% 27%, rgba(255, 26, 18, .92) 0 1px, rgba(205, 12, 8, .56) 2px, transparent 14px);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.who-terminal.is-pulsing .who-image-wrap {
  animation: who-inline-pulse .34s steps(2, end) 3;
}

.who-terminal.is-red .who-image-wrap::after {
  animation: who-red-eyes .34s ease 1;
}

.who-inline-message {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  max-height: 0;
  margin: 0;
  overflow: visible;
  opacity: 0;
  color: var(--mint);
  font: 400 clamp(.8rem, 1.75vw, 1.55rem)/2.8 var(--terminal-font);
  letter-spacing: 0;
  text-align: center;
  white-space: pre;
  transform: translateY(3px);
  transition: max-height .32s ease, opacity .18s linear .08s, transform .32s ease;
}

.who-terminal.is-message .who-image-wrap {
  display: none;
}

.who-terminal.is-message {
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: min(49vh, 490px);
}

.who-terminal.is-message .who-inline-message {
  align-self: center;
  max-height: none;
  opacity: 1;
  transform: translateY(0);
}

@keyframes who-inline-pulse {
  0% { opacity: .96; transform: translate(0, 0) scale(1); filter: none; }
  30% { opacity: .54; transform: translate(-4px, 1px) scale(1.012); filter: contrast(1.45); }
  60% { opacity: 1; transform: translate(3px, -1px) scale(.995); filter: contrast(1.15); }
  100% { opacity: .82; transform: translate(0, 0) scale(1); filter: none; }
}

@keyframes who-red-eyes {
  0%, 100% { opacity: 0; }
  35%, 70% { opacity: 1; }
}

.room-stage {
  --room-accent: var(--mint);
  position: absolute;
  z-index: 8;
  inset: 0;
  overflow: hidden;
  background: var(--room-accent);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .82s cubic-bezier(.72, 0, .18, 1), visibility 0s linear .82s, background .4s ease;
}

.console-page.room-open .room-stage {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}

.room-grid {
  position: absolute;
  inset: 0;
  opacity: .2;
  background:
    linear-gradient(90deg, var(--ink) 1px, transparent 1px),
    linear-gradient(0deg, var(--ink) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(90deg, #000, transparent 76%);
}

.room-project {
  position: absolute;
  z-index: 2;
  inset: 0 48px 0 0;
  width: calc(100% - 48px);
  height: 100%;
  border: 0;
  background: var(--paper);
}

.room-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(42px, 7vw, 100px) clamp(70px, 10vw, 160px);
}

.room-content h2 {
  max-width: 9ch;
  margin: auto 0;
  font-size: clamp(4.5rem, 12vw, 13rem);
  line-height: .78;
  letter-spacing: 0;
}

.room-content > p:last-child {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.55;
}

.terminal-rail {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border: 0;
  border-left: 1px solid #5f625c;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font: 9px var(--terminal-font);
  text-transform: uppercase;
}

.terminal-rail span:nth-child(2) { writing-mode: vertical-rl; transform: rotate(180deg); }
.terminal-rail:hover,
.terminal-rail:focus-visible { color: var(--mint); outline: none; }

.terminal-drawer {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 48px;
  bottom: 0;
  width: min(440px, calc(100% - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 24px;
  background: var(--ink);
  color: var(--paper);
  transform: translateX(calc(100% + 48px));
  transition: transform .45s cubic-bezier(.72, 0, .18, 1);
}

.room-stage.drawer-open .terminal-drawer { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #5f625c;
  color: var(--mint);
  font-size: 10px;
  text-transform: uppercase;
}

.drawer-head button {
  width: 36px;
  height: 36px;
  border: 1px solid #5f625c;
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 24px;
}

.drawer-output {
  align-self: center;
  color: var(--mint);
  line-height: 1.7;
  white-space: pre-wrap;
}

.drawer-form {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid #5f625c;
  font: 13px var(--terminal-font);
}

.drawer-form label { color: var(--mint); }
.drawer-form input { min-width: 0; border: 0; background: transparent; color: var(--paper); outline: none; }

.return-button {
  min-height: 42px;
  border: 1px solid #5f625c;
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  font-size: 9px;
  text-transform: uppercase;
}

.return-button:hover,
.return-button:focus-visible { border-color: var(--mint); color: var(--mint); outline: none; }

@keyframes ready-sequence {
  0% { opacity: 0; transform: translateY(8px); }
  18% { opacity: 1; transform: translateY(0); }
  30% { opacity: .32; }
  39% { opacity: 1; }
  50% { opacity: .48; }
  59%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes terminal-cursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (max-width: 900px) {
  .console-page .site-header { height: 132px; }
  .console-frame { height: calc(100svh - 176px); min-height: 500px; }
  .console-intro { padding: 34px 28px; }
  .console-page.is-ready .console-intro { width: 38%; }
  .console-intro h1 { font-size: clamp(3.5rem, 8vw, 6.5rem); }
  .console-shell { left: 38%; padding: 28px; }
}

@media (max-width: 600px) {
  .console-frame { min-height: 520px; }
  .console-intro { width: 100%; border-right: 0; }
  .console-page.is-ready .console-intro { width: 100%; transform: translateY(-100%); opacity: 0; pointer-events: none; }
  .console-shell { inset: 0; padding: 28px 18px; transform: none; transition: opacity .45s ease 1s; }
  .console-page.is-booting .console-shell { opacity: 0; }
  .console-shell .console-log { min-height: 145px; }
  .level-keys { grid-template-columns: 1fr; }
  .level-keys button,
  .level-keys button:nth-child(2n) { border-right: 0; }
  .room-content { padding: 38px 68px 38px 24px; }
  .room-content h2 { font-size: clamp(4rem, 20vw, 7rem); }
  .console-footer span:last-child { display: none; }
  .console-body.who-active .who-terminal { max-height: min(54vh, 450px); }
  .who-image-wrap,
  .who-image-wrap img { height: min(45vh, 380px); }
  .who-inline-message { font-size: clamp(.62rem, 2.8vw, .78rem); }
}

@media (prefers-reduced-motion: reduce) {
  .console-intro h1 { animation: none; }
  .block-cursor { animation-duration: 1.6s; }
  .who-terminal.is-pulsing .who-image-wrap,
  .who-terminal.is-red .who-image-wrap::after { animation: none; }
}
