:root {
  color-scheme: dark;
  --bg: #060504;
  --paper: #e8dcc3;
  --ink: #15130f;
  --panel: rgba(18, 17, 14, .92);
  --line: rgba(232, 220, 195, .22);
  --text: #f4ead6;
  --muted: #b8ab93;
  --amber: #efbf6a;
  --red: #ff6d5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 70% 12%, rgba(255, 109, 93, .12), transparent 26%), var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

a { color: inherit; }
.type-header, .type-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(5, 4, 3, .86);
  border-bottom: 1px solid var(--line);
}
.type-footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--amber); color: var(--amber); }
.brand strong, .brand small { display: block; }
.brand small, .kicker, .surface-overlay small { color: var(--muted); text-transform: uppercase; font-size: 12px; }
.type-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.type-nav a { text-decoration: none; }

main { padding: clamp(28px, 8vw, 92px) clamp(14px, 4vw, 48px); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}
h1 { margin: 6px 0 14px; font-size: clamp(40px, 7.4vw, 82px); line-height: .95; }
h2 { margin: 0; font-size: clamp(20px, 3vw, 28px); }
p { line-height: 1.75; }
p span, h2 span, h2 small { display: block; }

.status-card, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 21, 16, .95), rgba(8, 7, 5, .95));
  border-radius: 8px;
  box-shadow: inset 0 0 32px rgba(239, 191, 106, .05);
}
.status-card { display: grid; gap: 12px; padding: 18px; color: var(--muted); }
.status-card span + span { border-top: 1px dashed rgba(244, 234, 214, .14); padding-top: 12px; }
.machine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  gap: 18px;
}
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 16px; }
.canvas-shell { position: relative; border: 1px solid rgba(244, 234, 214, .2); background: #070604; overflow: hidden; }
canvas { display: block; width: 100%; height: min(58vw, 520px); min-height: 320px; }
#typeInput {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 58px;
  width: calc(100% - 36px);
  min-height: 84px;
  resize: vertical;
  border: 1px solid rgba(239, 191, 106, .35);
  background: rgba(10, 8, 5, .74);
  color: var(--text);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  line-height: 1.55;
}
.surface-overlay {
  position: absolute;
  left: 18px;
  top: 16px;
  display: grid;
  gap: 4px;
  pointer-events: none;
}
.control-stack { display: grid; gap: 14px; align-content: start; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(244, 234, 214, .22);
  background: rgba(44, 38, 28, .86);
  color: var(--text);
  font: inherit;
  border-radius: 6px;
  cursor: pointer;
}
button.primary { background: var(--amber); color: #140d05; font-weight: 800; }
.meter-stack { display: grid; gap: 18px; }
.meter-stack label { display: grid; grid-template-columns: 76px 1fr 42px; gap: 10px; align-items: center; font-size: 13px; }
meter { width: 100%; }
.mini-copy { color: var(--muted); }
.notes-panel {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 24px;
  margin-top: 28px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}
.notes-panel small { color: var(--muted); margin-top: 6px; }

@media (max-width: 820px) {
  .type-header, .hero, .machine-layout, .notes-panel { grid-template-columns: 1fr; }
  .type-header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: clamp(36px, 13vw, 58px); overflow-wrap: anywhere; }
  .panel-head { display: block; }
  .button-grid { grid-template-columns: 1fr; }
  canvas { height: 430px; min-height: 330px; }
  #typeInput { bottom: 48px; }
}
