/* Raven site. Steel paper, graphite ink, UV violet; overlays in penetrant yellow. */

@font-face {
  font-family: "Plex Sans";
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plex Condensed";
  src: url(fonts/ibm-plex-sans-condensed-latin-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plex Condensed";
  src: url(fonts/ibm-plex-sans-condensed-latin-700-normal.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #e8ebed;
  --paper-2: #dde1e4;
  --ink: #1c2227;
  --ink-2: #4a545c;
  --violet: #4b32c3;
  --violet-ink: #ffffff;
  --mark: #f5d90a;
  --line: #c3c9ce;
  --stage: #2a3036;
  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15191d;
    --paper-2: #1d2328;
    --ink: #e4e8eb;
    --ink-2: #a3adb5;
    --violet: #9d8bff;
    --violet-ink: #15191d;
    --line: #333b42;
    --stage: #0e1114;
  }
}

* { 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(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Plex Condensed", "Plex Sans", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.6rem, 7.2vw, 5.4rem); max-width: 11ch; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); max-width: 18ch; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; margin-bottom: 0.3em; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--violet); text-underline-offset: 0.18em; }
strong { font-weight: 600; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--paper); padding: 0.4rem 0.8rem; z-index: 10; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 1.7rem; height: 1.7rem; }
.brand span { font: 700 1.35rem/1 "Plex Condensed", sans-serif; letter-spacing: 0.01em; }
.top nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 720px) { .top nav a:not(.nav-cta) { display: none; } }

/* Buttons */
.button {
  display: inline-block;
  background: var(--violet);
  color: var(--violet-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.3rem;
  border-radius: 2px;
}
.button:hover { filter: brightness(1.12); }
.link-quiet { color: var(--ink); font-weight: 600; margin-left: 1.2rem; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem) var(--gutter) clamp(3rem, 7vw, 6rem);
}
.hero .lead { font-size: 1.2rem; color: var(--ink-2); margin-bottom: 1.8rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}

/* Sections */
section { padding: clamp(3rem, 7vw, 6rem) var(--gutter); border-top: 1px solid var(--line); }
.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
}
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 760px) { .pair { grid-template-columns: minmax(0, 1fr); } }

.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.4rem; }
.facts li { border-left: 3px solid var(--violet); padding-left: 1rem; }
.facts p { color: var(--ink-2); margin: 0; }
@media (max-width: 640px) { .facts { grid-template-columns: minmax(0, 1fr); } }

.trl { display: flex; align-items: baseline; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.trl b { font: 700 clamp(3.4rem, 9vw, 6rem)/0.9 "Plex Condensed", sans-serif; color: var(--violet); }
.trl span { font-size: 1.15rem; color: var(--ink-2); max-width: 22ch; }

.ladder { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; max-width: 34rem; }
.ladder li { height: 0.55rem; background: var(--line); }
.ladder li.done { background: var(--violet); }
.ladder li.next { background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 8px); }
.ladder-legend { display: flex; justify-content: space-between; max-width: 34rem; font-size: 0.85rem; color: var(--ink-2); margin-top: 0.4rem; }

.loop { width: 100%; max-width: 30rem; height: auto; color: var(--ink); }
.loop text { font: 600 14px "Plex Sans", sans-serif; fill: currentColor; }
.loop .arc { fill: none; stroke: var(--violet); stroke-width: 2.5; }
.loop circle.node { fill: var(--paper); stroke: var(--violet); stroke-width: 2.5; }
.loop circle.node.human { fill: var(--violet); }

.pilot { background: var(--paper-2); }
.pilot blockquote { margin: 0 0 2rem; font-size: 1.25rem; line-height: 1.55; max-width: 38rem; }

.about p:first-of-type { font-size: 1.2rem; }

.contact-line { font-size: 1.35rem; font-weight: 600; }

/* Viewer */
/* Square captures: cap the size by width and by screen height so image + controls fit one screen. */
.viewer { margin: 0; width: 100%; max-width: min(36rem, 70vh); }
.hero .viewer { justify-self: center; }
.pair .viewer { justify-self: center; }
.viewer .stage {
  position: relative;
  background: var(--stage);
  overflow: hidden;
}
.viewer .stage img { display: block; width: 100%; height: auto; }
.viewer .stage img.fade { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.viewer .stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.viewer .stage rect { fill: none; stroke: var(--mark); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.viewer .stage .badge {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
}
.viewer .controls { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.viewer .controls input[type="range"] { flex: 1; min-width: 0; accent-color: var(--violet); }
.viewer button {
  font: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  cursor: pointer;
}
.viewer button[aria-pressed="true"] { border-color: var(--mark); box-shadow: inset 0 -3px 0 var(--mark); }
.viewer button:hover { background: var(--paper-2); }
.viewer figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.5rem; max-width: 40rem; }
.viewer:not(.ready) .controls, .viewer:not(.ready) .badge { display: none; }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter) 3rem;
  font-size: 0.85rem;
  color: var(--ink-2);
  display: grid;
  gap: 0.8rem;
}
footer p { max-width: 60rem; margin: 0; }
footer nav { display: flex; gap: 1.2rem; }
footer a { color: var(--ink-2); }

/* Legal pages */
.legal { padding: clamp(2rem, 5vw, 4rem) var(--gutter); }
.legal h2 { font-size: 1.4rem; margin-top: 2rem; }
