/* z0glyphic 913 — The Register
 * Sugimoto-catalog aesthetic. IBM Plex Mono + STIX Two Math.
 * Vermillion single-accent. No shadows, no rounded corners, no animations.
 * If you add any of those you are in the wrong codebase.
 */

:root {
  --bg: #f7f5f0;
  --ink: #0a0a0a;
  --rule: #2a2a2a;
  --muted: #6b6b6b;
  --accent: #d64b1a;  /* single vermillion */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background: var(--bg);
}

body {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.5;
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 40px 120px;
  min-height: 100vh;
}

header {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  margin-bottom: 64px;
}

.meta {
  font-size: 0.8125rem;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.meta.date {
  color: var(--muted);
  margin-top: 6px;
}

.meta.small {
  font-size: 0.75rem;
  color: var(--muted);
}

section {
  margin-bottom: 72px;
}

.layer-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.layer-note {
  font-size: 0.8125rem;
  color: var(--ink);
  margin-top: 8px;
  margin-bottom: 32px;
  font-weight: 300;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0;
  margin-top: 24px;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 24px 16px 20px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 180px;
}

.cell:nth-child(6n) {
  border-right: none;
}

.glyph {
  font-family: "STIX Two Math", "Cambria Math", serif;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 12px;
  font-feature-settings: "ss01" on;
}

.meaning {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.phoneme {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 300;
}

/* Operator layer gets the vermillion accent — the only color anywhere.
 * Selector updated to target Layer 0 by its data-glyph values, since the
 * translation surface is now the first section. */
section .cell[data-glyph="⧑"] .glyph,
section .cell[data-glyph="⧓"] .glyph,
section .cell[data-glyph="⧗"] .glyph {
  color: var(--accent);
}

/* Translation surface
 * Chips are typography, not buttons. No border-radius, no hover glow.
 * They read as a list of words that happen to be clickable, not as UI. */
#translation-surface {
  margin-bottom: 96px;
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 32px 0 40px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.chip {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: none;
  border-right: 1px solid var(--rule);
  padding: 14px 20px;
  cursor: pointer;
  letter-spacing: 0;
  transition: none;
}

.chip:last-child {
  border-right: none;
}

.chip:hover {
  background: var(--ink);
  color: var(--bg);
}

.chip.active {
  background: var(--accent);
  color: var(--bg);
}

.output-panel {
  min-height: 160px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: transparent;
}

.output-glyphs {
  font-family: "STIX Two Math", "Cambria Math", serif;
  font-size: 5rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.05em;
  min-height: 80px;
}

.output-word {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

/* When a glyph in the Register is highlighted (because it appears in the
 * currently-translated word), the cell gets a subtle vermillion hairline. */
.cell.highlight {
  background: rgba(214, 75, 26, 0.06);
}

.cell.highlight .glyph {
  color: var(--accent);
}

/* Open translator — text input + submit */
.open-input-row {
  display: flex;
  margin-top: 32px;
  border: 1px solid var(--rule);
}

.translate-input {
  flex: 1;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 14px 20px;
  outline: none;
  letter-spacing: 0;
}

.translate-input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.translate-submit {
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--bg);
  background: var(--ink);
  border: none;
  border-left: 1px solid var(--rule);
  padding: 14px 24px;
  cursor: pointer;
  letter-spacing: 0;
}

.translate-submit:hover {
  background: var(--accent);
}

.translate-submit:disabled {
  background: var(--muted);
  cursor: default;
}

.open-note {
  margin-top: 12px;
  margin-bottom: 0;
}

.output-source {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.output-source.source-err {
  color: var(--accent);
}

/* Active translation log — timeline view of captures */
.nav-back,
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.nav-back:hover,
.nav-link:hover {
  color: var(--accent);
}

.log-entries {
  margin-top: 24px;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.log-glyphs {
  font-family: "STIX Two Math", "Cambria Math", serif;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.04em;
  word-break: break-all;
}

.log-empty {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.log-text {
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.5;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-text-original {
  color: var(--ink);
}

.log-text-readback {
  color: var(--muted);
  font-size: 0.8125rem;
  font-style: italic;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
}

.log-meta-row {
  grid-column: 1 / -1;
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .log-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .log-glyphs {
    font-size: 1.75rem;
  }
}

/* Agents dashboard */
.agent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.agent-card {
  border-right: 1px solid var(--rule);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.agent-card:last-child {
  border-right: none;
}

.agent-name {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.agent-status {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-status.err {
  color: var(--accent);
}

.agent-body {
  font-size: 0.8125rem;
  color: var(--ink);
  line-height: 1.5;
}

.agent-body strong {
  font-weight: 500;
  color: var(--ink);
}

.agent-body code {
  font-family: inherit;
  background: rgba(214, 75, 26, 0.08);
  padding: 1px 4px;
  font-size: 0.75rem;
}

.agent-rec {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  margin-top: auto;
}

.agent-recs {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.agent-recs li {
  font-size: 0.875rem;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.5;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-top: 24px;
}

.history-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
}

.history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  vertical-align: top;
}

.history-table code {
  font-size: 0.6875rem;
}

@media (max-width: 640px) {
  .agent-cards {
    grid-template-columns: 1fr;
  }
  .agent-card {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
}

footer {
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Responsive — stack on narrow screens */
@media (max-width: 640px) {
  body {
    padding: 40px 20px 60px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cell {
    min-height: 140px;
    padding: 16px 12px;
  }
  .cell:nth-child(6n) {
    border-right: 1px solid var(--rule);
  }
  .cell:nth-child(2n) {
    border-right: none;
  }
  .glyph {
    font-size: 3rem;
  }
}
