/* =========================================================================
   LEGAL — privacy policy and terms of use (privacy.html, terms.html)
   Calm reading pages in the "Deep field" system: a dark hero with a slowly
   turning seal, then a soft-white reading section with numbered clauses,
   a sticky contents list with scroll-spy on desktop and a collapsible
   contents block on phones. Print styles give black text on white.
   ========================================================================= */

.lg-hero, .lg-body {
  --teal-ink: #066E68;      /* teal text on soft white: 5.7:1 */
  --teal-ink-strong: #05605B;
}

/* ---------- Hero ---------- */
.lg-hero {
  padding-bottom: clamp(48px, 7vw, 96px);
  background:
    radial-gradient(50% 60% at 84% 42%, rgba(0, 161, 155, .15), transparent 70%),
    radial-gradient(110% 80% at 80% 0%, var(--hero-1) 0%, var(--hero-2) 35%, var(--hero-3) 85%);
}
.lg-hero .wrap { position: relative; }
.lg-hero h1 { margin-left: -.04em; max-width: 10ch; font-size: clamp(3rem, .8rem + 8.4vw, 10rem); }
.lg-hero h1 .outline { -webkit-text-stroke: 2px var(--accent-display); }
.lg-hero .lead { color: rgba(var(--fg-rgb), .84); max-width: 54ch; }

