/*
 * SeanceOS website.
 *
 * Two worlds, deliberately: Caslon — the typeface of English scientific printing
 * in the era of the Society for Psychical Research — for everything you read, and
 * the app's own instrument readouts inside the demos. Colour is the app's channel
 * legend and nothing else: amber is the camera, orange is sound, blue is the
 * magnetic field, green is radio and voice, pale blue is particles. If a colour
 * appears, it means that channel.
 *
 * Everything is self-hosted. No third-party fonts, scripts or trackers.
 */

@font-face {
  font-family: 'Caslon Display';
  src: url('../fonts/caslon-display.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Caslon';
  src: url('../fonts/caslon-text.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Caslon';
  src: url('../fonts/caslon-text-italic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #080b10;          /* the app's own background */
  --panel: #0d1219;
  --panel-edge: #1a232e;
  --paper: #e9e4d8;        /* text: lamplit paper, not white */
  --paper-dim: #b9b3a6;
  --muted: #8b9098;
  --rule: #1c2530;

  --camera: #fbbf24;
  --audio: #f4723e;
  --magnetic: #93c5fd;
  --radio: #86efac;
  --voice: #34d399;
  --particle: #b4dcff;
  --glass: #6eedd4;        /* the spectrogram's contour line */

  --display: 'Caslon Display', 'Libre Caslon Display', Georgia, serif;
  --text: 'Caslon', 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --instrument: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, monospace;

  --measure: 34em;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--text);
  font-size: clamp(1.06rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.62;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: var(--paper); text-decoration-color: rgba(233, 228, 216, 0.35); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--camera); }
:focus-visible { outline: 2px solid var(--camera); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--camera); color: #000; padding: 0.6em 1em; z-index: 20;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.wordmark {
  font-family: var(--display); font-size: 1.55rem; letter-spacing: 0.01em;
  color: var(--camera); text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 2rem); }
.site-nav a { font-size: 0.95rem; text-decoration: none; color: var(--paper-dim); }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--paper); }
@media (max-width: 44rem) { .site-nav .optional { display: none; } }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  font-family: var(--text); font-size: 1rem; font-weight: 600;
  padding: 0.78em 1.35em; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
}
.button-primary { background: var(--camera); color: #120c00; }
.button-primary:hover { background: #fcd34d; }
.button-quiet { border-color: #3a4552; color: var(--paper); background: transparent; }
.button-quiet:hover { border-color: var(--paper-dim); }
.button[aria-pressed='true'] { border-color: var(--audio); color: var(--audio); }

/* ---------- Hero ---------- */

.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5.5rem); align-items: center;
  padding-top: clamp(2.5rem, 7vw, 5.5rem); padding-bottom: clamp(3rem, 8vw, 6rem);
}
@media (max-width: 58rem) { .hero .wrap { grid-template-columns: 1fr; } }

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -0.005em; }
h1 {
  font-size: clamp(2.7rem, 1.6rem + 4.6vw, 5.4rem); line-height: 1.02;
  max-width: 12ch;
}
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1.08; max-width: 18ch; }
h3 { font-family: var(--text); font-size: 1.2rem; font-weight: 700; margin: 0 0 0.35rem; line-height: 1.3; }

