/* Piazzi coming-soon page.
   One plate of night sky, one orange star. Orange marks only what gets caught:
   61 Cygni drifting, and the line that fails at build time. */

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/bodoni-moda-italic-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Libertinus Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/libertinus-mono-latin.woff2) format("woff2");
}

:root {
  --plate: #102052;
  --plate-deep: #0b173f;
  --rule: rgba(241, 233, 216, 0.16);
  --starlight: #f1e9d8;
  --dim: #aeb6d0;
  --faint: #8691b8;
  --cygni: #f7a41d;
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --mono: "Libertinus Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 6vw, 96px);
  --section: clamp(96px, 13vw, 184px);
}

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

html {
  background: var(--plate);
  color: var(--starlight);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 450;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

@media (max-width: 40rem) {
  body { font-size: 1.1875rem; }
}

::selection { background: var(--starlight); color: var(--plate); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

code, pre { font-family: var(--mono); }
p code { font-size: 0.82em; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  z-index: 10;
  top: -4rem;
  left: var(--gutter);
  padding: 0.4em 0.8em;
  background: var(--starlight);
  color: var(--plate);
}
.skip:focus { top: 1rem; }

/* The plate: a star chart with the wordmark set into it. */

.plate {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(88px, 14vh, 180px) var(--gutter) clamp(88px, 12vh, 140px);
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.sky.is-ready { opacity: 1; }
.sky svg { display: block; width: 100%; height: 100%; }
.sky circle { fill: var(--starlight); }
.sky .grid { fill: none; stroke: var(--starlight); stroke-opacity: 0.075; stroke-width: 1; }
.sky .figure { stroke: var(--starlight); stroke-opacity: 0.26; stroke-width: 1; }
.sky text { fill: var(--faint); font-family: var(--serif); font-size: 13px; font-style: italic; }
.sky .grid-label { font-size: 12px; fill-opacity: 0.8; }
.sky .label-cygni { fill: var(--cygni); opacity: 0; transition: opacity 1.2s ease; }
.sky.has-drifted .label-cygni { opacity: 1; }

.plate__inner { position: relative; }

.wordmark {
  margin: 0 0 0 -0.045em;
  font-size: clamp(5.5rem, 19.5vw, 20rem);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  line-height: 0.92;
  letter-spacing: 0;
}

/* 61 Cygni sits where the dot of the final i belongs. Measured from the font:
   dot centre 0.1425em right of the glyph origin and 0.70em above the baseline,
   radius 0.06em; the dotless i advances 0.284em. */
.cygni {
  position: relative;
  display: inline-block;
  width: 0.12em;
  height: 0.12em;
  margin-left: calc(0.0825em - 0.284em);
  margin-right: -0.12em;
  vertical-align: 0.64em;
}

.cygni__star,
.cygni__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.cygni__star { background: var(--cygni); }
.cygni__ring {
  border: max(1px, 0.004em) solid var(--dim);
  opacity: 0;
  transition: opacity 1.2s ease 0.4s;
}
.cygni.has-drifted .cygni__ring { opacity: 0.7; }

.cygni__trail { position: absolute; inset: 0; }
.cygni__tick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.018em;
  height: 0.018em;
  margin: -0.009em 0 0 -0.009em;
  border-radius: 50%;
  background: var(--starlight);
  opacity: 0;
  transform: translate(var(--x), var(--y));
  transition: opacity 0.5s ease;
}
.cygni__tick.is-plotted { opacity: 0.75; }

.plate__sub {
  max-width: 21em;
  margin: 0.55em 0 0;
  font-size: clamp(1.625rem, 3.1vw, 2.5rem);
  line-height: 1.2;
}

.plate__lede {
  max-width: 31em;
  margin: 1em 0 0;
  color: var(--dim);
}

.plate__build {
  margin: 2.25rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.8;
  white-space: pre-wrap;
}
.plate__build .prompt { color: var(--faint); user-select: none; }

.plate__caption {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(24px, 4vh, 40px);
  max-width: 27em;
  margin: 0;
  color: var(--faint);
  font-size: 0.875rem;
  font-style: italic;
  line-height: 1.45;
  text-align: right;
}

@media (max-width: 48rem) {
  .plate { align-content: end; padding-bottom: 40px; }
  .plate__caption { position: static; margin-top: 3rem; text-align: left; }
}

/* Opening statement */

.statement { padding: var(--section) var(--gutter); }
.statement__text {
  max-width: 23em;
  margin: 0;
  font-size: clamp(1.75rem, 3.3vw, 2.75rem);
  line-height: 1.27;
}
.statement__note {
  max-width: 33em;
  margin: 1.5em 0 0;
  color: var(--dim);
}

/* Sections share one grid: prose on the left, the artifact it describes on the right. */

h2, h3 { font-weight: 400; }

.feature,
.log,
.origin {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 5vw, 88px);
  align-items: start;
}

.feature { padding: 0 var(--gutter) var(--section); }
.feature--wide { grid-template-columns: minmax(0, 1fr); }

.feature h2,
.caveats h2,
.log h2 {
  max-width: 14em;
  margin: 0 0 0.55em;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.1;
}

.feature__text p,
.caveats__intro,
.log__head p {
  max-width: 33em;
  margin: 0 0 1em;
  color: var(--dim);
}
.feature--wide .feature__text { margin-bottom: 2.5rem; }

/* Code panes */

.pane {
  min-width: 0;
  margin: 0;
  background: var(--plate-deep);
  border: 1px solid var(--rule);
}
.pane figcaption {
  padding: 0.7rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.4;
}
.pane pre {
  margin: 0;
  padding: 1.1rem 1.25rem 1.35rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
}
.pane pre.wrap { white-space: pre-wrap; }

.k, .note { color: var(--dim); }
.c, .prompt { color: var(--faint); }
.prompt { user-select: none; }
.err, .warn { color: var(--cygni); }

.toggle {
  justify-self: start;
  padding: 0.5em 1em 0.55em;
  border: 1px solid var(--starlight);
  background: transparent;
  color: var(--starlight);
  font: italic 450 1.0625rem/1.2 var(--serif);
  cursor: pointer;
}
.toggle:hover { background: var(--starlight); color: var(--plate); }

/* Typed IPC demo */

.ipc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  row-gap: 1.25rem;
}
.ipc .pane + .pane { border-left: 0; }
.ipc__type {
  text-decoration: underline dotted var(--faint);
  text-underline-offset: 0.3em;
}
.ipc[data-state="error"] .ipc__type { color: var(--cygni); text-decoration-color: var(--cygni); }
.ipc .when-error,
.ipc[data-state="error"] .when-ok { display: none; }
.ipc[data-state="error"] span.when-error { display: inline; }
.ipc[data-state="error"] pre.when-error { display: block; }

