/* ===========================================================================
   Superior Intelligence — designation record
   The page is built as an official amendment notice: flush-left, full-bleed
   rules, zero radius, zero cards. One family throughout. The only moment of
   colour is the strike through the retired term.
   ========================================================================= */

:root {
  --black: #000000;
  --panel: #0d0f12;
  --bone: #e6e4de;
  --dim: #7a7973;
  --phos: #ffb627;   /* CRT amber — the live/system signal */
  --void: #ff412c;   /* stamp red — retired term and errors only */
  --rule: #2a2d33;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 1180px;

  --step-hero: clamp(2.6rem, 12vw, 9rem);
  --step-old: clamp(1.05rem, 4.4vw, 3.3rem);
  --step-h2: clamp(1.45rem, 3.4vw, 2.1rem);
  --step-body: clamp(0.95rem, 1.6vw, 1.0625rem);
  --step-small: 0.8125rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--bone);
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: var(--step-body);
  line-height: 1.65;
  font-variant-ligatures: none;
  overflow-x: hidden;
}

/* Static CRT scanlines. Low enough not to fight the text. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.028) 0 1px,
    transparent 1px 3px
  );
}

::selection { background: var(--phos); color: var(--black); }

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

a { color: var(--bone); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--phos); }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--phos);
  color: var(--black);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* --- top bar -------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--black);
  border-bottom: 2px solid var(--bone);
}

.bar__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 56px;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mark {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 2px solid var(--bone);
  padding: 0.05rem 0.45rem;
  line-height: 1.4;
  flex: none;
}
.mark:hover { background: var(--bone); color: var(--black); }

.bar__status {
  color: var(--dim);
  font-size: var(--step-small);
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar__status b { color: var(--phos); font-weight: 500; }

.bar__link {
  font-size: var(--step-small);
  color: var(--dim);
  text-decoration: none;
  flex: none;
}
.bar__link:hover { color: var(--bone); text-decoration: underline; }

/* --- section scaffolding -------------------------------------------------- */

.rule { border: 0; border-top: 2px solid var(--bone); margin: 0; }
.rule--thin { border-top: 1px solid var(--rule); }

section { padding-block: clamp(2.75rem, 7vw, 5rem); }

h2 {
  font-size: var(--step-h2);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 1.25rem;
}

