/* PRINCIPIA PHYSICA — bounded pilot site.
   Self-contained: no external fonts, no CDN, no JavaScript. */

:root {
  --ink:        #0a0e17;
  --ink-2:      #101725;
  --surface:    #141c2c;
  --surface-2:  #1a2438;
  --border:     #2b3852;
  --border-hi:  #5b6f95;
  --text:       #eef3fb;
  --muted:      #bccbe2;
  --muted-dim:  #9fb0cb;
  --cyan:       #7ad3ff;
  --amber:      #f7b75b;
  --green:      #79dfae;
  --red:        #ff9d9d;
  --radius:     12px;
  --maxw:       1120px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--amber);
  color: #16130c;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- visually hidden (available to assistive tech) ---------- */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- focus ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #a9e2ff; }

/* ---------- spacing utilities ---------- */
.mt-0  { margin-top: 0 !important; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-34 { margin-top: 34px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

section { scroll-margin-top: 84px; }

.band { border-top: 1px solid var(--border); padding: 56px 0; }
.band:first-of-type { border-top: 0; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 5.2vw, 3.15rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }

p { margin: 0 0 14px; }
p.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 68ch; }
.section-intro { color: var(--muted); max-width: 72ch; }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cyan);
  margin: 0 0 10px;
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 14, 23, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: var(--text);
  text-decoration: none;
  padding: 10px 0;
}
.brand span { color: var(--cyan); }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  min-height: 44px;
  line-height: 24px;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }

/* ---------- hero ---------- */
.hero { padding: 60px 0 44px; background:
  radial-gradient(1100px 420px at 12% -8%, rgba(122, 211, 255, 0.10), transparent 62%),
  radial-gradient(760px 360px at 92% 0%, rgba(247, 183, 91, 0.07), transparent 60%); }
.hero h1 { max-width: 20ch; }
.thesis {
  margin: 26px 0 0;
  padding: 18px 22px;
  border-left: 4px solid var(--amber);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  max-width: 74ch;
}
.thesis strong { color: var(--text); font-family: var(--serif); }
.thesis cite { color: var(--muted-dim); font-style: normal; font-size: 0.9rem; display: block; margin-top: 8px; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stats .num {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--text);
}
.stats .lbl { display: block; font-size: 0.86rem; color: var(--muted-dim); margin-top: 4px; }

/* ---------- generic cards ---------- */
.grid { display: grid; gap: 18px; }
.grid > *, .stats > li, .labels > li { min-width: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); }
.card .meta {
  font-size: 0.82rem;
  color: var(--muted-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* ---------- paper cards ---------- */
.paper { display: flex; flex-direction: column; }
.paper .abstract { font-size: 0.97rem; }
.paper .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-hi);
  color: var(--text);
  background: var(--surface-2);
}
.btn:hover { background: #223052; color: var(--text); }
.btn-primary { background: var(--cyan); color: #06202e; border-color: var(--cyan); }
.btn-primary:hover { background: #a9e2ff; color: #06202e; }

.hashline {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-dim);
  line-height: 1.5;
}
.hashline span { color: var(--muted); }

/* ---------- label chips ---------- */
.labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 10px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  counter-reset: lbl;
}
.labels li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
}
.labels li::before {
  counter-increment: lbl;
  content: counter(lbl);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--amber);
  min-width: 1.4em;
}
.labels .count { margin-left: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--muted-dim); }

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: var(--radius);
}
.table-scroll:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.92rem; }
caption { text-align: left; color: var(--muted-dim); font-size: 0.86rem; padding-bottom: 10px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { color: var(--text); border-bottom: 2px solid var(--border-hi); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
td { color: var(--muted); }
td code, th code { font-size: 0.85em; }
td a, th a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  line-height: 24px;
}

code {
  font-family: var(--mono);
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.86em;
  color: var(--muted);
}

/* ---------- verdict pills ---------- */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pill-accept { color: var(--green); }
.pill-reject { color: var(--red); }
.pill-note   { color: var(--amber); }

/* ---------- callout ---------- */
.callout {
  border: 1px solid var(--border-hi);
  border-left: 4px solid var(--amber);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  margin: 22px 0 0;
}
.callout h3 { font-family: var(--sans); font-size: 1.05rem; }
.callout p:last-child { margin-bottom: 0; }
.callout ul { color: var(--muted); margin: 0; padding-left: 20px; }
.callout li { margin-bottom: 6px; }

ul.plain { list-style: none; margin: 18px 0 0; padding: 0; }
ul.plain li { color: var(--muted); padding: 8px 0 8px 22px; border-bottom: 1px solid var(--border); position: relative; }
ul.plain li::before { content: "—"; position: absolute; left: 0; color: var(--amber); }
ul.plain li:last-child { border-bottom: 0; }

.file-list { list-style: none; margin: 18px 0 0; padding: 0; }
.file-list li { border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list a {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  min-height: 44px;
  padding: 13px 8px;
  text-decoration: none;
  border-radius: 8px;
}
.file-list a:hover { background: var(--surface-2); }
.file-list .path { font-family: var(--mono); font-size: 0.85rem; }
.file-list .what { color: var(--muted); font-size: 0.9rem; }

/* ---------- social card preview ---------- */
.colophon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 24px; align-items: start; }
.og-preview { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); display: block; }
figure { margin: 0; }
figcaption { color: var(--muted-dim); font-size: 0.84rem; margin-top: 8px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 46px;
  color: var(--muted-dim);
  font-size: 0.9rem;
}
.site-footer p { max-width: 76ch; }

@media (max-width: 760px) {
  .site-header { position: static; }
  section { scroll-margin-top: 16px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .band { padding: 40px 0; }
  .hero { padding: 40px 0 32px; }
  .card { padding: 18px; }
  table { min-width: 460px; }
}