/* Capabilities demo */

.caps { display: grid; }
.caps .pane + .pane { border-top: 0; }
.caps__list { display: block; }
.cap {
  position: relative;
  display: block;
  width: calc(100% + 2.5rem);
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
  border: 0;
  background: none;
  color: var(--starlight);
  font: inherit;
  text-align: left;
  white-space: pre;
  cursor: pointer;
}
.cap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2.1rem;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.25rem;
  border: 1px solid var(--starlight);
  border-radius: 50%;
  background: var(--starlight);
}
.cap[aria-pressed="false"] { color: var(--faint); }
.cap[aria-pressed="false"]::before { border-color: var(--faint); background: transparent; }
.cap:hover { background: rgba(241, 233, 216, 0.06); }
.cap:focus-visible { outline-offset: -2px; }

/* Engine check */

.engines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--rule);
  border-top: 0;
}
.engines div { padding: 0.85rem 1.15rem 1rem; }
.engines div + div { border-left: 1px solid var(--rule); }
.engines dt { color: var(--faint); font-size: 0.9375rem; font-style: italic; }
.engines dd { margin: 0.2rem 0 0; font-size: 1rem; line-height: 1.4; }

/* Targets */

.targets-wrap { overflow-x: auto; }
.targets {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.0625rem;
  line-height: 1.45;
}
.targets th,
.targets td {
  padding: 0.9rem 1.25rem 0.95rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.targets thead th { color: var(--faint); font-size: 0.9375rem; font-style: italic; font-weight: 400; }
.targets tbody th { font-weight: 400; white-space: nowrap; }
.targets td { color: var(--dim); }
.targets code { font-size: 0.875rem; }

/* Caveats */

.caveats { padding: 0 var(--gutter) var(--section); }
.caveats__lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 5vw, 88px);
  margin-top: clamp(40px, 5vw, 72px);
}
.caveats h3 { margin: 0 0 1.1rem; font-size: 1.5rem; font-style: italic; line-height: 1.2; }
.caveats ul { margin: 0; padding: 0; list-style: none; }
.caveats li {
  position: relative;
  max-width: 31em;
  margin: 0 0 1.05em;
  padding-left: 1.6rem;
}
.caveats li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--dim);
  border-radius: 50%;
}