p { margin: 0 0 1rem; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

.lede { color: var(--bone); }
.muted { color: var(--dim); }

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

.hero { padding-top: clamp(2rem, 6vw, 3.5rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); }

.boot {
  color: var(--dim);
  font-size: var(--step-small);
  line-height: 1.9;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  min-height: calc(1.9em * 3);
}
.boot span { display: block; white-space: nowrap; overflow: hidden; }
.boot b { color: var(--phos); font-weight: 400; }

/* The rename. Retired term on top, struck; the replacement below it. */
.rename {
  margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

.rename__old {
  display: block;
  position: relative;
  width: max-content;
  max-width: 100%;
  font-size: var(--step-old);
  color: var(--dim);
  letter-spacing: -0.02em;
  margin-bottom: 0.35em;
}

/* Drawn as an element rather than line-through so it can be animated and so
   its weight holds up at display sizes. */
.rename__old::after {
  content: '';
  position: absolute;
  left: -0.06em;
  right: -0.06em;
  top: 50%;
  height: 0.09em;
  min-height: 3px;
  background: var(--void);
  transform: scaleX(1);
  transform-origin: left center;
}

.rename__new,
.rename__tail {
  display: block;
  font-size: var(--step-hero);
  color: var(--bone);
  text-transform: uppercase;
}

.hero__lede {
  font-size: clamp(1rem, 1.9vw, 1.1875rem);
  max-width: 54ch;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

/* --- join form ------------------------------------------------------------ */

.join { max-width: 34rem; }

.join__row { display: flex; flex-wrap: wrap; }

.join__field {
  flex: 1 1 15rem;
  min-width: 0;
  background: var(--panel);
  border: 2px solid var(--bone);
  color: var(--bone);
  font: inherit;
  font-size: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.join__field::placeholder { color: #55565c; }
.join__field:focus {
  outline: none;
  border-color: var(--phos);
  background: #14171c;
}
.join__field[aria-invalid='true'] { border-color: var(--void); }

.join__submit {
  flex: none;
  background: var(--bone);
  color: var(--black);
  border: 2px solid var(--bone);
  border-left-width: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  border-radius: 0;
}
.join__submit:hover:not(:disabled) { background: var(--phos); border-color: var(--phos); }
.join__submit:disabled { opacity: 0.55; cursor: progress; }

/* The caret marks the live field, in place of an arrow glyph. */
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.4em;
  background: currentColor;
  vertical-align: -0.14em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Below this width the field and button stack, so the button needs the left
   border back that it drops when the two sit side by side. */
@media (max-width: 34rem) {
  .join__row { display: block; }
  .join__field { width: 100%; }
  .join__submit {
    width: 100%;
    border-left-width: 2px;
    border-top-width: 0;
  }
}

.join__note {
  color: var(--dim);
  font-size: var(--step-small);
  margin: 0.85rem 0 0;
  max-width: none;
}

.join__error {
  color: var(--void);
  font-size: var(--step-small);
  margin: 0.85rem 0 0;
  min-height: 1.3em;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- confirmation --------------------------------------------------------- */

.result {
  border: 2px solid var(--phos);
  background: var(--panel);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  max-width: 34rem;
}
.result h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* Qualified with .result so it outranks the `.result p` rule below, which is
   more specific than a lone class and would otherwise shrink the number. */
.result p.result__pos {
  font-size: clamp(2.5rem, 9vw, 4.25rem);
  font-weight: 700;
  color: var(--phos);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0.5rem 0 0.25rem;
}

.result p { font-size: var(--step-small); color: var(--dim); }

.share {
  display: flex;
  margin-top: 1.25rem;
  border: 2px solid var(--rule);
}
.share input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--bone);
  font: inherit;
  font-size: var(--step-small);
  padding: 0.7rem 0.85rem;
}
.share input:focus { outline: none; }
.share button {
  flex: none;
  background: var(--rule);
  color: var(--bone);
  border: 0;
  font: inherit;
  font-size: var(--step-small);
  font-weight: 700;
  padding: 0.7rem 1rem;
  cursor: pointer;
}
.share button:hover { background: var(--bone); color: var(--black); }

/* --- record table --------------------------------------------------------- */

.record { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; }

.record dt,
.record dd {
  border-top: 1px solid var(--rule);
  padding: 0.85rem 0;
  margin: 0;
}
.record dt {
  color: var(--dim);
  font-size: var(--step-small);
  letter-spacing: 0.08em;
  padding-right: 1.5rem;
}
.record dd { color: var(--bone); }
.record dd b { color: var(--phos); font-weight: 500; }
.record .struck { color: var(--dim); text-decoration: line-through; text-decoration-color: var(--void); }

/* --- meaning grid --------------------------------------------------------- */

.grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  border-top: 1px solid var(--rule);
}

.cell {
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2rem) 0;
}
/* Every cell after the first sits against a divider and needs room from it.
   The first stays flush with the page's left edge. */
.cell + .cell { padding-left: clamp(1.25rem, 3vw, 2rem); }
.cell:last-child { border-right: 0; padding-right: 0; }
.cell h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.cell p { color: var(--dim); font-size: var(--step-small); line-height: 1.7; max-width: 38ch; }

@media (max-width: 54rem) {
  .cell,
  .cell + .cell { border-right: 0; padding-right: 0; padding-left: 0; }
}

/* --- faq ------------------------------------------------------------------ */

.faq { border-top: 1px solid var(--rule); }

.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  cursor: pointer;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-weight: 500;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }

/* Plus/minus, not a chevron - it reads as expand on a document. It sits in
   an aria-hidden span so screen readers announce the question alone; the
   disclosure role already tells them it expands. */
.faq__mark {
  position: absolute;
  right: 0.25rem;
  top: 1.05rem;
  color: var(--phos);
  font-weight: 700;
  font-size: 1.15rem;
}
.faq__mark::after { content: '+'; }
.faq details[open] .faq__mark::after { content: '\2212'; }
.faq summary:hover { color: var(--phos); }

.faq details > div { padding: 0 2.5rem 1.35rem 0; }
.faq details p { color: var(--dim); font-size: var(--step-small); line-height: 1.75; }

/* --- long-form (/si) ------------------------------------------------------ */

/* An <article> gets no section padding, so the long-form pages set their own
   headroom below the bar. */
article.wrap { padding-block-start: clamp(2.5rem, 6vw, 4rem); }

/* Sits inside .wrap, so it stays aligned with the header and footer rather
   than centring itself in the viewport. */
.prose { max-width: 66ch; margin-inline: 0; }
.prose h2 { margin-top: clamp(2.25rem, 5vw, 3rem); }
.prose h3 { font-size: 1.0625rem; font-weight: 700; margin: 2rem 0 0.6rem; }
.prose p { color: var(--bone); }
.prose ul { margin: 0 0 1.25rem; padding-left: 1.2rem; color: var(--bone); }
.prose li { margin-bottom: 0.5rem; }
.prose strong { color: var(--phos); font-weight: 500; }

.callout {
  border-left: 2px solid var(--phos);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.75rem 0;
}
.callout p { color: var(--dim); font-size: var(--step-small); }

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

.foot {
  border-top: 2px solid var(--bone);
  padding-block: 2.25rem 3rem;
  color: var(--dim);
  font-size: var(--step-small);
}
.foot__row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: baseline; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--phos); text-decoration: underline; }
.foot__legal { margin-left: auto; }