.lg-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
  margin-top: clamp(28px, 4vw, 48px); padding-top: 22px;
  border-top: 1px solid rgba(var(--fg-rgb), .16);
}
.lg-updated { display: inline-flex; align-items: baseline; gap: 12px; color: var(--fg); font-weight: 500; }
.lg-updated .mono { color: var(--accent); }
.lg-draft { font-size: var(--t-sm); }
.lg-hero .placeholder { white-space: normal; line-height: 1.5; }
.lg-talk { margin-left: auto; }
.lg-print { padding: .8em 1.2em; }
.lg-print svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the seal: a slowly turning ring of mono type around the SAA emblem */
.lg-seal {
  position: absolute; z-index: -1; pointer-events: none;
  width: min(40vw, 540px); aspect-ratio: 1;
  right: max(-6vw, -90px); top: calc(var(--nav-h) + clamp(24px, 5vw, 70px));
  opacity: .9;
}
.lg-seal svg { width: 100%; height: 100%; max-width: none; overflow: visible; }
.lg-seal .sl-turn { transform-origin: 200px 200px; animation: lgTurn 90s linear infinite; }
.lg-seal .sl-turn-rev { transform-origin: 200px 200px; animation: lgTurn 140s linear infinite reverse; }
.lg-seal .sl-ring { fill: none; stroke: rgba(var(--fg-rgb), .12); stroke-width: 1; }
.lg-seal .sl-dash { fill: none; stroke: rgba(var(--accent-rgb), .4); stroke-width: 1; stroke-dasharray: 1.5 7; }
.lg-seal .sl-arc { fill: none; stroke: var(--accent-fill); stroke-width: 2; stroke-linecap: round; opacity: .8; filter: drop-shadow(0 0 6px rgba(0, 161, 155, .8)); }
.lg-seal text { font-family: var(--f-mono); font-size: 13px; font-weight: 500; letter-spacing: .12em; fill: rgba(94, 214, 204, .62); text-transform: uppercase; }
.lg-seal .sl-glow { fill: url(#lgSealGlow); }
.lg-seal image { opacity: .9; }
/* light mode: the seal is drawn in deep teal and navy ink, with the navy emblem */
.lg-seal .sl-l { display: none; }
:root[data-theme="light"] .lg-seal image:not(.sl-l) { display: none; }
:root[data-theme="light"] .lg-seal .sl-l { display: inline; }
:root[data-theme="light"] .lg-seal .sl-ring { stroke: rgba(11, 37, 69, .16); }
:root[data-theme="light"] .lg-seal .sl-arc { opacity: 1; filter: drop-shadow(0 0 4px rgba(0, 161, 155, .3)); }
:root[data-theme="light"] .lg-seal text { fill: rgba(4, 110, 104, .78); }
@keyframes lgTurn { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .lg-seal { width: 74vw; right: -38vw; top: calc(var(--nav-h) - 14px); opacity: .38; }
}

/* ---------- Reading section ---------- */
.lg-body { padding-block: clamp(56px, 8vw, 120px) clamp(80px, 10vw, 150px); }
.lg-body :focus-visible { outline-color: var(--teal-ink); }
.lg-body .placeholder { color: var(--teal-ink-strong); white-space: normal; line-height: 1.5; }
.lg-grid {
  display: grid; grid-template-columns: minmax(220px, 288px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 112px); align-items: start;
}

/* contents: sticky with scroll-spy on desktop */
.lg-toc { position: sticky; top: calc(var(--nav-h) + 28px); max-height: calc(100vh - var(--nav-h) - 56px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 4px 4px 4px 0; }
.lg-toc summary { display: none; }
.lg-toc-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-muted); margin-bottom: 14px; }
.lg-prog { position: relative; display: block; height: 2px; margin-bottom: 18px; background: var(--line); border-radius: 2px; overflow: hidden; }
.lg-prog i { position: absolute; inset: 0; background: var(--teal); transform-origin: left; transform: scaleX(var(--read, 0)); transition: transform .25s linear; }
.lg-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.lg-toc a {
  position: relative; display: grid; grid-template-columns: 2.3em minmax(0, 1fr); align-items: baseline;
  padding: 7px 8px 7px 16px; color: var(--ink-muted); font-size: var(--t-sm); line-height: 1.35;
  transition: color .3s var(--ease);
}
.lg-toc a span { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: .08em; color: var(--ink-muted); }
.lg-toc a::before {
  content: ""; position: absolute; left: -1px; top: 5px; bottom: 5px; width: 2px; background: var(--teal);
  transform: scaleY(0); transition: transform .45s var(--ease);
}
.lg-toc a:hover { color: var(--ink); }
.lg-toc a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.lg-toc a[aria-current="true"] span { color: var(--teal-ink); }
.lg-toc a[aria-current="true"]::before { transform: none; }
.lg-toc a:focus-visible { outline-offset: -2px; }

/* document */
.lg-doc { min-width: 0; color: var(--ink); line-height: 1.7; }
.lg-doc > * { max-width: 68ch; }
.lg-doc .lg-glance { max-width: 880px; }
.lg-doc a:not(.btn) { color: var(--teal-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.lg-doc a:not(.btn):hover { text-decoration-thickness: 2px; }

/* at a glance */
.lg-glance { margin-bottom: clamp(40px, 6vw, 72px); }
.lg-glance > h2 { margin-bottom: 20px; }
.lg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lg-card {
  position: relative; display: grid; align-content: start; gap: 10px; overflow: hidden;
  padding: 24px 24px 26px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line);
  transition: border-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.lg-card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 44px; background: var(--teal); transition: width .6s var(--ease); }
.lg-card:hover { border-color: rgba(0, 161, 155, .45); transform: translateY(-3px); box-shadow: 0 22px 40px -28px rgba(11, 37, 69, .45); }
.lg-card:hover::before { width: 100%; }
.lg-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-050); color: var(--teal-ink); margin-bottom: 4px; }
.lg-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-card h3 { font-size: 1.14rem; font-weight: 800; font-stretch: 108%; line-height: 1.18; letter-spacing: -.005em; }
.lg-card p { font-size: var(--t-sm); line-height: 1.55; color: var(--ink-muted); }

/* numbered sections */
.lg-sec { padding-block: clamp(30px, 4vw, 46px); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 20px); }
.lg-sec:last-child { padding-bottom: 0; }
.lg-sec h2 {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px;
  font-size: clamp(1.4rem, 1.15rem + .9vw, 1.9rem); font-weight: 800; font-stretch: 110%; line-height: 1.12;
}
.lg-sec h2:focus { outline: none; }
.lg-n { flex: none; min-width: 2.3em; font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .12em; color: var(--teal-ink); transform: translateY(-.2em); }
.lg-sec h3 { font-size: 1.1rem; font-weight: 700; font-stretch: 104%; line-height: 1.25; margin: 28px 0 8px; letter-spacing: 0; }
.lg-sec p + p, .lg-sec p + ul, .lg-sec ul + p, .lg-sec .lg-table-wrap + p, .lg-sec p + .lg-table-wrap, .lg-sec .lg-note + p, .lg-sec p + .lg-note, .lg-sec ul + .lg-note, .lg-sec p + .lg-keep, .lg-sec .lg-keep + p { margin-top: 1em; }
.lg-sec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6em; }
.lg-sec li { position: relative; padding-left: 1.6em; }
.lg-sec li::before { content: ""; position: absolute; left: 0; top: .8em; width: .7em; height: 2px; border-radius: 2px; background: var(--teal); }
.lg-sec strong { font-weight: 600; }

