/* ============================================================
   COMMAND BRIDGE — Legal Pages (Privacy & Terms)
   Inherits all design tokens from styles.css. Adds long-form
   reading typography, sticky table of contents, and callouts
   for legal language blocks.
   ============================================================ */

/* ========== Legal Hero ========== */
.legal-hero {
  background: var(--grad-hero);
  color: #fff;
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}
.legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 30%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, black 30%, transparent 70%);
  pointer-events: none;
}
.legal-hero .container {
  position: relative;
  z-index: 1;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin-bottom: 36px;
  transition: background .2s ease, border-color .2s ease;
}
.legal-back:hover {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
}
.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 24px;
}
.legal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  color: #fff;
}
.legal-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

/* ========== Legal Body Layout ========== */
.legal-body {
  background: var(--paper);
  padding: 80px 0 120px;
}
.legal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  align-items: start;
}

/* ========== Sticky Table of Contents ========== */
.legal-toc {
  position: sticky;
  top: 32px;
  align-self: start;
}
.toc-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-700);
  padding: 6px 12px;
  border: 1px solid var(--orange-200);
  border-radius: 999px;
  background: var(--orange-50);
  margin-bottom: 18px;
  display: inline-block;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--ink-200);
}
.toc-list li {
  margin: 0;
}
.toc-list a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--ink-600);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  line-height: 1.4;
}
.toc-list a:hover {
  color: var(--ink-900);
  background: var(--orange-50);
}
.toc-list a.is-active {
  color: var(--orange-700);
  border-left-color: var(--orange-500);
  font-weight: 600;
}

/* ========== Legal Content Typography ========== */
.legal-content {
  max-width: 720px;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-800);
}

.legal-content .lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-700);
  margin: 0 0 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--ink-200);
}

.legal-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink-900);
  margin: 56px 0 16px;
  scroll-margin-top: 32px;
  position: relative;
  padding-left: 20px;
}
.legal-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 0 4px var(--orange-100);
}
.legal-content h2:first-child { margin-top: 0; }

.legal-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 32px 0 8px;
}

.legal-content p {
  margin: 0 0 18px;
}

.legal-content p:last-child { margin-bottom: 0; }

.legal-content strong {
  font-weight: 700;
  color: var(--ink-900);
}

.legal-content a,
.legal-link {
  color: var(--orange-700);
  text-decoration: underline;
  text-decoration-color: var(--orange-300);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .15s ease;
}
.legal-content a:hover,
.legal-link:hover {
  text-decoration-color: var(--orange-600);
}

/* Lists */
.legal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.legal-list li {
  position: relative;
  padding: 10px 0 10px 32px;
  border-bottom: 1px dashed var(--ink-200);
}
.legal-list li:last-child {
  border-bottom: none;
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  width: 16px;
  height: 1px;
  background: var(--orange-500);
}

/* ALL-CAPS legal callouts (Limitation of Liability, etc.) */
.legal-callout {
  background: var(--ink-900);
  color: var(--paper);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 24px 0 32px;
  position: relative;
  overflow: hidden;
}
.legal-callout::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--orange-500);
}
.legal-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.legal-callout strong {
  color: #fff;
  font-weight: 500;
}

/* Footer meta within content */
.legal-foot-meta {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--ink-200);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-500);
}
.legal-foot-meta a {
  color: var(--orange-700);
}

/* ========== Responsive ========== */
@media (max-width: 960px) {
  .legal-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .legal-toc {
    position: relative;
    top: 0;
    margin-bottom: 8px;
  }
  .toc-list {
    border-left: none;
    border-top: 1px solid var(--ink-200);
    border-bottom: 1px solid var(--ink-200);
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .toc-list a {
    padding: 10px 12px;
    border-left: none;
    border-bottom: 1px solid var(--ink-100);
  }
  .toc-list a.is-active {
    border-left: none;
    background: var(--orange-50);
  }
  .legal-content { font-size: 16px; }
  .legal-content .lead { font-size: 17px; }
  .legal-body { padding: 56px 0 80px; }
}

@media (max-width: 600px) {
  .toc-list { grid-template-columns: 1fr; }
  .legal-hero { padding: 40px 0 56px; }
  .legal-content h2 { font-size: 24px; }
  .legal-callout { padding: 20px; }
  .legal-callout p { font-size: 13px; }
}

/* ============================================================
   Contact page — sits below the shared .legal-hero, replaces
   the legal-grid two-column layout with a single column that
   stacks the intro copy above the form.
   ============================================================ */

.contact-container {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.contact-intro .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-800);
  margin: 0 0 28px;
}

.contact-channels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.contact-channels li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
}
.channel-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-600);
}

.contact-form {
  display: grid;
  gap: 22px;
  background: var(--paper);
  padding: 32px;
  border: 1px solid var(--ink-200);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(20, 8, 4, 0.02);
}
/* Author CSS above would otherwise beat the UA [hidden] rule, so JS
   setting form.hidden = true on success wouldn't actually hide it. */
.contact-form[hidden] { display: none; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-700);
}
.form-required {
  color: var(--orange-600);
  margin-left: 2px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--ink-300);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field textarea {
  resize: vertical;
  min-height: 140px;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(255, 122, 38, 0.18);
}
.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #c93d2a;
  box-shadow: 0 0 0 3px rgba(201, 61, 42, 0.16);
}

.form-error {
  font-size: 13px;
  color: #c93d2a;
  min-height: 1em;
}
.form-error:empty {
  display: none;
}

/* Honeypot: hide from humans, leave intact for bots. */
.honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-turnstile {
  display: flex;
  justify-content: flex-start;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.form-status {
  margin: 0;
  font-size: 14px;
  color: var(--ink-600);
}
.form-status.is-error {
  color: #c93d2a;
}

button[type="submit"][disabled] {
  opacity: 0.65;
  cursor: progress;
}

/* Success panel — replaces the form on a 200 response. */
.contact-success {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 56px 32px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: 18px;
  grid-column: 1 / -1;
}
/* Author CSS above would otherwise beat the UA [hidden] rule. */
.contact-success[hidden] { display: none; }
.contact-success-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 700;
}
.contact-success h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-900);
}
.contact-success p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-700);
  max-width: 48ch;
}

@media (max-width: 900px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .contact-form {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .contact-form {
    padding: 20px;
  }
  .contact-success {
    padding: 40px 20px;
  }
}
