/* Light lavender theme with deep-violet/magenta accents, a dark graphite
   header band, slab-serif headings, and a graph-paper motif — deliberately
   distinct from the other icarm sites: elliptic-rank (light teal, serif),
   ruzsa-genus-one (dark indigo, amber), eq677 (blue-cast light, cobalt),
   and matroid-correlation-constants (warm paper, teal + rust). */
:root {
  --bg: #f6f4fa;           /* very light lavender */
  --grid-line: #e8e3f2;    /* graph-paper ruling */
  --fg: #24222e;           /* graphite ink */
  --muted: #6a657d;
  --accent: #6d28d9;       /* deep violet */
  --accent-dark: #5b21b6;
  --accent-soft: #ede6fa;
  --border: #dcd6ea;
  --panel: #fdfcff;        /* cards, inputs */
  --panel-soft: #efecf6;
  --code-bg: #ece8f4;
  --header-bg: #201d29;    /* near-black graphite header band */
  --header-fg: #efedf5;
  --header-muted: #a49fb8;
  --ok: #23703d;
  --ok-bg: #e0efe4;
  --bad: #b0244a;
  --bad-bg: #f7e1e8;
  --mono: "Iosevka", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, monospace;
  --slab: "Rockwell", "Roboto Slab", "Zilla Slab", "Courier New", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.6;
  /* graph paper */
  background: linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 100%,
    var(--bg);
}

a {
  color: var(--accent-dark);
}
a:hover {
  color: var(--accent);
}

code {
  font-family: var(--mono);
  background: var(--code-bg);
  padding: 0.05em 0.3em;
  border-radius: 3px;
  font-size: 0.92em;
}

.muted {
  color: var(--muted);
}
.nowrap {
  white-space: nowrap;
}
.math {
  font-style: italic;
}

/* ---------------- header ---------------- */

header {
  background: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 4px solid var(--accent);
}

header .inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.05rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--slab);
  letter-spacing: 0.02em;
}

header h1 a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}
header h1 a:hover {
  color: #fff;
}

/* two adjacent unequal blocks — the thing the words avoid */
.logo-blocks {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 0.95em;
  transform: translateY(0.08em);
}
.logo-blocks span {
  width: 0.42em;
  background: var(--accent);
  display: inline-block;
}
.logo-blocks span:first-child {
  height: 62%;
}
.logo-blocks span:last-child {
  height: 100%;
  background: #d6336c;
}

header nav {
  font-size: 0.92rem;
}
header nav a {
  color: var(--header-muted);
  text-decoration: none;
}
header nav a:hover {
  color: var(--header-fg);
}
.auth-nav {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
}
.auth-user {
  font-weight: 600;
}
.auth-logout {
  display: inline;
  margin: 0;
}
.auth-logout button {
  background: none;
  border: none;
  color: var(--header-muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.auth-logout button:hover {
  color: var(--header-fg);
}

/* ---------------- layout ---------------- */

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 3rem;
}

section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.3rem 1.6rem;
  margin: 1.2rem 0;
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.06);
}

h2 {
  font-family: var(--slab);
  font-size: 1.25rem;
  margin: 0.1rem 0 0.8rem;
  letter-spacing: 0.01em;
}
h3 {
  font-family: var(--slab);
  font-size: 1.02rem;
  margin: 1.4rem 0 0.5rem;
}

footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-links {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
footer a {
  color: var(--muted);
}
footer a:hover {
  color: var(--accent-dark);
}

/* ---------------- hero ---------------- */

.hero p {
  max-width: 62rem;
}
.ex {
  white-space: nowrap;
}

/* ---------------- plot ---------------- */

.size-filter {
  margin: 0.2rem 0 0.6rem;
  font-size: 0.92rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.size-filter .current {
  font-weight: 700;
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent);
}

.record-plot {
  width: 100%;
  height: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.record-plot .grid {
  stroke: var(--grid-line);
  stroke-width: 1;
}
.record-plot .axis {
  stroke: var(--fg);
  stroke-width: 1.4;
}
.record-plot .tick {
  font-size: 12px;
  fill: var(--muted);
}
.record-plot .axis-title {
  font-size: 13px;
  fill: var(--fg);
}
.record-plot .guide {
  stroke: var(--muted);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
  opacity: 0.65;
}
.record-plot .guide-label {
  font-size: 12px;
  fill: var(--muted);
  font-style: italic;
}
.record-plot .dot {
  stroke: rgba(35, 38, 47, 0.55);
  stroke-width: 1;
  opacity: 0.92;
}
.record-plot a:hover .dot {
  stroke: var(--fg);
  stroke-width: 2;
}
.record-plot .dot.s3 {
  fill: #b4b7c6;
}
.record-plot .dot.s4 {
  fill: #83879a;
}
.record-plot .dot.s5 {
  fill: var(--accent);
}
.record-plot .dot.s6 {
  fill: #d6336c;
}
.record-plot .dot.s7 {
  fill: #0b7285;
}
.plot-caption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.plot-empty {
  padding: 1.5rem 0;
}

/* ---------------- tables ---------------- */

.table-scroll {
  overflow-x: auto;
}

table.records {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8rem 0;
  font-size: 0.94rem;
}
table.records th,
table.records td {
  text-align: left;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
table.records thead th {
  font-family: var(--slab);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--fg);
}
table.records th.sorted {
  color: var(--accent-dark);
}
table.records td.num,
table.records th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.records tr:hover td {
  background: var(--panel-soft);
}
table.records tr.revoked td {
  opacity: 0.55;
}

.alphabet-link {
  font-family: var(--mono);
  font-size: 0.92em;
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-dark);
}

.status {
  font-size: 0.82rem;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}
.status.open {
  background: var(--ok-bg);
  color: var(--ok);
}
.status.closed {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ---------------- submit form ---------------- */

.submit-help {
  font-size: 0.94rem;
}
.submit label {
  display: block;
  font-family: var(--slab);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.submit textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--fg);
  resize: vertical;
}
.submit textarea:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.submit-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

button,
.login-cta {
  font: inherit;
  font-family: var(--slab);
  font-size: 0.92rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.login-cta:hover {
  background: var(--accent-dark);
  color: #fff;
}
button.danger {
  background: transparent;
  color: var(--bad);
  border: 1px solid var(--bad);
  padding: 0.15rem 0.6rem;
  font-size: 0.82rem;
}
button.danger:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

/* ---------------- submission result ---------------- */

.result.accepted {
  border-left: 5px solid var(--ok);
}
.result.rejected {
  border-left: 5px solid var(--bad);
}
.errors {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 4px;
  padding: 0.7rem 1rem 0.7rem 2rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.record-banner {
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  background: var(--panel-soft);
}
.record-banner.new,
.record-banner.improved {
  background: var(--ok-bg);
}
.record-banner.reopened {
  background: var(--bad-bg);
}

/* ---------------- alphabet detail ---------------- */

.alphabet-meta {
  color: var(--muted);
}
.status-line {
  padding: 0.5rem 0.8rem;
  background: var(--panel-soft);
  border-radius: 4px;
  font-size: 0.94rem;
}

.lipschitz-graph {
  width: 100%;
  height: auto;
  background: linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 100%,
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.lipschitz-graph polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.word-block {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history {
  padding-left: 1.2rem;
}

/* ---------------- activity ---------------- */

.activity {
  list-style: none;
  padding: 0;
}
.activity li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.pager {
  margin-top: 1rem;
}

/* ---------------- api docs ---------------- */

.code-block {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--header-bg);
  color: var(--header-fg);
  border-radius: 5px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
}

/* ---------------- profile ---------------- */

.name-form,
.token-form {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.6rem 0 1rem;
}
.name-form label {
  font-family: var(--slab);
  font-size: 0.9rem;
}
.name-form input,
.token-form input {
  font: inherit;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--fg);
}
.token-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.7rem 1rem;
  margin: 0.6rem 0;
  overflow-wrap: anywhere;
}

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  header .inner {
    flex-direction: column;
    gap: 0.3rem;
  }
  main {
    padding: 1rem 0.8rem 2rem;
  }
  section {
    padding: 1rem;
  }
}
