/* Speculan LLC. The night sheet. Dark only. Self-hosted type (Barlow for the page,
   B612 Mono for the instrument readouts). One first-party script draws the sheet in three
   dimensions behind every page; without it the flat sheet shows instead.
   Rows below the hero are file fields: a label on the left, a statement on the right. */

@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "B612 Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/b612-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --void: #090b0c;
  --rule: #1a2225;
  --bone: #e6e3da;
  --body: #b5b2a9;
  --smoke: #808b86;
  --shade: #5d6865;
  --signal: #86e0ad;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "B612 Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 74rem;
  --label: 11.5rem;
  --gap: 2.5rem;
  --measure: 37rem;
  --f: 1.5rem; /* inset of the hero frame */
  --glass: rgba(9, 11, 12, 0.84);
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--void);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--signal); color: var(--void); }

a {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}
a:hover { color: #fff; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

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

/* The sheet, in three dimensions behind everything. Flat version shown without WebGL. */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.sheet-flat {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  background: url("../terrain.svg") 62% 40% / cover no-repeat;
  opacity: 0.8;
  -webkit-mask-image: radial-gradient(ellipse 105% 105% at 74% 36%, #000 24%, transparent 76%);
  mask-image: radial-gradient(ellipse 105% 105% at 74% 36%, #000 24%, transparent 76%);
}
.no-gl #scene { display: none; }
.no-gl .sheet-flat { display: block; }
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 42%, transparent 45%, rgba(9, 11, 12, 0.6) 100%);
}
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0.055;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
}
.gl .grain { animation: grain 1.4s steps(5) infinite; }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { .gl .grain { animation: none; } }

/* The page ruler: a fixed scale on the left edge with a mark that tracks the scroll. */
.ruler {
  position: fixed;
  top: 6rem;
  bottom: 6rem;
  left: var(--f);
  z-index: 2;
  width: 6px;
  container-type: size;
  pointer-events: none;
  opacity: 0.4;
  background: repeating-linear-gradient(180deg, var(--smoke) 0 1px, transparent 1px 28px);
}
.ruler-mark {
  position: absolute;
  top: 0;
  left: -3px;
  width: 12px;
  height: 2px;
  background: var(--signal);
  will-change: transform;
}
@media (max-width: 76rem) { .ruler { display: none; } }

/* Header, over the scene */
.site-head { position: relative; z-index: 3; border-bottom: 1px solid rgba(26, 34, 37, 0.9); background: linear-gradient(rgba(9, 11, 12, 0.7), rgba(9, 11, 12, 0)); }
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.brand img { display: block; width: auto; height: 3.1rem; }
.nav { display: flex; gap: 1.75rem; }
.nav a {
  padding: 0.25rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
  text-decoration: none;
}
.nav a:hover { color: var(--bone); }
.nav a[aria-current="page"] {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.6em;
}

main { position: relative; z-index: 2; flex: 1 0 auto; }

/* Hero: the full sheet, the frame corners, the readouts, the statement */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 4.8rem);
  min-height: calc(100svh - 4.8rem);
  padding: 4rem 0 5rem;
}
.hero--home { align-items: flex-end; padding: 9rem 0 5.5rem; }
.hero--inner { min-height: 0; padding: 3.5rem 0 5rem; }
.frame {
  --b: var(--smoke);
  position: absolute;
  inset: var(--f);
  pointer-events: none;
  opacity: 0.6;
  background:
    linear-gradient(var(--b), var(--b)) 0 0 / 1.75rem 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 0 0 / 1px 1.75rem no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 0 / 1.75rem 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 0 / 1px 1.75rem no-repeat,
    linear-gradient(var(--b), var(--b)) 0 100% / 1.75rem 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 0 100% / 1px 1.75rem no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 100% / 1.75rem 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 100% / 1px 1.75rem no-repeat;
  animation: lock 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes lock {
  from { inset: 0.25rem; opacity: 0; }
  to { inset: var(--f); opacity: 0.6; }
}
.readout {
  position: absolute;
  z-index: 1;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--smoke);
  white-space: pre;
}
.readout--tl { top: calc(var(--f) + 0.9rem); left: calc(var(--f) + 2.6rem); }
.readout--tr { top: calc(var(--f) + 0.9rem); right: calc(var(--f) + 2.6rem); }
.readout--bl { bottom: calc(var(--f) + 0.9rem); left: calc(var(--f) + 2.6rem); }
.readout--br { bottom: calc(var(--f) + 0.9rem); right: calc(var(--f) + 2.6rem); }
#grid, #utc { visibility: hidden; }     /* live readouts: shown once something is driving them */
.gl #grid, .js #utc { visibility: visible; }

