/* forge.css — The Hyper-Tangle Design System
   Two palettes. Three fonts. One forge. */

/* The three fonts, for pages that carry no font link of their own (the
   subprocessors page is built bare and takes its whole look from here). */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=IM+Fell+English:ital@0;1&family=Share+Tech+Mono&display=swap');

/* ===== FORGE PALETTE ===== */
:root {
  /* Forge (infrastructure layer) */
  --forge: #ff6b1a;
  --ember: #ff3d00;
  --gold: #c8a84b;
  --soot: #0d0b09;
  --ash: #1a1410;
  --iron: #2a2420;
  --steel: #3a3430;
  --smoke: #6a6460;
  --parchment: #e8e0d0;
  --parchment-dim: rgba(232,224,208,0.55);
  --parchment-faint: rgba(232,224,208,0.25);

  /* Parchment variant (mythological layer) */
  --ink: #1c1610;
  --ink-dim: #3a3020;
  --ink-faint: #6a5f4a;
  --parchment-light: #f2e8d0;
  --parchment-dark: #e8dcc0;
  --parchment-edge: #d4c8a8;
  --rust: #8b3a1a;
  --rust-dim: rgba(139,58,26,0.4);
  --gold-dark: #9a7a2a;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== TOP NAV ===== */
.egg-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 14px 20px;
  background: rgba(13,11,9,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(42,36,32,0.6);
}

.egg-nav a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--smoke);
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px 0;
}

.egg-nav a:hover {
  color: var(--forge);
}

.egg-nav a.active {
  color: var(--forge);
  opacity: 0.9;
}

/* Parchment pages need a different nav background */
.parchment-page .egg-nav {
  background: rgba(28,22,16,0.92);
  border-bottom: 1px solid rgba(106,95,74,0.3);
}

/* ===== COMMON: DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0;
  opacity: 0.4;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--iron);
}

.divider-mark {
  color: var(--forge);
  font-size: 12px;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.2em;
}

/* ===== COMMON: FORGE COMMAND ===== */
.forge-command {
  font-family: 'Share Tech Mono', monospace;
  font-size: 15px;
  color: var(--forge);
  letter-spacing: 0.1em;
  padding: 20px 28px;
  background: rgba(255,107,26,0.06);
  border: 1px solid rgba(255,107,26,0.2);
  margin: 32px 0;
  position: relative;
  overflow: hidden;
}

.forge-command::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255,107,26,0.08) 0%,
    transparent 100%);
}

.forge-command span {
  position: relative;
  z-index: 1;
}

/* ===== COMMON: EPIGRAPH ===== */
.epigraph {
  border-left: 2px solid var(--forge);
  padding: 20px 28px;
  margin: 48px 0;
  background: rgba(255,107,26,0.04);
  position: relative;
}

.epigraph p {
  font-style: italic;
  color: var(--parchment);
  opacity: 0.85;
  margin-bottom: 4px;
}

.epigraph cite {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--forge);
  letter-spacing: 0.15em;
  font-style: normal;
  opacity: 0.7;
}

/* ===== COMMON: FOOTER (forge variant) ===== */
.forge-footer {
  margin-top: 96px;
  padding-top: 40px;
  border-top: 1px solid var(--iron);
  text-align: center;
}

.forge-footer-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--smoke);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  line-height: 2.6;
}

.forge-footer-text .accent {
  color: var(--forge);
  opacity: 0.8;
}

.forge-footer-sigil {
  margin-top: 28px;
  font-size: 24px;
  opacity: 0.25;
}

/* ===== COMMON: FOOTER (parchment variant) ===== */
.parchment-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--parchment-edge);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.parchment-footer-left {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
  line-height: 2;
  opacity: 0.6;
}

.parchment-footer-right {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-faint);
  opacity: 0.5;
  text-align: right;
}

/* ===== COMMON: TANGLE LINKS ===== */
/* Forge page links */
a.tangle-link {
  color: var(--forge);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,107,26,0.3);
  transition: border-color 0.2s;
}

a.tangle-link:hover {
  border-bottom-color: var(--forge);
}

/* Parchment page links */
.parchment-page a.tangle-link {
  color: var(--rust);
  border-bottom: 1px solid var(--rust-dim);
}

.parchment-page a.tangle-link:hover {
  border-bottom-color: var(--rust);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255,107,26,0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(255,107,26,0.8)); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .egg-nav {
    gap: 16px;
    padding: 12px 16px;
  }
  .egg-nav a {
    font-size: 9px;
    letter-spacing: 0.15em;
  }
}

/* ===== LEGAL PAGES ===== */
/* The terms, privacy and SMS pages and the subprocessors page come from the
   terms build. A version's text is published and never restyled into
   something else; what this adds is the second column: "How we keep it",
   what the software does today to keep a section true. It is not a term,
   so it must never read like one — a different face, a dashed rule, its
   checked date in view. Wide screens: two columns. Narrow: the note follows
   its section. Print: black on white, the note boxed under its section. */

