/* Chosen reading system - Roboto interface, Georgia body copy.

   Loaded on every visit. Reading surfaces (family profiles, chrome) use
   Roboto for UI/headings and Georgia for long-form copy. The printable
   poster and PNG export stay on the original system stack.
   Add ?type=system to the URL to restore the original digital stack. */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300..800&display=swap');

:root {
  --type: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --display: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --type-reading: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --reading-size: 16.5px;
  --reading-leading: 1.65;
  --list-size: 15.5px;
  --list-leading: 1.6;
  --card-reading-size: 14px;
  --card-reading-leading: 1.6;
}

/* Escape hatch: original digital typography, zero other changes. */
html[data-type="system"] {
  --type: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}
html[data-type="roboto"] {
  --type-reading: var(--type);
  --reading-size: 16px;
  --reading-leading: 1.6;
  --list-size: 15px;
  --list-leading: 1.55;
  --card-reading-size: 13.5px;
  --card-reading-leading: 1.55;
}

/* Print output and the poster keep the pre-experiment stack. */
.poster {
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

html:not([data-type="system"]) .controls,
html:not([data-type="system"]) .navigator,
html:not([data-type="system"]) .atlas-backdrop { font-optical-sizing: auto; }

/* Overlay controls that originally pinned the system stack. */
.atlas-rail-nav button,
.atlas-rail-close { font-family: var(--type); }

/* ---------- Reading type ---------- */

html:not([data-type="system"]) .atlas-section > p,
html:not([data-type="system"]) .atlas-callout,
html:not([data-type="system"]) .atlas-when li,
html:not([data-type="system"]) .atlas-tactic-facts dd,
html:not([data-type="system"]) .atlas-practical li,
html:not([data-type="system"]) .atlas-editorial {
  font-family: var(--type-reading);
}

html:not([data-type="system"]) .atlas-section > p,
html:not([data-type="system"]) .atlas-callout {
  font-size: var(--reading-size);
  line-height: var(--reading-leading);
}
html:not([data-type="system"]) .atlas-section > p { max-width: 68ch; }

html:not([data-type="system"]) .atlas-when li {
  font-size: var(--list-size);
  line-height: var(--list-leading);
}

html:not([data-type="system"]) .atlas-tactic-facts dd,
html:not([data-type="system"]) .atlas-practical li {
  font-size: var(--card-reading-size);
  line-height: var(--card-reading-leading);
}

html:not([data-type="system"]) .atlas-tactic-name { font-size: 15px; }
html:not([data-type="system"]) .atlas-tactic-line { font-size: 12.5px; }
html:not([data-type="system"]) .atlas-mini-empty { font-size: 12px; }
html:not([data-type="system"]) .atlas-example-meta p:last-child { font-size: 12.5px; }
html:not([data-type="system"]) .atlas-editorial { font-size: 12.5px; }
html:not([data-type="system"]) .atlas-sec-head h3 { letter-spacing: -.025em; }
html:not([data-type="system"]) .atlas-head h2 { letter-spacing: -.04em; }

/* Room for the comparison bar when it is present. */
body.type-test .atlas-scroll { padding-bottom: 96px; }

/* ---------- Comparison bar (only rendered with ?type=) ---------- */

.type-experiment {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 7px 5px 11px;
  border: 1px solid rgba(20, 30, 45, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .2);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #4c5562;
}
.type-experiment-label {
  margin-right: 5px;
  color: #7a8390;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.type-experiment button,
.type-experiment-off {
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #55606e;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.type-experiment button:hover,
.type-experiment-off:hover { color: #17191d; }
.type-experiment button[aria-pressed="true"] {
  background: #17191d;
  color: #fff;
}
.type-experiment button:focus-visible,
.type-experiment-off:focus-visible {
  outline: 2px solid rgba(8, 115, 228, .6);
  outline-offset: 1px;
}
.type-experiment-off {
  margin-left: 3px;
  border-left: 1px solid rgba(20, 30, 45, .12);
  border-radius: 0 999px 999px 0;
  color: #8b93a0;
}

@media (max-width: 700px) {
  .type-experiment { bottom: 10px; padding-left: 8px; }
  .type-experiment-label { display: none; }
  .type-experiment button,
  .type-experiment-off { padding: 7px 8px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-type="system"]) * { scroll-behavior: auto; }
}

@media print {
  .type-experiment { display: none !important; }
}
