@font-face {
  font-family: "Moiere Terminus";
  src: url("/static/terminus.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Moiere Fraktur";
  src: url("/static/unifrakturcook.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #090708;
  --panel: #120c10;
  --panel-alt: #0f090d;
  --text: #f0e8eb;
  --muted: #b696a3;
  --blue: #9e5f77;
  --blue-bright: #cf8ea7;
  --blue-dim: rgba(158, 95, 119, 0.34);
  --frame-border: rgba(181, 112, 137, 0.9);
  --frame-glow: rgba(158, 95, 119, 0.2);
  --green: #78a36d;
  --line: rgba(158, 95, 119, 0.14);
  --button-bg: #130c10;
  --shadow-inset: rgba(7, 5, 6, 0.94);
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] {
  --bg: #fffafb;
  --panel: #fff1f6;
  --panel-alt: #fff6f8;
  --text: #1a1115;
  --muted: #8c6a78;
  --blue: #b67d93;
  --blue-bright: #8f526a;
  --blue-dim: rgba(182, 125, 147, 0.3);
  --frame-border: rgba(182, 125, 147, 0.66);
  --frame-glow: rgba(182, 125, 147, 0.1);
  --green: #70956a;
  --line: rgba(182, 125, 147, 0.13);
  --button-bg: #fff0f4;
  --shadow-inset: rgba(255, 255, 255, 0.8);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family:
    "Moiere Terminus",
    "TerminusTTF",
    "Perfect DOS VGA 437",
    "PxPlus IBM VGA 8x16",
    "Cozette",
    "Courier New",
    monospace;
  font-size: 15px;
  line-height: 1.38;
  letter-spacing: 0;
  font-variant-ligatures: none;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: none;
  font-smooth: never;
  padding: 0.85rem 0 2rem;
}

.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;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-dim);
}

a:hover,
a:focus-visible {
  color: var(--blue-bright);
  border-color: var(--blue-bright);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--blue-bright);
  outline-offset: 2px;
}

pre,
code,
input,
select,
textarea,
button {
  font: inherit;
}

pre {
  margin: 0;
}

.node {
  width: min(940px, calc(100vw - 1.25rem));
  margin: 0 auto;
}

.node-issue {
  display: grid;
  gap: 0.85rem;
}

.node-narrow {
  width: min(760px, calc(100vw - 1.25rem));
}

.hero-frame,
.theme-line,
.station-tag,
.slab,
.box,
.headmark {
  border: 1px solid var(--frame-border);
  background: var(--panel-alt);
}

.hero-frame,
.theme-line,
.station-tag,
.headmark,
.box,
.slab {
  box-shadow:
    inset 0 0 0 1px var(--shadow-inset),
    0 0 8px var(--frame-glow);
}

.hero-frame,
.headmark {
  overflow-x: auto;
}

.hero-frame {
  padding: 0.95rem 1rem 1rem;
  color: var(--text);
  line-height: 1.12;
  font-size: clamp(0.8rem, 1.2vw, 0.96rem);
}

.theme-line,
.station-tag,
.headmark {
  padding: 0.55rem 0.9rem;
  color: var(--muted);
}

.theme-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  color: var(--blue);
}

.theme-prefix {
  color: var(--blue);
}

.theme-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.theme-toggle {
  min-width: 0;
  padding: 0.22rem 0.5rem;
  background: var(--panel);
  border: 1px solid var(--blue-dim);
  color: var(--muted);
  text-transform: lowercase;
}

.theme-toggle.is-active {
  color: var(--text);
  border-color: var(--blue);
}

.utility-list {
  display: grid;
  gap: 0.42rem;
}

.utility-row {
  display: grid;
  grid-template-columns: 9ch 2ch minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
}

.utility-label,
.utility-marker {
  color: var(--blue);
}

.utility-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.utility-row a {
  color: var(--text);
  border-bottom-color: var(--blue-dim);
}

.utility-row-mode .theme-options {
  justify-content: flex-start;
}

