/* site/css/site.css — the Threshold only.
 *
 * This stylesheet dresses ONE page: index.html, the threshold. Every page behind it uses
 * css/record.css and is deliberately plain (Tony's ruling, 2026-07-05). The threshold is
 * the single page allowed atmosphere — and its atmosphere is restraint: a near-empty page,
 * the founding-notice typography (a system serif, warm paper, near-black ink), and nothing
 * that fronts its own weight (TONE_AND_PANEL Law 1 — the Divergence). No badges, no
 * gradients, no signposted profundity. A notice at a fence.
 */

:root {
  --paper: #faf8f3;
  --ink: #1a1814;
  --ink-soft: #4a453d;
  --ink-faint: #8a8377;
  --rule: #ded8cc;
  --rule-strong: #b8b0a0;
  --accent: #6b2f1a; /* oxblood — used only for the field-error and focus rule */
  --error: #8a1f1f;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── the threshold ─────────────────────────────────────────────────────────── */

.threshold {
  max-width: 30rem;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* A small, quiet seal — the name, letterspaced, not a logo. */
.threshold-mark {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 2.5rem;
}

/* The boundary-notice: plain prose, generous space, no ornament. */
.threshold-notice {
  margin: 0 0 3rem;
}

.threshold-notice p {
  margin: 0 0 1.1rem;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.6;
}

.threshold-notice p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

/* ── the account form ──────────────────────────────────────────────────────── */

.threshold-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.6rem 0.7rem;
}

.field input:focus {
  outline: none;
  border-color: var(--ink-soft);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error,
.form-error {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--error);
  margin: 0;
}

.form-error-slot:empty {
  display: none;
}

.form-error {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--error);
  border-radius: 2px;
}

.threshold-form button[type="submit"] {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  margin-top: 0.4rem;
}

.threshold-form button[type="submit"]:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.threshold-form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ── the honest success state (replaces the form) ──────────────────────────── */

.threshold-done {
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
}

.threshold-done-lead {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}

.threshold-done p:last-child {
  color: var(--ink-soft);
  margin: 0;
}

/* ── the one quiet way into the record ─────────────────────────────────────── */

.threshold-aside {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  align-self: flex-start;
  margin-top: 3rem;
  padding-bottom: 2px;
}

.threshold-aside:hover {
  color: var(--ink-soft);
  border-bottom-color: var(--rule-strong);
}

/* ── responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  body {
    font-size: 17px;
  }
  .threshold {
    padding: 4rem 1.25rem 3rem;
  }
}

/* The threshold honors a reader who prefers dark — the notice, unchanged, at night. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17150f;
    --ink: #ece6da;
    --ink-soft: #b8b0a0;
    --ink-faint: #857d6e;
    --rule: #2e2a22;
    --rule-strong: #4a4438;
    --accent: #d98a6a;
    --error: #d98a6a;
  }
}
