/* ==========================================================================
   pages.css — inner pages, tables, figures, and the blocks the home page
   shares with them.
   ========================================================================== */

/* ==========================================================================
   Page hero
   ========================================================================== */

.page-hero {
  position: relative;
  padding-block: clamp(34px, 5vw, 60px) clamp(28px, 4vw, 44px);
  /* `clip`, not `hidden`: hidden creates a scroll container and breaks
     position:sticky on the header. A decorative bleed on a sibling
     overflowed every inner page by 177px, and the element-naming probe
     came back empty because the culprit was a pseudo-element. */
  overflow: clip;
  background:
    radial-gradient(90% 130% at 8% 0%, var(--indigo-wash) 0%, transparent 62%),
    radial-gradient(70% 120% at 96% 6%, var(--rose-wash) 0%, transparent 58%),
    var(--ground);
  border-bottom: 1px solid var(--rule-2);
}
.page-hero h1 {
  font-family: var(--display);
  font-size: var(--t-h1);
  font-weight: 300;
  letter-spacing: -0.028em;
  margin-block: 14px 18px;
  max-width: 20ch;
}
.page-hero h1 em { color: var(--accent); font-style: italic; }
.page-hero .lead { max-width: 62ch; }

.page-state {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--rule-2);
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 62ch;
}
.page-state .state { position: relative; top: 1px; }

/* ==========================================================================
   Prose
   ========================================================================== */

.page h2 {
  font-family: var(--display);
  font-size: var(--t-h2);
  font-weight: 300;
  letter-spacing: -0.022em;
  margin-bottom: 18px;
}
.page h2 em { color: var(--accent); font-style: italic; }
.page h3 { font-family: var(--display); font-size: var(--t-h3); font-weight: 500; }
.sub-head {
  font-family: var(--display); font-size: 1.32rem; font-weight: 500;
  margin-block: 44px 16px;
}
.page p { color: var(--ink-2); }
.page p + p { margin-top: 14px; }
.page a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.page a:not(.btn):hover { text-decoration-color: currentColor; }

/* THE MARKER IS ABSOLUTELY POSITIONED, NOT A GRID COLUMN, and that is not
   a style preference. A grid or flex container turns each contiguous run
   of inline content into its own anonymous item, so a list item
   containing `<b>` and `<code>` — which most of them do — became four
   grid items flowing into a two-column track and overlapping each other.
   The same mechanism ate the whitespace in a `.btn` label. Any new list
   marker in this file uses padding plus an absolute ::before. */
.prose-list { display: grid; gap: 13px; margin-block: 18px; }
.prose-list li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-2); font-size: 0.97rem;
  min-width: 0;
}
.prose-list li::before {
  content: ''; position: absolute; left: 0; top: .58em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); opacity: .7;
}
.prose-list.tight { gap: 9px; margin-block: 12px 0; font-size: var(--t-small); }

.formula {
  background: var(--plate-2);
  border-radius: var(--r-sm);
  box-shadow: var(--lift-1);
  padding: 18px 20px;
  margin-block: 20px 22px;
  overflow-x: auto;
  min-width: 0;
}
.formula code {
  background: none; padding: 0;
  font-size: 0.95rem; color: var(--ink);
  white-space: nowrap;
}
.formula-wide { margin-bottom: 26px; }

.callout {
  margin-block: 26px;
  padding: 20px 22px;
  border-radius: var(--r-sm);
  background: var(--indigo-wash);
  border-left: 3px solid var(--indigo);
}
.callout p { color: var(--ink); font-size: var(--t-small); }
.callout-hard { background: var(--rose-wash); border-left-color: var(--rose); }

.note {
  margin-top: 20px;
  font-size: var(--t-small);
  color: var(--ink-3);
  max-width: 68ch;
}
.center { text-align: center; }
.unset { font-family: var(--mono); font-size: 0.86em; color: var(--faint); }

.split { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: 24px; }
.split-wide { margin-block: 30px; }
@media (max-width: 720px) { .split { grid-template-columns: minmax(0, 1fr); } }
.split .tablet h3 { margin-bottom: 10px; }
.split .tablet p { font-size: var(--t-small); }

/* ==========================================================================
   Tables
   ========================================================================== */

.grid-table {
  font-size: var(--t-small);
  min-width: 0;
}
.grid-table th, .grid-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
}
.grid-table thead th {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom-color: var(--rule);
  white-space: nowrap;
}
.grid-table tbody th {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.grid-table td { color: var(--ink-2); }
.grid-table tbody tr:last-child th, .grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table .num, .grid-table .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.params tbody th code { background: none; padding: 0; color: var(--ink); }
/* Every parameter table sizes to the same grid, so the same five headers
   sit at the same x position in all four groups. Sized to the widest
   column set, and the wrapper scrolls rather than the page. */
.params { min-width: 720px; }
.param-group { margin-bottom: 34px; }
.param-group h3 {
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}

.lex { min-width: 640px; }
.lex tbody th { color: var(--accent); font-family: var(--display); font-size: 1.05rem; font-weight: 500; }

.lustre-table { min-width: 680px; }
.lustre-table .sign { font-family: var(--mono); font-size: 1.1rem; text-align: center; width: 3ch; }
.sign-pos { color: var(--teal); }
.sign-neg { color: var(--rose); }
.sign-none { color: var(--ink-3); }

/* ==========================================================================
   Figures
   ========================================================================== */

.figure-wide { margin-block: 30px; }
.figure svg { display: block; width: 100%; height: auto; }
.fig-t { font-family: var(--mono); font-size: 11px; fill: var(--faint); }
.fig-l { font-family: var(--sans); font-size: 13px; font-weight: 500; fill: var(--ink); }
.fig-s { font-family: var(--sans); font-size: 12px; fill: var(--ink-3); }
.figure figcaption { max-width: 92ch; }
.figure figcaption a { color: var(--accent); }
.figure figcaption b { color: var(--ink-2); }

/* ==========================================================================
   Home-page blocks that inner pages reuse
   ========================================================================== */

.thesis-body { margin-inline: auto; }
.thesis-body p { font-size: var(--t-lead); }
.thesis-body p + p { margin-top: 16px; }
.thesis-claim {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem) !important;
  font-weight: 400;
  line-height: 1.32;
  color: var(--ink) !important;
  letter-spacing: -0.014em;
  margin-bottom: 22px;
}
.thesis-choice {
  margin-top: 22px !important;
  padding: 20px 22px;
  border-radius: var(--r-sm);
  background: var(--plate-2);
  box-shadow: var(--lift-1);
  font-size: var(--t-body) !important;
  color: var(--ink) !important;
}