.lg-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 18px 20px; border-radius: var(--r-sm); background: var(--teal-050); border: 1px solid rgba(0, 161, 155, .22);
  font-size: var(--t-sm); line-height: 1.6;
}
.lg-note svg { width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--teal-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* key/value list (retention, contact) */
.lg-keep { margin: 0; display: grid; border-top: 1px solid var(--line); }
.lg-keep > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 6px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lg-keep dt { font-weight: 600; }
.lg-keep dd { margin: 0; color: var(--ink-muted); }

/* cookie table */
.lg-table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.lg-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); line-height: 1.5; }
.lg-table caption { text-align: left; padding: 16px 18px 0; font-weight: 600; caption-side: top; }
.lg-table th, .lg-table td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lg-table thead th { font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); background: var(--white); }
.lg-table tbody th[scope="rowgroup"] { background: var(--white); padding-block: 12px; font-weight: 600; }
.lg-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.lg-table td:first-child { white-space: nowrap; }
.lg-table code, .lg-doc code { font-family: var(--f-mono); font-size: .88em; padding: .14em .45em; border-radius: 5px; background: var(--teal-050); color: var(--ink); }
.lg-tag { display: inline-flex; align-items: center; gap: .5em; font: 500 var(--t-xs)/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; padding: .5em .8em; border-radius: 999px; vertical-align: middle; margin-left: 8px; }
.lg-tag.nec { background: var(--navy); color: var(--on-dark); }
.lg-tag.opt { box-shadow: inset 0 0 0 1px var(--teal-ink); color: var(--teal-ink); }
.lg-actions { margin-top: 1.4em; align-items: center; }
.lg-actions .btn svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-body .btn.ghost { box-shadow: inset 0 0 0 1.5px #9DB0C0; }
.lg-body .btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }

