/* ===========================================================================
   What Can You REALLY See in Seismic?
   Shared stylesheet — OU crimson / cream identity
   =========================================================================== */

:root {
  --ink:        #16191C;
  --ink-soft:   #2C3239;
  --paper:      #E2E6EA;
  --panel:      #FFFFFF;
  --crimson:    #841617;
  --crimson-dp: #5A0E0F;
  --cream:      #F5ECEB;
  --cream-edge: #E6D9AE;
  --slate:      #5C6670;
  --rule:       rgba(22, 25, 28, 0.14);

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1220px;
}

* { box-sizing: border-box; }

/* author display rules outrank the UA sheet's [hidden] rule, so make it stick */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* Crimson hairline that runs across the very top of every page */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--crimson-dp), var(--crimson) 45%, #A8302C);
}

a { color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--crimson-dp); }

:focus-visible {
  outline: 2.5px solid var(--crimson);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- eyebrow / labels ---------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crimson);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* --- site header --------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 0;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand b { color: var(--crimson); font-weight: 600; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--crimson);
  flex: none;
}
.masthead nav { display: flex; gap: 20px; font-size: 13px; }
.masthead nav a { color: var(--slate); text-decoration: none; }
.masthead nav a:hover { color: var(--crimson); }

/* --- hero ---------------------------------------------------------------- */

.hero { padding: 44px 0 20px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

h1.title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: -0.026em;
  margin: 0 0 20px;
  text-wrap: balance;
}
h1.title em {
  font-style: normal;
  color: var(--crimson);
  position: relative;
  white-space: nowrap;
}
/* underline that reads like a picked horizon */
h1.title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.07em;
  height: 5px;
  background: var(--cream);
  border-bottom: 2px solid var(--crimson);
  z-index: -1;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 26px;
}
.lede strong { color: var(--ink); font-weight: 600; }

/* --- hero live panel ----------------------------------------------------- */

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(22,25,28,.05), 0 14px 34px -20px rgba(22,25,28,.4);
  padding: 14px 14px 10px;
}
.hero-panel canvas { display: block; width: 100%; height: auto; }
.hero-cap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  padding-top: 9px;
  margin-top: 9px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.hero-cap b { color: var(--crimson); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-size: 14px; font-weight: 500;
  padding: 11px 20px;
  border: 1px solid var(--crimson);
  background: var(--crimson);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--crimson-dp); border-color: var(--crimson-dp); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--crimson); }
.btn.ghost:hover { background: var(--cream); color: var(--crimson-dp); }
.btn.small { padding: 7px 13px; font-size: 12.5px; }

/* --- primer strip -------------------------------------------------------- */

.primer {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 40px;
  padding: 30px 0;
}
.primer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.primer h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--crimson); margin: 0 0 8px;
}
.primer p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
.primer .eq {
  font-family: var(--mono); font-size: 15px; color: var(--ink);
  background: var(--cream); border-left: 3px solid var(--crimson);
  padding: 5px 10px; display: inline-block; margin-bottom: 9px;
}

/* --- module cards -------------------------------------------------------- */

.modules { padding: 46px 0 30px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  position: relative;
  overflow: hidden;
}
a.card:hover {
  transform: translateY(-3px);
  border-color: rgba(132,22,23,.5);
  box-shadow: 0 16px 30px -22px rgba(22,25,28,.55);
}
.card canvas { display: block; width: 100%; height: auto; background: #fff; }
.card-body { padding: 15px 17px 18px; flex: 1; display: flex; flex-direction: column; }
.card-no {
  font-family: var(--mono); font-size: 11px; color: var(--crimson);
  letter-spacing: .1em; margin-bottom: 5px;
}
.card h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.14rem;
  margin: 0 0 6px; line-height: 1.2; letter-spacing: -0.012em;
}
.card p { margin: 0; font-size: 13.6px; color: var(--slate); line-height: 1.5; }
.card .q {
  margin-top: 10px; font-size: 13px; color: var(--ink-soft);
  border-left: 2px solid var(--cream-edge); padding-left: 10px; font-style: italic;
}

.card.planned { opacity: .62; }
.card.planned .thumb {
  height: 96px; background: repeating-linear-gradient(
    -45deg, #fff, #fff 7px, #F4F4F1 7px, #F4F4F1 14px);
  border-bottom: 1px solid var(--rule);
}
.flag {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .11em;
  text-transform: uppercase; padding: 3px 7px;
  background: var(--ink); color: #fff;
}
.flag.next { background: var(--crimson); }

/* --- next module ---------------------------------------------------------- */

.nextup {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--crimson);
  padding: 16px 20px 18px;
  margin: 26px 0 2px;
}
.nextup .eyebrow { margin-bottom: 9px; }
.nextup h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.24rem;
  margin: 0 0 7px; letter-spacing: -0.012em; line-height: 1.2;
}
.nextup h3 a { color: var(--ink); text-decoration: none; }
.nextup h3 a:hover { color: var(--crimson); }
.nextup p { margin: 0 0 13px; font-size: 14.5px; color: var(--ink-soft); max-width: 82ch; }
.nextup .btn { margin-right: 8px; }