/* The survey station as a flat image, only when the three-dimensional one is not there */
.hero-mark { position: absolute; top: 17%; right: 12%; display: none; width: 4rem; height: auto; pointer-events: none; }
.no-gl .hero-mark { display: block; }

.hero-inner { position: relative; z-index: 1; text-align: center; container-type: inline-size; }
.hero h1 {
  margin: 0 auto;
  font-family: var(--display);
  --fit: 8.0; /* width of the longest headline line, in em, plus a little slack */
  font-size: clamp(2.75rem, calc((100vw - 3rem) / var(--fit)), 7.5rem);
  font-size: min(7.5rem, calc(100cqw / var(--fit)));
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--bone);
  text-shadow: 0 2px 28px rgba(9, 11, 12, 0.85);
}
.hero h1 span { display: block; }
.hero--inner h1 { font-size: clamp(3rem, 9vw, 6.5rem); text-shadow: 0 0 40px rgba(9, 11, 12, 0.9); }
.hero-sub {
  max-width: 36rem;
  margin: 2rem auto 0;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--body);
  text-wrap: pretty;
  text-shadow: 0 1px 18px rgba(9, 11, 12, 0.95);
}
.hero--inner .hero-sub { margin-top: 1.25rem; font-size: 1.15rem; }
.hero--home .hero-inner > * { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both; }
.hero--home .hero-sub { animation-delay: 0.75s; }
.hero--home .acts { animation-delay: 0.95s; }
@keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .frame, .hero--home .hero-inner > * { animation: none; }
}

/* Actions: two quiet buttons */
.acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1rem; margin: 2.25rem 0 0; }
.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--bone);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
  background: rgba(9, 11, 12, 0.55);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { background: var(--bone); color: var(--void); }
.btn--quiet { border-color: var(--shade); color: var(--body); }
.btn--quiet:hover { border-color: var(--bone); background: rgba(9, 11, 12, 0.85); color: var(--bone); }

/* The facts strip: true things, set like instrument labels */
.facts { padding: 0 0 1rem; }
.facts dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.facts dl > div { padding: 1.1rem 1.25rem; border-left: 1px solid var(--rule); }
.facts dl > div:first-child { border-left: 0; }
.facts dt { margin: 0 0 0.2rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--smoke); }
.facts dd { margin: 0; font-weight: 500; color: var(--bone); }

/* Panels: sheets of glass over the terrain. One per section, never a grid of cards. */
.panel { padding: 2.5rem 0 0; }
.panel .wrap > * { position: relative; }
.panel > .wrap {
  padding-top: 2.5rem;
  padding-bottom: 2.75rem;
  border: 1px solid var(--rule);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 0.7s ease;
}
.gl .panel > .wrap { opacity: 0; }
.gl .panel.in > .wrap { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .gl .panel > .wrap { opacity: 1; transition: none; } }
.panel-head { display: flex; align-items: baseline; gap: 1.25rem; margin: 0 0 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.panel-head .idx { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--signal); }
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--bone);
}

/* Method: collect, analyze, report is a real sequence, so the steps are numbered */
.cycle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cycle li { padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.cycle .n { display: block; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--signal); }
.cycle h3 {
  margin: 0.5rem 0 0.75rem;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--bone);
}
.cycle p { max-width: 22rem; margin: 0; text-wrap: pretty; }

