/* Relativistic Optics Lab — shared engineering-grade style
   Light theme, calm palette, no animations. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-card: #fbfcfd;
  --ink: #1f2933;
  --ink-soft: #4b5563;
  --ink-mute: #6b7280;
  --rule: #d8dee4;
  --rule-soft: #e5e7eb;
  --accent: #1f4e8a;     /* steel blue */
  --accent-soft: #e8eef7;
  --good: #16a34a;
  --good-bg: #f0fdf4;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --code-bg: #f3f4f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 22px;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  padding: 14px 0;
}
.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05em;
}
.brand .brand-mark {
  color: var(--accent);
}
.nav { font-size: 0.95em; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 16px;
}
.nav a:hover, .nav a.active {
  color: var(--accent);
  text-decoration: underline;
}

h1, h2, h3, h4 { color: #12263a; }
h1 { font-size: 2em; margin: 30px 0 12px; }
h2 { font-size: 1.45em; margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }
h3 { font-size: 1.18em; margin: 22px 0 10px; }
h4 { font-size: 1.02em; margin: 18px 0 8px; }

p { margin: 12px 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
}
code { background: var(--code-bg); padding: 2px 5px; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.92em;
  line-height: 1.5;
}

table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 0.95em; }
th, td { border: 1px solid var(--rule); padding: 8px 10px; vertical-align: top; text-align: left; }
th { background: var(--bg-soft); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 14px 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.card-grid .card { margin: 0; }
.card h3 { margin-top: 0; }

/* Hero */
.hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
}
.hero h1 { margin-top: 0; }
.hero .subtitle {
  font-size: 1.15em;
  color: var(--ink-soft);
  margin: 6px 0 16px;
}
.hero .pitch {
  font-size: 1em;
  color: var(--ink);
  max-width: 760px;
  margin: 0 0 18px;
}
.cta-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: 1px solid var(--accent);
  padding: 9px 16px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none !important;
  font-size: 0.95em;
}
.btn:hover { background: #163d6b; border-color: #163d6b; }
.btn-outline {
  background: #fff;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); }

/* Callouts */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 4px 4px 0;
}
.callout.good { border-left-color: var(--good); background: var(--good-bg); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.bad  { border-left-color: var(--bad);  background: var(--bad-bg);  }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.badge.mvp     { background: var(--good-bg); color: var(--good); border: 1px solid #bbf7d0; }
.badge.planned { background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--rule); }
.badge.adv     { background: var(--accent-soft); color: var(--accent); border: 1px solid #c7d8ee; }
.badge.keep    { background: var(--bad-bg); color: var(--bad); border: 1px solid #fecaca; }
.badge.watch   { background: var(--warn-bg); color: var(--warn); border: 1px solid #fed7aa; }
.badge.ignore  { background: var(--good-bg); color: var(--good); border: 1px solid #bbf7d0; }

/* Form fields */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px;
  margin: 12px 0;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 0.92em;
  color: var(--ink-soft);
  font-weight: 600;
}
.field input, .field select {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.field .hint { font-size: 0.85em; color: var(--ink-mute); }

/* Output / term cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
}
.kpi .label {
  font-size: 0.85em;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi .value {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.kpi .unit { font-size: 0.7em; color: var(--ink-mute); font-weight: 400; margin-left: 4px; }

/* Footer */
.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 0.92em;
}
.site-footer a { color: var(--ink-soft); }
.site-footer .disclaimer { color: var(--ink-mute); font-size: 0.9em; margin-top: 8px; }

/* Manuscript banner */
.manuscript-banner {
  background: #e8f5e9;
  border-left: 6px solid #2e7d32;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 18px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.manuscript-banner h3 {
  color: #1b5e20;
  margin: 0 0 6px;
  font-size: 1.1em;
}
.manuscript-banner p { color: #1b5e20; margin: 4px 0; }
.manuscript-banner a { color: #1b5e20; font-weight: 600; text-decoration: underline; }

/* Two-column layout for calculator pages */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
@media (min-width: 980px) {
  .calc-layout { grid-template-columns: 360px minmax(0, 1fr); }
}
.calc-inputs { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; }
.calc-outputs { min-width: 0; }

.formula-block {
  background: var(--bg-soft);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.95em;
  overflow-x: auto;
}
.formula-block .label {
  display: block;
  font-size: 0.85em;
  color: var(--ink-mute);
  margin-bottom: 4px;
  font-weight: 600;
}

.assumptions-list, .warnings-list {
  margin: 8px 0; padding-left: 20px;
}
.assumptions-list li, .warnings-list li { margin: 4px 0; }

.small { font-size: 0.9em; color: var(--ink-soft); }
.mute { color: var(--ink-mute); }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }

hr { border: 0; border-top: 1px solid var(--rule-soft); margin: 28px 0; }

/* ====== Sample-calculation modal ====== */
.sample-cta {
  background: #fff7ed;
  border-left: 4px solid #d97706;
  border-radius: 0 4px 4px 0;
  padding: 12px 18px;
  margin: 16px 0 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.sample-cta strong { color: #7c2d12; }
.sample-cta .small { color: #7c2d12; }

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  max-width: 820px;
  width: 100%;
  margin: 4vh auto;
  box-shadow: 0 12px 36px rgba(0,0,0,0.32);
  display: flex; flex-direction: column;
  max-height: 92vh;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule);
}
.modal-header h3 { margin: 0; font-size: 1.15em; color: #12263a; }
.modal-close {
  background: none; border: none;
  font-size: 1.6em; line-height: 1; cursor: pointer;
  color: var(--ink-soft); padding: 0 10px; border-radius: 4px;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-body h4 {
  margin-top: 18px; margin-bottom: 8px;
  color: #12263a; font-size: 1em;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 4px;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body table { margin: 8px 0; font-size: 0.92em; }
.modal-body table th, .modal-body table td { padding: 6px 9px; }
.modal-body ul { margin: 8px 0; padding-left: 22px; }
.modal-body ul li { margin: 4px 0; }
.modal-body code { font-size: 0.88em; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
  border-radius: 0 0 8px 8px;
}
@media (max-width: 600px) {
  .modal-card { margin: 0; max-height: 100vh; border-radius: 0; }
  .modal-overlay { padding: 0; }
}

/* ---- "OUR LAB vs Einstein/NASA vs Measured" banner inside the sample modal ---- */
.public-comparison {
  background: #e8f5e9;
  border: 2px solid #2e7d32;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 0 0 22px;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
}
.pc-label {
  font-weight: 700;
  font-size: 0.95em;
  color: #1b5e20;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  text-align: center;
}
/* The big OUR-LAB box — most prominent element in the banner */
.pc-lab-box {
  background: #ffffff;
  border: 3px solid #1b5e20;
  border-radius: 6px;
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(27, 94, 32, 0.18);
}
.pc-lab-box .pc-lab-label {
  font-size: 0.85em;
  color: #1b5e20;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 8px;
}
.pc-lab-box .pc-lab-value {
  font-size: 2em;
  font-weight: 800;
  color: #1b5e20;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.1;
}
.pc-lab-box .pc-lab-context {
  font-size: 0.9em;
  color: #2e7d32;
  margin-top: 8px;
}
/* Theory + Measured cells side-by-side */
.pc-references {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pc-references.single { grid-template-columns: 1fr; }
.pc-reference-cell {
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
  border-radius: 4px;
  border: 1px solid #a5d6a7;
}
.pc-reference-label {
  font-size: 0.78em;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 6px;
}
.pc-reference-value {
  font-size: 1.15em;
  font-weight: 700;
  color: #1b5e20;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 4px;
}
.pc-reference-source {
  font-size: 0.8em;
  color: #2e7d32;
  font-style: italic;
}
.pc-reference-implies {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #66bb6a;
  background: rgba(165, 214, 167, 0.18);
  padding: 8px 8px 8px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.pc-implies-label {
  font-size: 0.72em;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 4px;
}
.pc-implies-value {
  font-size: 1.05em;
  font-weight: 700;
  color: #1b5e20;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.3;
}
.pc-agreement-summary {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  border-left: 4px solid #16a34a;
  font-size: 1em;
  color: #1b5e20;
  line-height: 1.5;
}
.pc-agreement-summary strong {
  color: #16a34a;
  font-size: 1.05em;
}
.pc-source {
  margin-top: 14px;
  font-size: 0.86em;
  color: #1b5e20;
  border-top: 1px solid #a5d6a7;
  padding-top: 10px;
}
@media (max-width: 600px) {
  .pc-references { grid-template-columns: 1fr; }
}