/* --- disclaimer ---------------------------------------------------------- */

.disclaimer {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--slate);
  padding: 15px 20px 16px;
  margin: 10px 0 6px;
}
.disclaimer h4 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--slate); margin: 0 0 7px;
}
.disclaimer p {
  margin: 0; font-size: 13.5px; color: var(--ink-soft); max-width: 96ch; line-height: 1.55;
}
.disclaimer p + p { margin-top: 7px; }
.disclaimer b { color: var(--ink); font-weight: 600; }

/* --- footer -------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--rule);
  margin-top: 26px; padding: 28px 0 50px;
  font-size: 13.5px; color: var(--slate);
}
footer .foot-grid { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
footer p { margin: 0 0 6px; max-width: 62ch; }

/* ===========================================================================
   MODULE PAGES
   =========================================================================== */

.mod-head { padding: 22px 0 18px; border-bottom: 1px solid var(--rule); }
.mod-head h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -0.022em;
  margin: 8px 0 8px; line-height: 1.03;
}
.mod-head .sub { margin: 0; color: var(--ink-soft); max-width: 92ch; font-size: 15.5px; }

.lab {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 26px;
  padding: 26px 0 10px;
  align-items: start;
}

/* control rail */
.rail {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 16px 16px 18px;
  position: sticky; top: 14px;
}
.rail h2, .ctl-col h2 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--crimson);
  margin: 0 0 13px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.rail h2:not(:first-child) { margin-top: 22px; }

/* --- controls as a band across the top (used by the fault module) -------- */

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 4px 26px;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 17px 22px 20px;
  margin-top: 20px;
}
.ctl-col { min-width: 0; }
.ctl-col h2 { margin-top: 0; }
.ctl-col .btn { width: 100%; justify-content: center; margin-top: 7px; }

/* --- editable layer table (1D model module) ------------------------------ */

.ltab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ltab th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--slate); font-weight: 500;
  text-align: left; padding: 0 5px 6px; white-space: nowrap;
}
.ltab td { padding: 3px 5px; border-top: 1px solid var(--rule); vertical-align: middle; }
.ltab input {
  width: 100%; min-width: 54px;
  font-family: var(--mono); font-size: 12.5px; padding: 4px 6px;
  border: 1px solid var(--rule); background: #fff; color: var(--ink);
}
.ltab input:disabled { background: #F4F5F3; color: var(--slate); }
.ltab .ro {
  font-family: var(--mono); font-size: 12px; color: var(--crimson-dp);
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ltab .name { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.ltab .chip {
  width: 15px; height: 15px; display: inline-block; vertical-align: -3px;
  border: 1px solid rgba(22,25,28,.3); margin-right: 7px;
}
.ltab .rowbtn {
  border: 1px solid var(--rule); background: #fff; color: var(--slate);
  font-family: var(--mono); font-size: 13px; line-height: 1;
  padding: 4px 7px; cursor: pointer;
}
.ltab .rowbtn:hover { border-color: var(--crimson); color: var(--crimson); }
.tab-wrap { overflow-x: auto; }

/* --- stat strip under the section --------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 16px;
}
.stat {
  background: var(--cream);
  padding: 8px 12px 9px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.stat span { font-size: 11px; color: var(--ink-soft); line-height: 1.32; }
.stat b {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--crimson-dp); font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat.key { background: var(--crimson); }
.stat.key span { color: rgba(255,255,255,.82); }
.stat.key b { color: #fff; font-size: 15px; }
.stat.wide { grid-column: span 2; }
@media (max-width: 520px) {
  .stat.wide { grid-column: span 1; }
}

.ctl { margin-bottom: 14px; }
.ctl label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px; gap: 8px;
}
.ctl label .val {
  font-family: var(--mono); font-size: 12.5px; color: var(--crimson);
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.ctl input[type=range] {
  width: 100%; margin: 0; height: 18px;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.ctl input[type=range]::-webkit-slider-runnable-track {
  height: 3px; background: var(--rule);
}
.ctl input[type=range]::-moz-range-track { height: 3px; background: var(--rule); }
.ctl input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--crimson); margin-top: -6px; cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--crimson);
}
.ctl input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff;
  background: var(--crimson); cursor: pointer; box-shadow: 0 0 0 1px var(--crimson);
}
.ctl select, .ctl input[type=number] {
  width: 100%; font-family: var(--body); font-size: 13px;
  padding: 6px 8px; border: 1px solid var(--rule); background: #fff; color: var(--ink);
}

.seg { display: flex; border: 1px solid var(--rule); }
.seg button {
  flex: 1; font-family: var(--body); font-size: 12px; padding: 7px 4px;
  background: #fff; border: 0; border-right: 1px solid var(--rule);
  color: var(--slate); cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--crimson); color: #fff; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 9px; }
.check input { accent-color: var(--crimson); width: 15px; height: 15px; }

.rail .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* readouts */
.readout {
  background: var(--cream); border: 1px solid var(--cream-edge);
  padding: 11px 12px; margin-top: 4px;
}
.readout dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.readout dt { font-size: 12px; color: var(--ink-soft); }
.readout dd {
  margin: 0; font-family: var(--mono); font-size: 12.5px;
  color: var(--crimson-dp); font-weight: 500; text-align: right;
  font-variant-numeric: tabular-nums;
}
.readout dd.big { font-size: 14px; color: var(--crimson); }

/* plot stack */
.stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.plot {
  background: var(--panel); border: 1px solid var(--rule); padding: 13px 14px 12px;
}
.plot-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 9px; flex-wrap: wrap;
}
.plot-head h3 {
  font-family: var(--display); font-size: 1rem; font-weight: 700;
  margin: 0; letter-spacing: -0.008em;
}
.plot-head .hint { font-family: var(--mono); font-size: 10.5px; color: var(--slate); }
.plot canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }

/* section and its trace panel, side by side and sharing a time axis */
.sec-row { display: flex; gap: 10px; align-items: flex-start; }
.sec-row canvas { width: auto; flex: none; }
@media (max-width: 700px) {
  .sec-row { flex-direction: column; gap: 14px; }
}

/* stacked panels: layer model, seismic, traces */
#modelWrap { margin-bottom: 16px; }
.panel-col { flex: none; min-width: 0; max-width: 100%; }
.hint-line {
  font-family: var(--mono); font-size: 10.5px; color: var(--slate);
  margin: -4px 0 12px;
}
.sublabel {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 6px; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
}
.sublabel b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: none;
  background: var(--crimson); color: #fff;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0; border-radius: 50%;
}
.sublabel .note {
  text-transform: none; letter-spacing: 0; color: var(--slate);
  font-size: 10.5px;
}
/* Panels in a row must start at the same height, or their plot boxes will not
   line up. A caption that wraps to two lines in a narrow column would otherwise
   push its canvas down relative to its neighbours. */