/* The redaction device: the descriptor, second half blacked out */
.redacted {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: -0.5rem 0 2rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
}
.redacted .bar { display: inline-block; width: 9.5em; max-width: 50%; height: 0.95em; background: var(--bone); }

/* Rows: label on the left, statement on the right */
.row {
  display: grid;
  grid-template-columns: var(--label) minmax(0, var(--measure));
  column-gap: var(--gap);
  margin: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.row > h2,
.row > dt {
  margin: 0;
  padding-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--smoke);
}
.row > dd { margin: 0; color: var(--bone); }
.row p { margin: 0 0 1em; text-wrap: pretty; }
.row p:last-child { margin-bottom: 0; }
.nb { white-space: nowrap; }
dl.row { padding: 1rem 0; }
.panel--rows .row:first-child { border-top: 0; }
.panel--rows > .wrap { padding-top: 1rem; }

/* Engage */
.engage { max-width: var(--measure); }
.engage p { margin: 0 0 1em; text-wrap: pretty; }
.engage .acts { justify-content: flex-start; margin-top: 1.5rem; }

/* Footer */
.site-foot {
  position: relative;
  z-index: 2;
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--smoke);
  background: linear-gradient(rgba(9, 11, 12, 0.55), rgba(9, 11, 12, 0.92));
}
.site-foot .wrap {
  display: grid;
  grid-template-columns: var(--label) minmax(0, var(--measure));
  column-gap: var(--gap);
}
.site-foot p { margin: 0 0 0.5rem; }
.site-foot a { color: var(--smoke); text-decoration-color: var(--rule); }
.site-foot a:hover { color: var(--bone); text-decoration-color: var(--signal); }
.foot-seal { display: block; width: 9rem; height: 9rem; margin: -0.3rem 0 0 -0.2rem; }
.foot-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bone);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

/* Narrower than the full layout: the frame moves inside the gutter */
@media (max-width: 76rem) {
  :root { --f: 1rem; }
  .readout--tl, .readout--bl { left: calc(var(--f) + 0.9rem); }
  .readout--tr, .readout--br { right: calc(var(--f) + 0.9rem); }
}

@media (max-width: 56rem) {
  :root { --label: 9.5rem; --gap: 2rem; }
  .cycle { gap: 2rem; }
  .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts dl > div:nth-child(3) { border-left: 0; }
  .facts dl > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

@media (max-width: 48rem) {
  .cycle { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .cycle p { max-width: 30rem; }
  .hero { padding: 5rem 0 4.5rem; }
  .hero--home { padding: 9rem 0 5.5rem; }
}

@media (max-width: 40rem) {
  .row,
  .site-foot .wrap { grid-template-columns: minmax(0, 1fr); row-gap: 0.4rem; }
  .row { padding: 1.4rem 0; }
  dl.row { padding: 0.9rem 0; }
  .hero-sub { font-size: 1.125rem; }
  .hero--inner .hero-sub { font-size: 1.0625rem; }
  .nav { gap: 1.25rem; }
  .site-head .wrap { gap: 0.5rem 1rem; }
  .brand img { height: 2.4rem; }
  .hero-mark { width: 3.25rem; }
  .foot-seal { width: 6rem; height: 6rem; margin: 0 0 0.6rem -0.1rem; }
  .readout { font-size: 0.62rem; }
  .readout--tr { display: none; }
  .panel-head { flex-direction: column; gap: 0.5rem; }
  .redacted .bar { width: 6em; }
}

/* Very narrow phones (360px class): keep the header on one line */
@media (max-width: 23rem) {
  .site-head .wrap { gap: 0.5rem 0.75rem; }
  .brand img { height: 2.2rem; }
  .nav { gap: 1rem; }
  .nav a { font-size: 0.75rem; letter-spacing: 0.12em; }
}