/* contact card */
.lg-contact { margin-top: 1.2em; padding: clamp(22px, 3vw, 32px); border-radius: var(--r); background: var(--navy); color: var(--fg); display: grid; gap: 18px; }
.lg-contact .lg-keep { border-top-color: rgba(234, 241, 243, .14); }
.lg-contact .lg-keep > div { border-bottom-color: rgba(234, 241, 243, .14); }
.lg-contact dt { color: var(--teal-300); font: 500 var(--t-xs)/1.5 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.lg-contact dd { color: var(--fg); }
.lg-contact a:not(.btn) { color: var(--fg); }
.lg-contact a:not(.btn):hover { color: var(--teal-300); }
.lg-contact :focus-visible { outline-color: var(--teal-300); }
.lg-contact .placeholder { color: var(--teal-300); }
.lg-contact-top { display: flex; align-items: center; gap: 14px; }
.lg-contact-top img { width: 40px; height: 36px; object-fit: contain; }
.lg-contact-top b { font-family: var(--f-display); font-weight: 800; font-stretch: 110%; font-size: 1.15rem; line-height: 1.2; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 960px) {
  .lg-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .lg-toc { position: static; max-height: none; overflow: visible; padding: 0; }
  .lg-toc details { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
  .lg-toc summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; min-height: 56px;
    cursor: pointer; list-style: none; font-weight: 600; border-radius: var(--r);
  }
  .lg-toc summary::-webkit-details-marker { display: none; }
  .lg-toc summary .mono { color: var(--ink-muted); margin-left: auto; }
  .lg-toc summary svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--teal-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease); }
  .lg-toc details[open] summary svg { transform: rotate(180deg); }
  .lg-toc summary:focus-visible { outline-offset: -2px; }
  .lg-toc-label, .lg-prog { display: none; }
  .lg-toc ol { margin: 0 16px 16px; border-left: 0; border-top: 1px solid var(--line); padding-top: 8px; }
  .lg-toc a { padding: 10px 4px; min-height: 44px; align-items: center; }
  .lg-toc a::before { display: none; }
  .lg-doc > * { max-width: none; }
}
@media (max-width: 560px) {
  .lg-hero h1 { font-size: min(16vw, 5rem); }
}
@media (max-width: 640px) {
  .lg-cards { grid-template-columns: minmax(0, 1fr); }
  .lg-talk, .lg-print { margin-left: 0; }
  /* one item per row, so the layout never depends on text width (no shift when the web fonts arrive) */
  .lg-meta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .lg-keep > div { grid-template-columns: minmax(0, 1fr); }
  .lg-sec h2 { gap: 10px; }
  .lg-n { min-width: 1.9em; }
  /* the cookie table becomes a stack of labelled rows */
  .lg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table th, .lg-table td { display: block; width: 100%; }
  .lg-table tr:has(> th[scope="rowgroup"]) { padding: 0; }
  .lg-table tbody th[scope="rowgroup"] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 16px; }
  .lg-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .lg-table tbody:last-child tr:last-child { border-bottom: 0; }
  .lg-table td { display: grid; grid-template-columns: 7.8em minmax(0, 1fr); gap: 12px; padding: 5px 0; border: 0; white-space: normal !important; }
  .lg-table td code { justify-self: start; }
  .lg-table td::before { content: attr(data-label); font: 500 .7rem/1.6 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
  .lg-tag { margin: 0; }
  .lg-card { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; row-gap: 6px; padding: 20px 18px 22px; }
  .lg-card .lg-ic { grid-row: span 2; margin: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .lg-seal .sl-turn, .lg-seal .sl-turn-rev { animation: none; }
  .lg-card, .lg-card::before { transition: none; }
  .lg-card:hover { transform: none; }
}

/* ---------- Print: black on white, document only ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 11pt; line-height: 1.5; }
  .site-header, .menu-panel, .site-footer, .cta-band, .chat-fab, .chat-panel, .preloader, .progress, .transition-curtain,
  .cursor, .cursor-dot, .cc-banner, dialog, .lg-seal, .lg-toc, .lg-print, .lg-talk, .lg-actions, [data-include] { display: none !important; }
  .page-hero, .lg-hero, .lg-body, .light { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .page-hero::after { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .lg-hero .crumbs { display: none; }
  .lg-hero h1 { font-size: 28pt; line-height: 1.05; max-width: none; color: #000 !important; }
  .lg-hero h1 .outline { color: #000 !important; -webkit-text-stroke: 0; }
  .split-char, .split-word, [data-reveal] { transform: none !important; opacity: 1 !important; }
  .lg-hero .lead { color: #000 !important; font-size: 12pt; margin-top: 8pt; }
  .lg-meta { border-top: 1px solid #000; margin: 12pt 0 18pt; padding-top: 8pt; }
  .lg-updated, .lg-updated .mono, .eyebrow { color: #000 !important; }
  .placeholder { color: #000 !important; background: none !important; border: 1px dashed #000 !important; }
  .lg-grid { display: block; }
  .lg-doc, .lg-doc > * { max-width: none; color: #000 !important; }
  .lg-cards { grid-template-columns: 1fr 1fr; gap: 8pt; }
  .lg-card { border: 1px solid #000; box-shadow: none; padding: 10pt; break-inside: avoid; }
  .lg-card::before, .lg-ic { display: none; }
  .lg-card p, .lg-keep dd, .muted { color: #000 !important; }
  .lg-sec { border-top: 1px solid #000; padding-block: 12pt 0; }
  .lg-sec h2 { font-size: 15pt; break-after: avoid; }
  .lg-sec h3 { break-after: avoid; }
  .lg-n { color: #000; }
  .lg-sec li::before { background: #000; }
  .lg-note { background: none; border: 1px solid #000; break-inside: avoid; }
  .lg-note svg { stroke: #000; }
  .lg-table-wrap { border: 1px solid #000; }
  .lg-table th, .lg-table td { border-bottom: 1px solid #000; color: #000 !important; background: none !important; }
  .lg-table tr { break-inside: avoid; }
  .lg-table code, .lg-doc code { background: none; border: 1px solid #999; }
  .lg-tag { box-shadow: none !important; background: none !important; color: #000 !important; border: 1px solid #000; }
  .lg-contact { background: none !important; color: #000 !important; border: 1px solid #000; }
  .lg-contact dt, .lg-contact dd, .lg-contact a, .lg-contact-top b { color: #000 !important; }
  .lg-contact-top img { display: none; }
  .lg-doc a:not(.btn) { color: #000 !important; }
  .lg-doc a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 400; font-size: .9em; }
}
