:root {
  --bg: #eef0ec;
  --surface: #ffffff;
  --border: #d9dbd3;
  --text: #1b1d22;
  --text-muted: #5b606b;
  --accent: #2c3a63;
  --accent-bright: #46599a;
  --accent-contrast: #ffffff;
  --seal: #8b2e3a;
  --seal-soft: #8b2e3a14;
  --danger: #ae2f3d;
  --success: #2e7d32;
  --unread-bg: #e4e8fa;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L",
    "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --surface: #1b1e24;
    --border: #2c3038;
    --text: #e6e8ee;
    --text-muted: #9aa0ac;
    --accent: #93a6e3;
    --accent-bright: #b3c0ee;
    --accent-contrast: #10131a;
    --seal: #c4636f;
    --seal-soft: #c4636f26;
    --danger: #d97b85;
    --success: #58c46a;
    --unread-bg: #202849;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.navbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--text);
}
.navbar .brand:hover { text-decoration: none; }
.navbar nav { display: flex; align-items: center; gap: 1.5rem; font-size: 0.94rem; }
.navbar .btn-primary { padding: 0.5rem 1.1rem; }

/* --- marketing (home) page: the one editorial moment in the app --- */
.marketing { font-family: var(--serif); }
.marketing .eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}
.marketing h1, .marketing h2, .marketing h3 { text-wrap: balance; font-weight: 500; }
.marketing em { font-style: italic; color: var(--accent); }

.hero { padding: 4.5rem 0 3rem; }
.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 760px) {
  .hero-split { grid-template-columns: 1fr; text-align: left; }
  .hero-seal { order: -1; width: 110px; margin-bottom: 0.5rem; }
}
.hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.1; margin: 0; }
.hero p.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 46ch; margin: 1.2rem 0 0; }
.hero-actions { display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 1.8rem; font-family: var(--sans); }
.hero-seal { width: 190px; justify-self: center; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.12)); }
@media (prefers-color-scheme: dark) {
  .hero-seal { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.4)); }
}

.section-rule { border-top: 1px solid var(--border); padding: 3.2rem 0; }
.section-head { max-width: 56ch; margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); margin: 0.3rem 0 0; }
.section-head p { color: var(--text-muted); margin-top: 0.7rem; }

/* manifest: ledger-style feature rows, used on the home page in place of icon cards */
.manifest { display: flex; flex-direction: column; }
.manifest-row {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.6rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.manifest-row:last-child { border-bottom: 1px solid var(--border); }
@media (max-width: 640px) {
  .manifest-row { grid-template-columns: 1fr; gap: 0.4rem; }
}
.manifest-row dt { font-family: var(--sans); font-weight: 600; font-size: 0.98rem; margin: 0; }
.manifest-row .tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--seal);
  margin-top: 0.35rem;
}
.manifest-row dd { margin: 0; color: var(--text-muted); font-size: 1.02rem; }

/* security compare table */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare > div { padding: 1.6rem; }
.compare > div + div { border-left: 1px solid var(--border); }
@media (max-width: 640px) {
  .compare > div + div { border-left: none; border-top: 1px solid var(--border); }
}
.compare h3 {
  font-family: var(--sans);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}
.compare.--zk h3 { color: var(--seal); }
.compare ul { margin: 0; padding: 0; list-style: none; font-family: var(--sans); font-size: 0.95rem; }
.compare li { padding: 0.55rem 0; border-top: 1px solid var(--border); }
.compare li:first-child { border-top: none; }
.compare-note { color: var(--text-muted); font-size: 0.94rem; margin-top: 1.1rem; font-family: var(--sans); }

