@font-face {
  font-family: "NMS Glyphs Mono";
  src: url("./assets/nms-glyphs-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: dark;
  --ink: #071622;
  --surface: #102335;
  --surface-deep: #0a1b2b;
  --line: #33516a;
  --text: #f4f9ff;
  --muted: #a8c0ce;
  --cyan: #64eee9;
  --pink: #f583cc;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 5%, #303151 0, transparent 30%),
    radial-gradient(circle at 14% 90%, #173d50 0, transparent 37%),
    var(--ink);
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }

button:focus-visible, input:focus-visible, .upload-field:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.page-shell { max-width: 1680px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 52px) 48px; }
.masthead {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #ffffff25;
}
.masthead-emblem { width: 72px; height: 72px; object-fit: contain; }
.masthead-title { display: flex; flex-direction: column; gap: 2px; }
.masthead-title strong { font-size: 1.35rem; letter-spacing: .035em; }
.eyebrow { margin: 0; color: var(--cyan); font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.masthead-note {
  margin-left: auto;
  color: var(--muted);
  font-size: .86rem;
  letter-spacing: .05em;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
  gap: clamp(24px, 3.2vw, 56px);
  align-items: start;
  padding-top: 32px;
}
.editor {
  background: linear-gradient(145deg, #152d42, #0d1e30 70%);
  border: 1px solid #ffffff26;
  border-radius: 22px;
  padding: clamp(22px, 2.1vw, 30px);
  box-shadow: 0 24px 64px #0004;
}
.section-heading h1 { margin: 8px 0 6px; font-size: clamp(1.65rem, 2.3vw, 2.1rem); letter-spacing: -.035em; }
.section-heading > p:last-child { color: var(--muted); margin: 0 0 26px; line-height: 1.45; }
.edition-field { margin: 0 0 24px; padding: 0; border: 0; }
.edition-field legend, .field > span { display: block; margin-bottom: 8px; color: #d5e7ef; font-weight: 650; font-size: .91rem; }
.edition-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: #071727;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.edition-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.edition-button.is-active {
  background: linear-gradient(110deg, #a6fff0, #efb0e7);
  color: #0b2230;
  box-shadow: 0 3px 14px #020b16a8;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.field-full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.field input {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 10px 12px;
  color: #f9ffff;
  background: #081929;
  border: 1px solid #3a5a70;
  border-radius: 9px;
  font-size: .96rem;
}
.field input::placeholder { color: #7793a5; }
.field input:hover { border-color: #6aa2ac; }
.field[hidden] { display: none; }
.window-option {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 45px;
  align-self: end;
  padding: 9px 12px;
  border: 1px solid #3a5a70;
  border-radius: 9px;
  background: #081929;
  cursor: pointer;
}
.window-option:hover { border-color: #6aa2ac; }
.window-option[hidden] { display: none; }
.window-option input { width: 19px; height: 19px; margin: 0; flex: none; accent-color: var(--cyan); cursor: pointer; }
.window-option strong, .window-option small { display: block; }
.window-option strong { font-size: .88rem; line-height: 1.3; }
.window-option small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.upload-grid.single-upload { grid-template-columns: 1fr; }
.upload-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px;
  border: 1px dashed #55788a;
  border-radius: 11px;
  background: #10283b;
  cursor: pointer;
  overflow: hidden;
}
.upload-field:hover { border-color: var(--cyan); background: #16354a; }
.upload-field input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.upload-field strong, .upload-field small { display: block; }
.upload-field strong { font-size: .89rem; }
.upload-field small { color: var(--muted); font-size: .73rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 125px; }
.upload-icon { flex: 0 0 28px; color: #a3f5ee; font-size: 1.5rem; text-align: center; }
.scene-framing {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #3a5a70;
  border-radius: 11px;
  background: #0a1c2c;
}
.scene-framing-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.scene-framing-header strong { font-size: .91rem; }
.scene-framing-header button { padding: 4px 0; border: 0; background: none; color: var(--cyan); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.scene-framing-header button:hover { color: white; }
.scene-control { display: block; min-width: 0; }
.scene-control > span { display: flex; justify-content: space-between; gap: 6px; color: #d5e7ef; font-size: .81rem; }
.scene-control output { color: var(--muted); white-space: nowrap; }
.scene-control input { display: block; width: 100%; height: 34px; margin: 3px 0 0; accent-color: var(--cyan); cursor: pointer; }
.scene-pan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 9px; }
.field-note { margin: 12px 0 22px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.actions { display: flex; align-items: center; gap: 15px; }
.download-button {
  border: 0;
  border-radius: 11px;
  padding: 13px 17px;
  color: #09202b;
  background: linear-gradient(105deg, #90f9eb, #d2c4ff 65%, #f29bd7);
  font-weight: 750;
  box-shadow: 0 8px 26px #58dbd236;
}
.download-button:not(:disabled):hover { filter: brightness(1.08); }
.download-button span { margin-left: 6px; font-size: 1.15rem; }
.reset-button { padding: 12px 2px; color: var(--muted); border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.reset-button:hover { color: white; }
.preview { min-width: 0; padding-top: 6px; }
.preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.preview-heading h2 { margin: 7px 0 0; font-size: 1.55rem; font-weight: 600; letter-spacing: -.025em; }
.format-tag { border: 1px solid #526a7e; color: var(--muted); border-radius: 999px; padding: 8px 11px; font-size: .78rem; white-space: nowrap; }
.canvas-frame {
  width: 100%;
  padding: clamp(8px, 1.4vw, 18px);
  border: 1px solid #7ef4e75b;
  border-radius: 21px;
  background: #061523;
  box-shadow: 0 35px 70px #0008, 0 0 48px #38dadd1a;
}
.canvas-frame canvas { display: block; width: 100%; height: auto; border-radius: 9px; background: #081b2c; }
.preview-footnote { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; color: var(--muted); font-size: .79rem; line-height: 1.45; }
@media (max-width: 1040px) {
  .workspace { grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 22px; }
  .editor { padding: 22px; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; padding-top: 22px; }
  .preview { grid-row: 1; }
  .editor { grid-row: 2; max-width: 650px; width: 100%; margin: 0 auto; }
  .masthead { min-height: 96px; }
}
@media (max-width: 540px) {
  .masthead-note, .format-tag { display: none; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .scene-pan-grid { grid-template-columns: 1fr; gap: 8px; }
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .upload-field { gap: 5px; padding: 8px; }
  .upload-icon { flex-basis: 20px; font-size: 1.2rem; }
  .upload-field small { max-width: 90px; }
  .preview-footnote { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .edition-button, .download-button, .upload-field { transition: background .18s ease, color .18s ease, filter .18s ease, border-color .18s ease; }
}
