/* FirstSignal — public stylesheet.
 *
 * No JavaScript, no webfonts, no external requests of any kind. A font pulled
 * from a CDN would report every page view — including a visit to the secret
 * path — to a third party, which docs/security.md §8 rules out. Everything
 * below uses system font stacks and self-hosted CSS only.
 */

:root {
  /* Surfaces: near-black, separated by a few percent of luminance. */
  --bg:          #050505;
  --bg-raised:   #080808;
  --bg-panel:    #0d0d0d;

  /* Text */
  --fg:          #e7e8ea;
  --fg-dim:      #9a9ea6;
  --fg-faint:    #63666d;

  /* Accent: silver, plus one restrained cold blue for links only. */
  --silver:      #c8ccd4;
  --link:        #8ba1bd;
  --link-hover:  #bccbdd;
  --danger:      #b8837c;

  /* Hairlines */
  --line:        rgba(255, 255, 255, 0.065);
  --line-mid:    rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.17);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 60rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.75 var(--sans);
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* A single, almost invisible cold wash from above. Depth, not decoration. */
  background-image:
    radial-gradient(70rem 34rem at 50% -14rem, rgba(150, 168, 196, 0.055), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------------------------------------------------------------- header */

header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.6rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.brand {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--silver);
  text-decoration: none;
  transition: color 220ms var(--ease);
}
.brand:hover { color: #fff; }

header nav { margin-left: auto; display: flex; gap: 1.9rem; }

header nav a {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-faint);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 220ms var(--ease), border-color 220ms var(--ease);
}
header nav a:hover { color: var(--silver); border-bottom-color: var(--line-strong); }

/* ------------------------------------------------------------------ main */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 5.5rem 2.5rem 8rem;
}

/* ------------------------------------------------------------ typography */

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0 0 1.4rem;
  color: #f2f3f5;
}

.wordmark {
  font-size: clamp(2.1rem, 8vw, 4rem);
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  line-height: 1.1;
  margin: 0.6rem 0 2rem;
  color: #f4f5f7;
}

h2 {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--fg-faint);
  margin: 5rem 0 1.8rem;
}
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.eyebrow {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--fg-faint);
  margin: 0;
}

p { margin: 0 0 1.15rem; }

.note {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--fg-faint);
  max-width: 42rem;
}

.empty {
  color: var(--fg-faint);
  font-size: 0.9rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
a:hover { color: var(--link-hover); border-bottom-color: rgba(139, 161, 189, 0.4); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  letter-spacing: 0.03em;
  color: var(--silver);
}
code.hash { word-break: break-all; }

pre {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  margin: 0 0 1.15rem;
  line-height: 1.65;
}
pre code { color: var(--fg-dim); font-size: 0.82rem; }

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

.hero {
  padding: 4rem 0 7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.hero .wordmark { margin: 0 0 1.6rem; }
.hero .eyebrow { color: var(--fg-faint); }

/* ------------------------------------- dossier: the round as an artefact */

.dossier {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line-mid);
  padding: 2.6rem 2.8rem 2.4rem;
  transition: border-color 320ms var(--ease);
}
.dossier:hover { border-color: var(--line-strong); }

/* Registration marks, as on an archived plate. */
.dossier::before,
.dossier::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--line-strong);
  border-style: solid;
}
.dossier::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.dossier::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.6rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}

.field { margin-bottom: 1.9rem; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--fg-faint);
  margin-bottom: 0.7rem;
}

.field-primary code {
  display: block;
  font-size: clamp(0.78rem, 2.1vw, 0.98rem);
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: #eceef1;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.9rem 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.field-row .field { margin-bottom: 0; }
.field-row code { font-size: 0.82rem; }

.dossier .note {
  margin: 2.4rem 0 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- status */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--fg-dim);
  border: 1px solid var(--line-mid);
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}
.status i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-active { color: var(--silver); }
.status-active i { animation: breathe 4.5s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* ---------------------------------------------------------------- tables */

table { border-collapse: collapse; width: 100%; margin: 0 0 1.2rem; }

table.kv th {
  text-align: left;
  width: 14rem;
  vertical-align: top;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fg-faint);
  padding: 1rem 1.5rem 1rem 0;
  border-bottom: 1px solid var(--line);
}
table.kv td {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
  vertical-align: top;
}
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }

table.grid th {
  text-align: left;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fg-faint);
  padding: 0 1.5rem 0.9rem 0;
  border-bottom: 1px solid var(--line-mid);
}
table.grid td {
  padding: 0.95rem 1.5rem 0.95rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 0.88rem;
}
table.grid th:last-child, table.grid td:last-child { padding-right: 0; }
table.grid tr:hover td {
  color: var(--fg);
  border-bottom-color: var(--line-strong);
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}

.more {
  margin: 1.6rem 0 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ---------------------------------------------------- controls and forms */

.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.8rem 0; align-items: center; }

form.inline { display: inline; }

button {
  font: inherit;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line-mid);
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease),
              background-color 200ms var(--ease);
}
button:hover {
  color: var(--fg);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}
button.danger { color: var(--danger); border-color: rgba(184, 131, 124, 0.3); }
button.danger:hover { color: #d09a92; border-color: rgba(184, 131, 124, 0.55); }

input[type=text], input[type=password], textarea, select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-raised);
  border: 1px solid var(--line-mid);
  color: var(--fg);
  transition: border-color 200ms var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--line-strong);
}
input::placeholder { color: var(--fg-faint); }

label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--fg-faint); }
label input { margin-top: 0.55rem; letter-spacing: normal; text-transform: none; }

.flash {
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(184, 131, 124, 0.35);
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.pager {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  align-items: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 40rem) {
  .header-inner { padding: 1.3rem 1.4rem; gap: 1.2rem; }
  header nav { gap: 1.2rem; margin-left: 0; width: 100%; }
  main { padding: 3.5rem 1.4rem 5rem; }
  .dossier { padding: 1.8rem 1.5rem; }
  table.kv th { width: auto; }
}

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