.rail-term {
  font-size: var(--t-micro); letter-spacing: .14em;
  text-transform: uppercase; color: var(--edge, var(--accent));
}
.rail-more { margin-top: 16px; font-size: var(--t-small); }
.rail-more a { color: var(--edge, var(--accent)); font-weight: 600; }

.g-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.g-head h3 { font-family: var(--display); font-size: var(--t-h3); }
.tablet.gap { background: var(--rose-wash); }
.tablet.gap::before { background: var(--rose); opacity: .8; }
.rests {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--rule-2);
  font-size: var(--t-micro); color: var(--ink-3);
}
.rests span {
  font-family: var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
  margin-right: .6em;
}

.phase-n { font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--edge, var(--accent)); }
.phase ul { margin-top: 14px; display: grid; gap: 9px; }
.phase li {
  position: relative; padding-left: 22px;
  font-size: var(--t-small); color: var(--ink-2); min-width: 0;
}
.phase li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--edge, var(--accent));
}

.tablet .big {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--edge, var(--accent));
  margin-bottom: 10px;
}
.tablet.gap .big { color: var(--rose); }
.tablet .big + p { font-size: var(--t-small); }

/* ==========================================================================
   The fifteen
   ========================================================================== */

.rules { display: grid; gap: 12px; counter-reset: rule; }
.rule {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  background: var(--plate-2);
  border-radius: var(--r-sm);
  box-shadow: var(--lift-1);
  padding: 20px 22px;
  min-width: 0;
}
.rule-n { font-size: 1.05rem; color: var(--accent); font-weight: 500; }
.rule-t { font-size: 1.03rem; font-weight: 600; color: var(--ink) !important; }
.rule-s { margin-top: 8px !important; font-size: var(--t-small); }
.rule-c { margin-top: 12px !important; font-size: var(--t-micro); color: var(--ink-3) !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .rule { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ==========================================================================
   Palette swatches
   ========================================================================== */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-block: 8px 30px;
  min-width: 0;
}
.sw {
  background: var(--plate-2);
  border-radius: var(--r-sm);
  box-shadow: var(--lift-1);
  padding: 14px;
  display: grid; gap: 3px;
  min-width: 0;
}
.sw-chip { height: 52px; border-radius: 8px; margin-bottom: 8px; }
.sw b { font-size: var(--t-small); text-transform: capitalize; }
.sw span { font-size: var(--t-micro); color: var(--ink-2); }
.sw .faint { color: var(--faint); }

/* ==========================================================================
   FAQ page
   ========================================================================== */

.faq-group { margin-bottom: 40px; }
.faq-group h2 {
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ==========================================================================
   Footer disclosure + CA
   ========================================================================== */

.demo-note {
  margin-top: 38px;
  padding: 18px 20px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--plate-2) 5%, transparent);
  border-left: 3px solid var(--indigo-on-deep);
}
.demo-note p { font-size: var(--t-small); color: var(--ink-2-on-deep); }
.demo-note strong, .demo-note em { color: var(--ink-on-deep); }
.demo-note code {
  background: color-mix(in srgb, var(--plate-2) 8%, transparent);
  color: var(--ink-on-deep);
}
.demo-note a { color: var(--indigo-on-deep); text-decoration: underline; text-underline-offset: 2px; }

.ca-pill {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 20px; padding: 7px 8px 7px 14px;
  border-radius: var(--r-pill);
  background: var(--plate-2); box-shadow: var(--lift-1);
  font-size: var(--t-micro);
}
.ca-l { color: var(--faint); letter-spacing: .1em; }
.ca-v { color: var(--ink); }

/* ==========================================================================
   Reflow discipline.

   Grid and flex items default to min-width:auto, whose content-based
   minimum is the widest unbreakable descendant. One nowrap label three
   levels down set a grid track and panned a whole sibling site sideways —
   234px of overflow at 320px, a WCAG 1.4.10 failure that passed all 57 of
   that site's file checks, on the page its entire argument rested on.

   An enumerated list is a list someone has to remember to extend, so the
   base rules in base.css cap `.grid > *` and `.wrap`. These are the
   containers those two do not reach.
   ========================================================================== */

.page, .page-hero, .split, .split > *, .ba, .ba > *, .flow, .flow > *,
.rules, .rule, .rule > *, .swatches, .sw, .foot-grid, .foot-grid > *,
.strip-inner, .header-inner, .readout, .faq, .faq details,
.thesis-body, .figure, .param-group, .callout, .formula {
  min-width: 0;
}

@media (max-width: 560px) {
  /* Touch targets: padding rather than min-height, so the desktop rhythm
     survives untouched. */
  .foot-col a { padding-block: .55rem; }
  .icon-link { width: 40px; height: 40px; }
  .grid-table th, .grid-table td { padding: 10px 11px; }
}

@media print {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .header, .sheet, .hero-field, .foot-social { display: none !important; }
}