/* The page grows to hold the second column (the page's own style caps
   .doc at 720px; :has() outranks it). */
.doc:has(> .legal) { max-width: 1120px; }
.legal > :not(.legal-section) { max-width: 720px; }

.legal .keep-note {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--smoke);
  border: 1px dashed var(--steel);
  padding: 14px 18px;
  margin: 8px 0 8px;
}

.legal-section { padding-top: 1px; }

.legal .keep {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--parchment-dim);
  background: var(--ash);
  border-left: 1px dashed var(--gold);
  padding: 14px 18px;
  margin: 4px 0 8px;
}
.legal .keep p { margin: 0 0 8px; color: inherit; }
.legal .keep p:last-child { margin-bottom: 0; }
.legal .keep .keep-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.legal .keep-date { color: var(--smoke); letter-spacing: 0.08em; text-transform: none; }
/* "Not by code": said plainly, and quieter than a note with a property. */
.legal .keep-none { border-left-color: var(--steel); background: transparent; }
.legal .keep-none.keep .keep-label { color: var(--smoke); }

.legal-dates,
main.doc .dates {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-top: 40px;
}

@media (min-width: 1100px) {
  /* Each section a row: the version's text left, its note right, side by
     side from the section's heading down. The note spans rows past the
     text's own; the empty ones take no height. */
  .legal-section {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }
  .legal-section > * { grid-column: 1; }
  .legal-section > .keep {
    grid-column: 2;
    grid-row: 1 / span 30;
    margin-top: 44px;
  }
}

/* The subprocessors page: no style of its own, so the page's frame too. */
body:has(> main.doc) {
  background: var(--soot);
  color: var(--parchment);
  font-family: 'IM Fell English', Georgia, serif;
  line-height: 1.7;
  padding: 64px 24px 96px;
}
main.doc { max-width: 1120px; margin: 0 auto; }
main.doc > p, main.doc section > p, main.doc ul { max-width: 720px; }
main.doc h1 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 8px;
}
main.doc .dates { margin: 0 0 40px; color: var(--forge); }
main.doc h2 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: 0.03em;
  margin: 56px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--iron);
}
main.doc h3 {
  font-family: 'Share Tech Mono', monospace;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 32px 0 10px;
}
main.doc p, main.doc li { margin-bottom: 14px; color: var(--parchment-dim); }
main.doc ul { padding-left: 22px; }
main.doc li { margin-bottom: 8px; }
main.doc strong { color: var(--parchment); font-weight: 600; }
main.doc a { color: var(--forge); text-decoration: none; }
main.doc a:hover { text-decoration: underline; }
main.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 14.5px;
  line-height: 1.55;
}
main.doc thead th {
  font-family: 'Share Tech Mono', monospace;
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--steel);
}
main.doc tbody th, main.doc tbody td {
  text-align: left;
  vertical-align: top;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--iron);
  color: var(--parchment-dim);
}
main.doc tbody th { color: var(--parchment); font-weight: 400; white-space: nowrap; }
/* Where, when and the two dates: data, set as data. */
main.doc tbody td:nth-child(n+4) {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--smoke);
}
main.doc .back {
  display: inline-block;
  margin-top: 48px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
}
@media (max-width: 900px) {
  /* Seven columns do not fit a phone: the table scrolls inside the page. */
  main.doc table { display: block; overflow-x: auto; }
  main.doc thead th, main.doc tbody th, main.doc tbody td { min-width: 120px; }
  main.doc tbody th { min-width: 0; }
}

@media print {
  body, body:has(> main.doc) { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .doc:has(> .legal), main.doc { max-width: none; }
  .legal h1, .legal h2, main.doc h1, main.doc h2, .legal strong, main.doc strong,
  .legal p, .legal li, main.doc p, main.doc li, main.doc th, main.doc td { color: #000 !important; }
  .legal a, main.doc a { color: #000 !important; text-decoration: underline; }
  .legal .meta, .legal-dates, main.doc .dates, main.doc h3 { color: #333 !important; }
  .legal-section { display: block !important; }
  .legal .keep, .legal .keep-note {
    color: #333 !important;
    background: none !important;
    border: 1px dashed #999 !important;
    margin: 6px 0 14px !important;
    break-inside: avoid;
  }
  .legal .keep-label, .legal .keep-date { color: #555 !important; }
  .legal h2, main.doc h2 { break-after: avoid; border-color: #ccc; }
  main.doc table { display: table; font-size: 10.5pt; }
  main.doc thead th, main.doc tbody th, main.doc tbody td { border-color: #ccc; color: #000 !important; }
  .back { display: none; }
}
