/* ============================================================
   Dock Brief — HPTS Phase A legal / SMS consent
   Tokens locked. No marketing-redesign motifs.
   ============================================================ */

:root {
  --ground: #f3efe6;
  --ink: #12110f;
  --muted: #6b6560;
  --rule: #d8d0c4;
  --accent: #b45309;
  --success-bg: #e4efe8;
  --success-ink: #1f4d3a;
  --danger: #8b2e1a;
  --measure: 62ch;
  --page-max: 920px;
  --rail-w: 11.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.consent-box input:focus-visible + .consent-label {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ----- Nav ----- */

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: calc(var(--page-max) + var(--rail-w) + 4rem);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.25rem;
}

.wordmark {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark:hover {
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.15rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

/* ----- Masthead ----- */

.masthead {
  max-width: calc(var(--page-max) + var(--rail-w) + 4rem);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}

.masthead-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.masthead h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 450;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  max-width: 16ch;
}

.masthead .lede {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 2rem;
}

.masthead-rule {
  display: block;
  height: 1px;
  background: var(--rule);
  transform-origin: left center;
  transform: scaleX(0);
  animation: rule-draw 400ms var(--ease) 120ms forwards;
}

@keyframes rule-draw {
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .masthead-rule {
    animation: none;
    transform: scaleX(1);
  }
  .fade-up {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----- Layout: rail + prose ----- */

.legal-shell {
  max-width: calc(var(--page-max) + var(--rail-w) + 4rem);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 2.5rem 3rem;
  align-items: start;
}

.section-rail {
  position: sticky;
  top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.section-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.section-rail a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.85rem;
  text-decoration: none;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.section-rail a:hover,
.section-rail a:focus-visible {
  color: var(--ink);
  border-left-color: var(--accent);
}

.prose {
  max-width: var(--measure);
}

.prose section {
  margin-bottom: 2.75rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 520ms var(--ease) forwards;
}

.prose section:nth-child(1) { animation-delay: 80ms; }
.prose section:nth-child(2) { animation-delay: 120ms; }
.prose section:nth-child(3) { animation-delay: 160ms; }
.prose section:nth-child(4) { animation-delay: 200ms; }
.prose section:nth-child(5) { animation-delay: 240ms; }
.prose section:nth-child(6) { animation-delay: 280ms; }
.prose section:nth-child(7) { animation-delay: 320ms; }
.prose section:nth-child(8) { animation-delay: 360ms; }
.prose section:nth-child(9) { animation-delay: 400ms; }
.prose section:nth-child(10) { animation-delay: 440ms; }
.prose section:nth-child(11) { animation-delay: 480ms; }
.prose section:nth-child(12) { animation-delay: 520ms; }

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prose h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.85rem;
  scroll-margin-top: 1.5rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose .callout {
  border-left: 2px solid var(--accent);
  padding: 0.65rem 0 0.65rem 1rem;
  margin: 1.25rem 0;
  color: var(--ink);
  background: transparent;
}

.prose .meta-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Hub / narrow pages without rail */

.page-narrow {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-narrow .prose,
.consent-layout {
  max-width: var(--measure);
}

/* ----- SMS consent ----- */

.disclosure {
  border: 1px solid var(--rule);
  padding: 1.25rem 1.35rem;
  margin: 0 0 2rem;
  background: rgba(255, 255, 255, 0.35);
}

.disclosure h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.disclosure ul {
  margin: 0;
  padding-left: 1.1rem;
}

.disclosure li {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.disclosure .desk-number {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field .req {
  color: var(--accent);
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
  border-radius: 0;
  appearance: none;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.field textarea {
  min-height: 5.5rem;
  resize: vertical;
  border: 1px solid var(--rule);
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.25);
}

.field textarea:focus {
  border-color: var(--accent);
}

.field .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.consent-box {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.consent-box input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.consent-label {
  font-size: 1rem;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.btn-primary {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fffaf3;
  border: none;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  transition: filter 180ms ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.form-error {
  color: var(--danger);
  font-size: 0.95rem;
  margin: 0;
  min-height: 1.4em;
}

.form-error[hidden] {
  display: none;
}

/* Confirmation / thanks state */

.thanks-panel {
  border: 1px solid var(--rule);
  background: var(--success-bg);
  color: var(--success-ink);
  padding: 1.75rem 1.5rem;
  max-width: var(--measure);
}

.thanks-panel[hidden] {
  display: none;
}

.thanks-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--success-ink);
}

.thanks-panel p {
  margin: 0 0 0.75rem;
}

.thanks-panel .meta-line {
  color: var(--success-ink);
  opacity: 0.85;
}

.hub-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.hub-list li {
  border-bottom: 1px solid var(--rule);
}

.hub-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
}

.hub-list a span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- Footer ----- */

.site-footer {
  max-width: calc(var(--page-max) + var(--rail-w) + 4rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: grid;
  gap: 0.85rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer-entity {
  color: var(--ink);
}

@media (max-width: 820px) {
  .legal-shell {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .section-rail {
    position: static;
  }

  .section-rail ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    border-left: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1rem;
  }

  .section-rail a {
    border-left: none;
    margin-left: 0;
    padding: 0.25rem 0;
  }
}
