/* ==========================================================================
   DAVID_OS · Training & Human Authority Corps Portal Stylesheet
   Governed by Visual Constitution v1.1 · Strictly consumes var(--*) tokens
   Zero raw hex codes permitted. Zero inline style attributes required.
   ========================================================================== */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --shell: var(--lion-ivory);
  --shell-raised: var(--stag-parchment);
  --shell-sunken: var(--beaver-parchment);
  --text: var(--ink-deep);
  --text-muted: var(--ink-mid);
  --rule: var(--rule-hair);
  --accent: var(--heritage-burgundy);
  --accent-warm: var(--royal-gold);
}

@media (prefers-color-scheme: dark) {
  :root {
    --shell: var(--badger-anthracite);
    --shell-raised: var(--beaver-ink);
    --shell-sunken: var(--ink-deep);
    --text: var(--lion-ivory);
    --text-muted: var(--swan-pewter);
    --rule: var(--wolf-steel);
    --accent: var(--royal-gold);
    --accent-warm: var(--fox-spice);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--shell);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Topbar & Navigation ------------------------------------------------ */
.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  background: var(--shell-raised);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--shell);
  border: 1px solid var(--rule);
  color: var(--accent-warm);
}
.nav-link {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Hero Section ------------------------------------------------------- */
.hero {
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--rule);
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.hero-title {
  font-size: 2.8rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
  max-width: 52rem;
}
.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 46rem;
  margin: 0 0 2rem;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.hero-badge {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  color: var(--text);
  border-radius: 2px;
}
.hero-badge b {
  color: var(--accent-warm);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}
.btn-primary {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: var(--shell);
  border: 1px solid var(--accent);
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  display: inline-block;
}
.btn-primary:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: var(--ink-deep);
}
.btn-secondary {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rule);
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  display: inline-block;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Section Heads ------------------------------------------------------ */
.sec-block {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.sec-num {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--accent-warm);
  font-weight: 700;
}
.sec-head h2 {
  font-size: 1.8rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}
.sec-head p.sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Embassy Walkthrough & Interactive Inspector ------------------------ */
.zones-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 48rem) {
  .zones-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .zones-grid { grid-template-columns: repeat(4, 1fr); }
}
.zone-card {
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  padding: 1.25rem;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}
.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}
.zone-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.zone-title {
  font-size: 1.05rem;
  margin: 0.2rem 0 0.4rem;
}
.zone-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.zone-rooms {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
}
.zone-rooms li {
  border-top: 1px dotted var(--rule);
  padding: 0.4rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.room-btn {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.room-btn:hover, .room-btn:focus {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.room-status {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.inspector-rotunda {
  margin-top: 2.5rem;
  border: 1px solid var(--royal-gold);
  background: var(--shell-sunken);
  padding: 2rem;
  border-radius: 2px;
}
.inspector-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}
.inspector-title {
  font-size: 1.4rem;
  margin: 0 0 0.3rem;
}
.inspector-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-warm);
}
.inspector-prose {
  font-size: 1.02rem;
  margin: 0 0 1.2rem;
  max-width: 52rem;
}
.inspector-seat-box {
  background: var(--shell-raised);
  border: 1px solid var(--rule);
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.seat-label {
  font-family: var(--sans);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}
.seat-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.05rem;
}

/* --- The Two-Sided Compact Grid ----------------------------------------- */
.compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 52rem) {
  .compact-grid { grid-template-columns: 1fr 1fr; }
}
.compact-card {
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  padding: 2rem;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}
.compact-card.demands {
  border-left: 4px solid var(--heritage-burgundy);
}
.compact-card.promises {
  border-left: 4px solid var(--royal-gold);
}
.compact-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}
.compact-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}
.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.compact-list li {
  padding-left: 1.8rem;
  position: relative;
  font-size: 0.95rem;
}
.compact-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.compact-list strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.2rem;
}

/* --- 1 January 2027 Launchpoint Banner ---------------------------------- */
.launchpoint-banner {
  border: 1px solid var(--royal-gold);
  background: var(--shell-sunken);
  padding: 2.5rem;
  border-radius: 2px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 54rem) {
  .launchpoint-banner { grid-template-columns: 1.2fr 1fr; }
}
.launchpoint-text h3 {
  font-size: 1.6rem;
  margin: 0 0 0.8rem;
}
.launchpoint-text p {
  font-size: 1.02rem;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
}
.launchpoint-triad {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--shell-raised);
  border: 1px solid var(--rule);
  padding: 1.4rem;
}
.triad-item {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-size: 0.9rem;
}
.triad-flag {
  font-size: 1.2rem;
}

/* --- 5-Year Horizon Interactive Timeline -------------------------------- */
.timeline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}
@media (min-width: 56rem) {
  .timeline-grid { grid-template-columns: repeat(5, 1fr); }
}
.timeline-step {
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.step-year {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-warm);
}
.step-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}
.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Identity Creed ----------------------------------------------------- */
.creed-box {
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  border-left: 4px solid var(--stag-emerald);
  padding: 2.2rem;
  font-size: 1.1rem;
  line-height: 1.65;
}
.creed-box p {
  margin: 0 0 1rem;
}
.creed-box p:last-child {
  margin: 0;
  font-weight: 600;
  color: var(--accent);
}

/* --- Intake Form & Registration Receipt --------------------------------- */
.intake-container {
  border: 1px solid var(--rule);
  background: var(--shell-raised);
  padding: 2.5rem;
  border-radius: 2px;
}
.intake-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 48rem) {
  .form-row { grid-template-columns: 1fr 1fr; }
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field-group label {
  font-family: var(--sans);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.field-input, .field-select, .field-textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  background: var(--shell);
  color: var(--text);
  border-radius: 2px;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.8rem;
  background: var(--shell);
  border: 1px solid var(--rule);
}
.agreement-check input {
  margin-top: 0.25rem;
}
.btn-submit-intake {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 2rem;
  background: var(--accent);
  color: var(--shell);
  border: 1px solid var(--accent);
  cursor: pointer;
  border-radius: 2px;
  align-self: flex-start;
}
.btn-submit-intake:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: var(--ink-deep);
}

/* Receipt Display */
.receipt-display {
  border: 2px solid var(--royal-gold);
  background: var(--shell);
  padding: 2.5rem;
  border-radius: 2px;
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.token-code {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-warm);
}
.receipt-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 2rem;
  margin-bottom: 2rem;
}
.receipt-grid dt {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.receipt-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}
.status-pill {
  color: var(--stag-emerald);
  font-family: var(--mono);
  font-weight: 700;
}
.btn-another {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--rule);
  cursor: pointer;
}
.btn-another:hover {
  color: var(--text);
  border-color: var(--text);
}

/* --- Anti-Abuse & Verification Gates ----------------------------------- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
.turnstile-slot {
  margin: 1.25rem 0 0.5rem;
  min-height: 65px;
}

/* --- Colophon ----------------------------------------------------------- */
.portal-colophon {
  padding: 3rem 0 4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