/* --- admin ---------------------------------------------------------------- */

.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-bottom: 2rem; }
.stat b {
  display: block;
  font-size: 2.25rem;
  color: var(--phos);
  font-weight: 700;
  line-height: 1;
}
.stat span { color: var(--dim); font-size: var(--step-small); }

.table-scroll { overflow-x: auto; border-top: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: var(--step-small); }
th, td { text-align: left; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { color: var(--dim); font-weight: 500; letter-spacing: 0.06em; }

.btn {
  display: inline-block;
  border: 2px solid var(--bone);
  background: transparent;
  color: var(--bone);
  font: inherit;
  font-weight: 700;
  font-size: var(--step-small);
  padding: 0.6rem 1.1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--bone); color: var(--black); }


/* --- page-level utilities -------------------------------------------------
   These exist as classes rather than style attributes because the site's
   Content-Security-Policy forbids inline styles. */

.page { padding-block: clamp(3rem, 10vw, 6rem); }
.page--admin { padding-block: 2.5rem 4rem; }

.page-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}

.page-title--404 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.prose-lede { font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.6; }

.note { font-size: var(--step-small); }
.u-mb-lg { margin-bottom: 1.75rem; }
.u-mb-xl { margin-bottom: 2rem; }
.u-narrow { max-width: 54ch; }

.rule--spaced { margin-top: clamp(2.75rem, 7vw, 5rem); }

.toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* --- the one orchestrated moment ----------------------------------------- */
/* Only applies when JS is on and motion is welcome; otherwise the markup
   above already renders the finished record. */

html.anim .boot span { visibility: hidden; }
html.anim .rename__old,
html.anim .rename__new,
html.anim .rename__tail { opacity: 0; }
html.anim .rename__old::after { transform: scaleX(0); }
html.anim .hero__lede,
html.anim .hero .join { opacity: 0; }

html.anim .boot span.run { visibility: visible; }
html.anim .rename__old.run { animation: fade 0.3s ease both; }
html.anim .rename__old.strike::after { transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1); transform: scaleX(1); }
html.anim .rename__new.run,
html.anim .rename__tail.run { animation: drop 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
html.anim .hero__lede.run,
html.anim .hero .join.run { animation: fade 0.5s ease both; }

.boot .cur {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--phos);
  vertical-align: -0.14em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop {
  from { opacity: 0; transform: translateY(0.14em); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