.station-tag {
  text-align: center;
  color: var(--text);
  font-family:
    "Moiere Fraktur",
    "Old English Text MT",
    "Blackmoor LET",
    "Fette Fraktur",
    "UnifrakturCook",
    "UnifrakturMaguntia",
    "Cloister Black",
    serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.slab,
.box {
  padding: 0.85rem 0.95rem 0.95rem;
}

.slab-label,
.box-title,
.field > span,
.toggle span {
  margin: 0 0 0.7rem;
  color: var(--blue);
  white-space: pre-wrap;
}

.command,
.diag,
.license-copy {
  white-space: pre-wrap;
  word-break: break-word;
}

.command {
  color: var(--text);
  line-height: 1.26;
}

.diag {
  color: var(--text);
  line-height: 1.34;
}

.verse-copy {
  line-height: 1.4;
  color: var(--text);
}

.inline-error {
  margin: 0 0 0.85rem;
  color: var(--blue-bright);
  white-space: pre-wrap;
}

.zine-form,
.form-grid {
  display: grid;
  gap: 0.8rem;
}

.compact-grid {
  gap: 0.7rem;
}

.line-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: stretch;
}

.line-row > * {
  flex: 1 1 16rem;
}

.line-row > .ttl-field {
  flex: 0 0 auto;
}

.line-row-wide > .flag-field {
  flex: 0 1 auto;
}

.line-field,
.field {
  display: grid;
  gap: 0.35rem;
}

.line-field {
  grid-template-columns: 12ch minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.ttl-field {
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: flex-start;
}

.field-wide,
.field-block {
  width: 100%;
}

.field-block {
  grid-template-columns: 1fr;
}

.line-label,
.field > span {
  color: var(--muted);
}

.line-label-block {
  display: block;
}

.flag-field,
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.65rem;
  border: 1px solid var(--blue-dim);
  background: var(--panel);
  color: var(--text);
}

input,
select,
textarea,
button {
  appearance: none;
  width: 100%;
  border-radius: 0;
  border: 1px solid var(--blue-dim);
  background: var(--panel);
  color: var(--text);
  padding: 0.5rem 0.62rem;
  outline: none;
  box-shadow: none;
}

input[type="file"] {
  padding: 0.5rem 0.6rem;
}

input[type="checkbox"] {
  appearance: auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--blue);
}

.ttl-select {
  width: auto;
  min-width: 5.5rem;
  padding-right: 1.85rem;
}

textarea {
  min-height: 15rem;
  resize: vertical;
}

button {
  width: auto;
  min-width: 11rem;
  cursor: pointer;
  background: var(--button-bg);
  text-transform: lowercase;
}

button:hover,
button:focus-visible,
input:hover,
input:focus-visible,
select:hover,
select:focus-visible,
textarea:hover,
textarea:focus-visible,
.flag-field:hover,
.flag-field:focus-within,
.toggle:hover,
.toggle:focus-within {
  border-color: var(--blue-bright);
}

.action-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.action-note,
.muted,
.micro-status {
  color: var(--muted);
}

.subline,
.muted {
  margin: 0;
}

.donation-note {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.38;
  white-space: pre-wrap;
}

.source-link {
  color: var(--text);
  border-bottom-color: var(--blue-dim);
}

.source-pulse {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--blue-bright);
  opacity: 0.42;
  animation: source-pulse 2.8s ease-in-out infinite;
}

.rid-value {
  display: inline-block;
  user-select: all;
  overflow-wrap: anywhere;
}

.donation-address {
  min-height: 4rem;
  padding: 0.64rem 0.72rem;
  border: 1px solid var(--blue-dim);
  background: var(--panel);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.32;
}

.micro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.micro-button {
  min-width: 0;
  padding: 0.34rem 0.66rem;
}

.status-lamp {
  color: var(--green);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes source-pulse {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.62;
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-pulse,
  .status-lamp {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
    padding-top: 0.55rem;
  }

  .node,
  .node-narrow {
    width: min(100vw - 0.75rem, 100%);
  }

  .hero-frame,
  .theme-line,
  .station-tag,
  .headmark,
  .slab,
  .box {
    padding-left: 0.72rem;
    padding-right: 0.72rem;
  }

  .line-field {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .action-row,
  .actions,
  .micro-actions {
    align-items: stretch;
  }

  button:not(.theme-toggle),
  .micro-button {
    width: 100%;
  }

  .theme-line {
    align-items: stretch;
  }

  .theme-options {
    width: 100%;
  }

  .utility-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}