/* Milestones, plotted like observations along a track */

.log { padding: 0 var(--gutter) var(--section); }
.log__head { position: sticky; top: 3rem; }
.log__list {
  position: relative;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}
.log__list::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  bottom: 3.2rem;
  left: 0.3rem;
  width: 1px;
  background: var(--rule);
}
.log__item {
  position: relative;
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  padding: 0 0 2.1rem 2.25rem;
}
.log__item::before {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: 0;
  width: 0.6rem;
  height: 0.6rem;
  border: 1px solid var(--dim);
  border-radius: 50%;
  background: var(--plate);
}
.log__item--now::before { border-color: var(--cygni); background: var(--cygni); }
.log__mark { color: var(--faint); font-size: 1.0625rem; font-style: italic; line-height: 1.9; }
.log__item h3 { margin: 0; font-size: 1.625rem; line-height: 1.25; }
.log__item h3 code { font-size: 0.8em; }
.log__item p { max-width: 34em; margin: 0.3rem 0 0; color: var(--dim); }

/* Origin */

.origin {
  padding: var(--section) var(--gutter);
  border-top: 1px solid var(--rule);
}
.origin__date {
  margin: 0;
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-style: italic;
  line-height: 1;
}
.origin__text p {
  max-width: 25em;
  margin: 0 0 1em;
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1.45;
}
.origin__text p + p { color: var(--dim); }

/* Colophon */

.colophon {
  padding: 2.75rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.colophon p { max-width: 50em; margin: 0 0 0.45em; }
.colophon__home { color: var(--starlight); font-size: 1.25rem; font-style: italic; }

@media (max-width: 60rem) {
  .feature,
  .log,
  .origin,
  .ipc,
  .caveats__lists { grid-template-columns: minmax(0, 1fr); }
  .feature__text { margin-bottom: 2.25rem; }
  .ipc .pane + .pane { border-top: 0; border-left: 1px solid var(--rule); }
  .log__head { position: static; margin-bottom: 2.5rem; }
  .origin__date { margin-bottom: 1.5rem; }
  .engines { grid-template-columns: minmax(0, 1fr); }
  .engines div + div { border-top: 1px solid var(--rule); border-left: 0; }
}

/* Short screens: keep the whole plate above the fold. */
@media (max-height: 820px) and (min-width: 48rem) {
  .wordmark { font-size: clamp(5rem, 16.5vw, 16rem); }
  .plate__sub { font-size: clamp(1.5rem, 2.6vw, 2.125rem); }
}

@media (max-width: 40rem) {
  .plate__build { font-size: 0.8125rem; }
  /* Give the milestone text the full column and put its mark above the title. */
  .log__item { grid-template-columns: minmax(0, 1fr); padding-left: 1.75rem; }
  .log__mark { line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .sky .label-cygni, .cygni__ring, .cygni__tick { transition: none; }
}

/* 404 */

.lost {
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--section) var(--gutter);
}
.lost__home {
  margin: 0 0 auto;
  font-size: 1.5rem;
  font-style: italic;
}
.lost h1 {
  max-width: 13em;
  margin: 2.5rem 0 0.5em;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.12;
}
.lost p { max-width: 32em; margin: 0 0 1em; color: var(--dim); }
.lost a { color: var(--starlight); }