/* architecture diagram + spec strip */
.diagram { display: flex; flex-direction: column; align-items: center; font-family: var(--sans); font-size: 0.85rem; }
.diagram .protocols { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.diagram .chip { border: 1px solid var(--border); background: var(--surface); padding: 0.6rem 1rem; border-radius: 4px; color: var(--text); }
.diagram .stem { width: 1px; height: 30px; background: var(--border); }
.diagram .store {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 1rem 1.6rem;
  border-radius: 4px;
  text-align: center;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.diagram .store strong { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--text); }
.diagram .store span { font-size: 0.78rem; }

.spec {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.3rem 1.5rem;
  line-height: 2;
  overflow-x: auto;
  white-space: pre;
}
.spec b { color: var(--text); font-weight: 600; }
.spec .rfc { color: var(--seal); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.feature-card h3 { margin-top: 0; font-size: 1.05rem; }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0; }

.pricing-section { padding: 3rem 0 5rem; font-family: var(--sans); }
.pricing-section h2 { text-align: center; font-size: 1.9rem; margin-bottom: 0.5rem; font-family: var(--serif); font-weight: 500; }
.pricing-section .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
}
.plan-card h3 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.plan-price { font-size: 2rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.plan-price span { font-size: 0.95rem; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 1.5rem; color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.plan-features li { padding: 0.35rem 0; border-top: 1px solid var(--border); }
.plan-features li:first-child { border-top: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card .hint { color: var(--text-muted); font-size: 0.88rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.3rem; }
.stat-box .label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-box .value { font-size: 1.6rem; font-weight: 700; margin-top: 0.2rem; font-variant-numeric: tabular-nums; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 68px); padding: 2rem 1rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.3rem; margin-top: 0; font-family: var(--serif); font-weight: 500; }
.auth-card .switch { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.link-btn { background: none; border: none; color: var(--accent-bright); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

form label { display: block; margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-muted); }
form input[type=text], form input[type=email], form input[type=password], form select, form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.checkbox-label { display: flex !important; align-items: flex-start; gap: 0.5rem; }
.checkbox-label input[type=checkbox] { width: auto; margin: 0.2rem 0 0; }

.legal-consent { margin-bottom: 1.25rem; font-size: 0.9rem; }
.legal-consent .hint { color: var(--text-muted); margin-bottom: 0.4rem; }
.legal-consent ul { margin: 0 0 0.9rem; padding-left: 1.2rem; }
.legal-consent li { margin-bottom: 0.2rem; }

.btn-primary, .btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.btn:hover { border-color: var(--text-muted); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn-block { width: 100%; text-align: center; }

.alert { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(174, 47, 61, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.alert-success { background: rgba(46, 125, 50, 0.12); color: var(--success); border: 1px solid var(--success); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th, table.data-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
table.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.dns-record { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; font-family: var(--mono); font-size: 0.82rem; overflow-x: auto; margin: 0.5rem 0 1rem; }

.footer { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 3rem 0 2rem; }

.account-nav { display: flex; gap: 1.25rem; margin-bottom: 1.5rem; font-size: 0.92rem; }
.account-nav a.active { color: var(--text); font-weight: 600; }

.help-page { padding: 2.5rem 0 4rem; }
.help-head { margin-bottom: 2rem; }
.help-head h1 { margin: 0.2rem 0 0; font-size: 1.7rem; font-family: var(--serif); font-weight: 500; }
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 720px) { .help-layout { grid-template-columns: 1fr; } }
.help-toc { display: flex; flex-direction: column; gap: 0.15rem; position: sticky; top: 1.5rem; }
.help-toc a { padding: 0.5rem 0.6rem; border-radius: 6px; color: var(--text-muted); font-size: 0.92rem; }
.help-toc a:hover { background: var(--surface); text-decoration: none; }
.help-toc a.active { background: var(--seal-soft); color: var(--seal); font-weight: 600; }
.help-content, .legal-content { max-width: 68ch; font-size: 1rem; }
.help-content h2, .legal-content h2 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
.help-content h2:first-child, .legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { font-size: 1.02rem; margin: 1.3rem 0 0.4rem; }
.help-content p, .legal-content p { color: var(--text); margin: 0 0 1rem; }
.help-content p.hint, .legal-content p.hint { color: var(--text-muted); font-size: 0.9rem; }
.help-content ul, .help-content ol, .legal-content ul, .legal-content ol { margin: 0 0 1rem; padding-left: 1.3rem; color: var(--text); }
.help-content li, .legal-content li { margin-bottom: 0.4rem; }
.help-content code, .legal-content code { font-family: var(--mono); font-size: 0.88em; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.05rem 0.35rem; }
.help-content a, .legal-content a { text-decoration: underline; }

.legal-page { padding: 2.5rem 0 4rem; }
.legal-disclaimer { max-width: 68ch; margin-bottom: 2rem; line-height: 1.5; }
.legal-content table.data-table { margin-bottom: 1.5rem; max-width: 100%; }

.footer-links { display: flex; justify-content: center; gap: 1.25rem; margin-top: 0.5rem; font-size: 0.85rem; }

.progress-track { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; height: 0.55rem; overflow: hidden; }
.progress-fill { background: var(--accent-bright); height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.job-status { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.job-status.queued, .job-status.running { background: var(--seal-soft); color: var(--seal); }
.job-status.completed { background: rgba(46, 125, 50, 0.12); color: var(--success); }
.job-status.failed { background: rgba(174, 47, 61, 0.12); color: var(--danger); }
.job-status.cancelled { background: var(--bg); color: var(--text-muted); }
.job-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.35rem; }