.sec-row .sublabel { min-height: 30px; align-content: flex-start; }

.legend {
  display: flex; gap: 7px 14px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10.5px; color: var(--slate);
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule);
  min-width: 0; max-width: 100%;
}
.legend span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.legend i {
  width: 15px; height: 0; flex: none;
  border-top-width: 2px; border-top-style: solid; display: inline-block;
}
.legend i.sw {
  width: 15px; height: 10px; border: 1px solid rgba(22,25,28,.35);
  border-top-width: 1px;
}

/* teaching blocks */
/* The bar above the teaching blocks, carrying the pop-out button. */
.teach-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 26px 0 0; }
.teach-head .hint { font-size: 12.5px; color: var(--crimson); }

.teach { display: grid; grid-template-columns: 1.12fr 1fr; gap: 22px; padding: 14px 0 10px; }
@media (min-width: 1100px) {
  .takeaway ul { columns: 2; column-gap: 26px; }
  .takeaway li { break-inside: avoid; }
}

.tryit {
  background: var(--cream); border: 1px solid var(--cream-edge);
  border-left: 4px solid var(--crimson); padding: 18px 22px 20px;
}
.tryit h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--crimson-dp); margin: 0 0 12px;
}
.tryit ol { margin: 0; padding-left: 19px; }
.tryit li { margin-bottom: 12px; font-size: 14.5px; }
.tryit li:last-child { margin-bottom: 0; }
.tryit li b { font-weight: 600; }
.tryit .ans {
  display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-soft);
}

.takeaway { background: var(--panel); border: 1px solid var(--rule); padding: 18px 22px 20px; }
.takeaway h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--crimson); margin: 0 0 12px;
}
.takeaway ul { margin: 0; padding-left: 18px; }
.takeaway li { margin-bottom: 10px; font-size: 14.5px; }
.takeaway li:last-child { margin-bottom: 0; }

code, .k { font-family: var(--mono); font-size: 0.92em; background: rgba(22,25,28,.055); padding: 1px 5px; }

details.notes { margin: 22px 0 0; border-top: 1px solid var(--rule); padding-top: 14px; }
details.notes summary {
  cursor: pointer; font-family: var(--mono); font-size: 11px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--crimson);
}
details.notes p, details.notes li { font-size: 14px; color: var(--ink-soft); max-width: 92ch; }

.pager {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 26px 0 0; margin-top: 22px; border-top: 1px solid var(--rule); flex-wrap: wrap;
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .primer-grid { grid-template-columns: 1fr; gap: 22px; }
  .lab { grid-template-columns: 1fr; }
  .rail { position: static; }
  .teach { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .masthead nav { gap: 14px; }
  h1.title { font-size: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  a.card:hover, .btn:hover { transform: none; }
}

@media print {
  .rail, .masthead nav, .pager, .btn { display: none; }
  body { background: #fff; }
  .lab { grid-template-columns: 1fr; }
}