.lede { font-size: 1.22em; line-height: 1.55; color: var(--paper); max-width: var(--measure); margin: 1.6rem 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-note { margin-top: 1.4rem; font-size: 0.92rem; color: var(--muted); max-width: 32em; }

/* ---------- Phone frame ---------- */

.phone {
  position: relative; width: min(100%, 22rem); margin: 0 auto;
  aspect-ratio: 9 / 18.6; border-radius: 2.6rem; padding: 0.7rem;
  background: linear-gradient(160deg, #2a3038, #11151b 55%, #1d232b);
  box-shadow: 0 0 0 1px #3a424c inset, 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}
.phone-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 2rem; background: #080b10;
  font-family: var(--instrument); color: #d4d4d4;
}
.phone-screen::before { /* the camera punch-hole */
  content: ''; position: absolute; top: 0.7rem; left: 50%; width: 0.62rem; height: 0.62rem;
  transform: translateX(-50%); border-radius: 50%; background: #000; z-index: 5;
  box-shadow: 0 0 0 1px #1b1f25;
}
.demo-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1.3rem; }
.demo-status { text-align: center; font-size: 0.88rem; color: var(--muted); margin: 0.8rem auto 0; max-width: 24rem; min-height: 2.8em; }

/* The Audio Lab screen, rebuilt from the app. */
.lab { display: flex; flex-direction: column; height: 100%; background: #080b10; }
.lab-head { padding: 2rem 0.9rem 0.7rem; border-bottom: 1px solid #262626; }
.lab-title { color: var(--camera); font-size: 0.72rem; letter-spacing: 0.18em; }
.lab-sub { color: #737373; font-size: 0.6rem; margin-top: 0.15rem; font-family: system-ui, sans-serif; }
.lab-body { flex: 1; display: flex; flex-direction: column; gap: 0.55rem; padding: 0.65rem; overflow: hidden; }
.lab-panel { border: 1px solid #262626; border-radius: 0.6rem; background: #0d1219; padding: 0.6rem 0.7rem; }
.lab-landscape { position: relative; padding: 0; overflow: hidden; background: #070d15; }
.lab-landscape canvas { width: 100%; height: 11.2rem; }
.lab-full {
  position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.5rem; letter-spacing: 0.1em;
  border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.6); padding: 0.3rem 0.45rem; border-radius: 0.25rem; color: #d4d4d4;
}
.lab-caption { font-size: 0.5rem; color: #525252; text-align: center; padding: 0.35rem 0 0.45rem; }
.lab-row { display: flex; justify-content: space-between; align-items: baseline; }
.lab-label { font-size: 0.5rem; letter-spacing: 0.16em; color: #737373; }
.lab-clock { font-size: 0.62rem; color: #a3a3a3; }
.lab-record {
  margin-top: 0.5rem; width: 100%; background: #dc2626; color: #fff; border: 0; border-radius: 0.45rem;
  font-family: var(--instrument); font-size: 0.62rem; letter-spacing: 0.12em; padding: 0.55rem;
}
.lab-radar { width: 100%; height: 8.6rem; margin: 0.2rem 0 0.3rem; }
.lab-strip { width: 100%; height: 1.6rem; margin-top: 0.25rem; border-radius: 0.25rem; }
.lab-shape { font-family: system-ui, sans-serif; font-size: 0.82rem; color: #f5f5f5; margin-top: 0.35rem; line-height: 1.3; min-height: 2.2em; }
.lab-causes { font-family: system-ui, sans-serif; font-size: 0.6rem; color: #a3a3a3; line-height: 1.45; margin-top: 0.3rem; min-height: 3em; }

/* ---------- Channel legend ---------- */

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; border-top: 1px solid var(--rule); }
.section-intro { max-width: var(--measure); color: var(--paper-dim); margin: 1.1rem 0 0; }

.legend {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 3rem; margin: 3rem 0 0; padding: 0; list-style: none;
}
@media (max-width: 58rem) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 36rem) { .legend { grid-template-columns: 1fr; } }
.legend li { padding-left: 1.1rem; border-left: 3px solid var(--swatch, var(--muted)); }
.legend p { margin: 0; color: var(--paper-dim); font-size: 0.98rem; }
.swatch-camera { --swatch: var(--camera); }
.swatch-audio { --swatch: var(--audio); }
.swatch-magnetic { --swatch: var(--magnetic); }
.swatch-radio { --swatch: var(--radio); }
.swatch-particle { --swatch: var(--particle); }
.swatch-pressure { --swatch: #6b7280; }

/* ---------- Modes ---------- */

.mode {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.mode + .mode { margin-top: clamp(4.5rem, 11vw, 8rem); }
.mode-flip .mode-text { order: 2; }
@media (max-width: 58rem) {
  .mode { grid-template-columns: 1fr; }
  .mode-flip .mode-text { order: 0; }
}
.mode-text p { max-width: var(--measure); color: var(--paper-dim); }
.mode-text p:first-of-type { margin-top: 1.1rem; }
.points { list-style: none; padding: 0; margin: 1.6rem 0 0; max-width: var(--measure); }
.points li { padding: 0.55rem 0; border-top: 1px solid var(--rule); color: var(--paper); font-size: 0.98rem; }
.points li:last-child { border-bottom: 1px solid var(--rule); }

.illustration-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.9rem; font-style: italic; }

/* Live view HUD, rebuilt from the app. */
.hud { position: absolute; inset: 0; }
.hud canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hud-top {
  position: absolute; left: 0; right: 0; top: 1.7rem; display: flex; justify-content: space-between;
  align-items: flex-start; padding: 0 0.8rem; z-index: 3;
}
.hud-brand { color: var(--camera); font-size: 0.66rem; letter-spacing: 0.26em; }
.hud-state { color: #a3a3a3; font-size: 0.55rem; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.4rem; }
.hud-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: #3faa4e; }
.hud-log { font-size: 0.55rem; letter-spacing: 0.1em; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.35rem; padding: 0.2rem 0.4rem; color: #e5e5e5; }
.hud-pills {
  position: absolute; left: 0.5rem; right: 0.5rem; bottom: 1.1rem; z-index: 3;
  display: flex; gap: 0.3rem; background: rgba(8, 11, 16, 0.8); border: 1px solid #262626;
  border-radius: 0.8rem; padding: 0.35rem;
}
.hud-pill {
  flex: 1; text-align: center; font-size: 0.5rem; padding: 0.45rem 0.1rem; border-radius: 0.5rem;
  border: 1px solid var(--tint); color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent);
}
.hud-pill.scan { flex: 1.5; background: var(--camera); border-color: var(--camera); color: #111; }
.tint-camera { --tint: var(--camera); }
.tint-audio { --tint: var(--audio); }
.tint-magnetic { --tint: var(--magnetic); }
.tint-radio { --tint: var(--radio); }

/* Instrument panels outside a phone. */
.instrument {
  border: 1px solid var(--panel-edge); border-radius: 1rem; background: var(--panel);
  padding: clamp(0.9rem, 2.5vw, 1.4rem); font-family: var(--instrument);
}
.instrument canvas { width: 100%; }
.instrument-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 0.62rem; letter-spacing: 0.14em; color: #737373; }
.instrument-verdict { font-family: system-ui, sans-serif; color: #e5e5e5; font-size: 0.92rem; margin: 0.9rem 0 0; }
.evp-canvas { height: 15rem; }
.session-canvas { height: 13rem; }
.chamber-canvas { aspect-ratio: 4 / 3; border-radius: 0.6rem; background: #000; }
.reverb-canvas { height: 12rem; margin-top: 0.6rem; }
.reverb-figure { font-family: var(--instrument); font-size: 2.2rem; color: #f5f5f5; }
.chamber-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; margin-top: 0.8rem; text-align: center; }
.chamber-stats div { border: 1px solid #1b1f25; border-radius: 0.35rem; padding: 0.45rem 0; }
.chamber-stats b { display: block; font-weight: 400; font-size: 1rem; color: #f5f5f5; }
.chamber-stats span { font-size: 0.5rem; letter-spacing: 0.12em; color: #737373; }
.sentry-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.9rem; }
.sentry-tile { border: 1px solid #1b1f25; border-radius: 0.45rem; padding: 0.45rem 0.55rem 0.25rem; }
.sentry-tile span { font-size: 0.5rem; letter-spacing: 0.12em; color: #8b9098; }
.sentry-tile canvas { height: 2.1rem; }
.sentry-alarm {
  font-family: var(--instrument); font-size: 0.6rem; letter-spacing: 0.12em; color: #fca5a5;
  border: 1px solid #7f1d1d; background: rgba(127, 29, 29, 0.25); border-radius: 0.45rem;
  padding: 0.5rem 0.6rem; margin-bottom: 0.9rem; visibility: hidden;
}
.sentry-alarm.on { visibility: visible; }

.mesh-figure { max-width: 30rem; margin: 0 auto; }

/* ---------- Honesty ---------- */

.ledger {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(2rem, 5vw, 4rem); margin-top: 3rem;
}
.ledger h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin-bottom: 1rem; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 0.65rem 0; border-top: 1px solid var(--rule); color: var(--paper-dim); font-size: 0.98rem; }
.ledger li b { color: var(--paper); font-weight: 600; }

.principles { margin-top: clamp(3rem, 7vw, 5rem); display: grid; gap: 2.2rem; max-width: 46rem; }
.principles p { margin: 0; color: var(--paper-dim); }
.principles blockquote {
  margin: 0; padding: 0; font-family: var(--display); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem);
  line-height: 1.25; color: var(--paper);
}

/* ---------- Privacy summary ---------- */

.privacy-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
@media (max-width: 52rem) { .privacy-summary { grid-template-columns: 1fr; } }
.privacy-summary dl { margin: 0; }
.privacy-summary dt { font-weight: 700; margin-top: 1.1rem; }
.privacy-summary dt:first-child { margin-top: 0; }
.privacy-summary dd { margin: 0.2rem 0 0; color: var(--paper-dim); font-size: 0.98rem; }

/* ---------- Closing ---------- */

.closing { text-align: center; }
.closing h2 { margin: 0 auto; }
.closing p { color: var(--paper-dim); margin: 1.2rem auto 2rem; max-width: 30em; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer nav { display: flex; gap: 1.4rem; }
.site-footer a { color: var(--paper-dim); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.site-footer p { margin: 0; max-width: 38em; }

/* ---------- Document pages: privacy, terms, support ---------- */

.doc { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(4rem, 9vw, 7rem); }
.doc .wrap { max-width: 46rem; }
.doc h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.8rem); max-width: none; }
.doc h2 { font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); max-width: none; margin: 2.8rem 0 0.8rem; }
.doc h3 { margin-top: 1.6rem; }
.doc p, .doc li { color: var(--paper-dim); }
.doc strong { color: var(--paper); }
.doc .updated { color: var(--muted); font-style: italic; margin-top: 0.8rem; }
.doc .summary {
  border-left: 3px solid var(--camera); padding: 0.4rem 0 0.4rem 1.2rem; margin: 2rem 0;
  color: var(--paper);
}
.doc table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem 0.7rem 0; border-top: 1px solid var(--rule); }
.doc th { color: var(--paper); font-weight: 700; }
.doc td { color: var(--paper-dim); }
.doc .table-scroll { overflow-x: auto; }
.doc details { border-top: 1px solid var(--rule); padding: 1rem 0; }
.doc details:last-of-type { border-bottom: 1px solid var(--rule); }
.doc summary { cursor: pointer; color: var(--paper); font-weight: 700; }
.doc details p { margin: 0.8rem 0 0; }

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