/* style.css — shared styles for every page.
 * Palette follows example_wave.mp4 (azure/cyan ramp) with the background
 * pulled darker per README ("soft dark violet/blue"). No frameworks, no
 * webfonts, works over file://.
 */

:root {
  --bg-0: #04060c;            /* deepest page background            */
  --bg-1: #070b18;            /* dark indigo-navy                   */
  --bg-2: #0d2440;            /* deep azure (video sky, darkened)   */
  --line: #1089c4;            /* mesh mid-bright, sampled           */
  --line-soft: rgba(16, 137, 196, 0.28);
  --crest: #1bbeeb;           /* sampled crest                      */
  --hot: #7deeff;             /* hot crest core                     */
  --text: #dff2ff;
  --text-dim: #8fb8d4;
  --card: rgba(9, 20, 38, 0.58);
  --card-edge: rgba(31, 166, 220, 0.22);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 70%);
  min-height: 100vh;
  line-height: 1.6;
}

body.home { background: var(--bg-0); }

::selection { background: rgba(27, 190, 235, 0.35); }

a { color: var(--crest); }
a:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; }

/* ---------- background canvas (homepage) ---------- */

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

/* ---------- page frame ---------- */

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- top nav ---------- */

.site-nav {
  display: flex;
  justify-content: center;
  padding: 1.1rem 1rem 0.9rem;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.2rem 0.1rem;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.site-nav a:hover { color: var(--hot); }

.site-nav a[aria-current="page"] {
  color: var(--crest);
  border-bottom-color: var(--crest);
}

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

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 16vh;      /* sit the title in the open sky, above the ridge */
}

.kicker {
  margin: 0 0 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6.5vw, 3.8rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #eafaff;
  text-shadow:
    0 0 18px rgba(27, 190, 235, 0.55),
    0 0 60px rgba(16, 137, 196, 0.35);
}

.tagline {
  margin: 0.9rem 0 2.6rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  font-size: 0.92rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 0.8rem;
  max-width: 44rem;
}

.hero-links a {
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.hero-links a:hover {
  color: var(--hot);
  border-color: var(--crest);
  box-shadow: 0 0 16px rgba(27, 190, 235, 0.25);
}

/* ---------- inner pages ---------- */

.content {
  flex: 1;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 3rem;
}

.page-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title::after {
  content: "";
  display: block;
  width: 6.5rem;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #123a63, #0b5a94, #1089c4, #1bbeeb, #7deeff);
}

.lede {
  color: var(--text-dim);
  max-width: 40rem;
  margin: 1rem 0 2rem;
}

section + section { margin-top: 1.6rem; }

h2 {
  font-size: 1.02rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crest);
  margin: 0 0 0.7rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.grid .card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.grid .card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

a.card:hover {
  border-color: var(--crest);
  box-shadow: 0 0 18px rgba(27, 190, 235, 0.18);
  transform: translateY(-2px);
}

a.card h3 { color: var(--crest); }

/* the grouped simulations catalog: more air between subject sections */
.sim-catalog section + section { margin-top: 2.4rem; }

.placeholder-panel {
  border: 1px dashed var(--line-soft);
  border-radius: 12px;
  padding: 2.6rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* ---------- teaching network page (the void) ---------- */

body.net-page {
  overflow: hidden;             /* the void is the page; wheel = zoom */
}

#net {
  position: fixed;
  inset: 0;
  z-index: 0;
  touch-action: none;           /* drag/pinch go to the canvas, not the page */
}

/* The overlay spans the viewport ABOVE the canvas — without this it swallows
 * every pointer/wheel event and pan/zoom/click-travel go dead. Events pass
 * through the dead space; only nav links and the panel stay interactive. */
.net-page .page { position: relative; z-index: 1; pointer-events: none; }
.net-page .site-nav nav,
.net-page .net-panel { pointer-events: auto; }

.net-panel {
  position: fixed;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  max-width: 21.5rem;
  background: rgba(5, 7, 12, 0.72);
  border: 1px solid rgba(235, 242, 255, 0.14);
  border-radius: 12px;
  padding: 0.95rem 1.1rem 1rem;
  backdrop-filter: blur(8px);
}

.net-panel h2 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #eef4ff;
}

.net-sub {
  margin: 0 0 0.65rem;
  color: #8fa3c0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* the way out of the void: the current orb's page in the modules browser
 * (teaching_network.js fills it; hidden on the overview and on stub trunks) */
.net-panel [hidden] { display: none !important; }

.net-module {
  display: inline-block;
  margin: 0 0 0.7rem;
  color: var(--crest);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(27, 190, 235, 0.45);
  padding-bottom: 1px;
}

.net-module:hover {
  color: var(--hot);
  border-bottom-color: var(--hot);
}

.net-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow-y: auto;
}

.net-links button {
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: #cfe0f5;
  background: transparent;
  border: 1px solid rgba(235, 242, 255, 0.18);
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  cursor: pointer;
}

.net-links button:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.net-links button.bridge {
  border-color: rgba(235, 242, 255, 0.42);
}

.net-hint {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  margin: 0;
  color: rgba(143, 163, 192, 0.5);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.9;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .net-panel { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; max-width: none; }
  .net-hint { display: none; }
}

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

.site-foot {
  text-align: center;
  padding: 1.4rem 1rem 1.6rem;
  color: rgba(143, 184, 212, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

/* ---------- publications (research.html) & document preview (about.html) ---------- */

.pub-list {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.pub {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}

.pub h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.pub .authors {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.pub .authors .me { color: var(--text); font-weight: 600; }

.pub .pub-meta { margin: 0; font-size: 0.86rem; color: var(--text-dim); }
.pub .pub-meta .venue { color: var(--crest); font-style: italic; }

/* abstract: native disclosure, no script */
details.abs { margin-top: 0.7rem; }

details.abs > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  color: var(--crest);
}

details.abs > summary::-webkit-details-marker { display: none; }
details.abs > summary::before { content: "\25B8"; display: inline-block; transition: transform 0.15s ease; }
details.abs[open] > summary::before { transform: rotate(90deg); }
details.abs > summary:hover { color: var(--hot); }

details.abs .abs-body {
  margin: 0.6rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line-soft);
  max-width: 62ch;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }

.btn {
  display: inline-block;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.84rem;
  text-decoration: none;
  color: var(--crest);
  background: rgba(16, 137, 196, 0.08);
}

.btn:hover { color: var(--hot); border-color: var(--crest); background: rgba(27, 190, 235, 0.14); }
.btn-primary { border-color: var(--line); }

/* inline PDF preview — pages are drawn to <canvas> by pdf_view.js, so the
 * browser's own PDF handler (which may be set to download) is never involved */
.doc-box { margin-top: 0.9rem; }
.doc-box[hidden] { display: none; }

.pdf-pages {
  height: min(72vh, 820px);
  overflow-y: auto;
  padding: 0.6rem;
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  background: var(--bg-1);
  -webkit-overflow-scrolling: touch;
}

.pdf-page {
  width: 100%;
  margin: 0 auto 0.6rem;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.pdf-page:last-child { margin-bottom: 0; }
.pdf-page canvas { display: block; width: 100%; height: auto; }

.doc-status { margin: 0.6rem 0; color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 640px) { .pdf-pages { height: 64vh; } }
