/* Pakteris Relay Authority — shared styles */

:root {
  --bg: #060a12;
  --bg-console: #04070c;
  --panel: #0b1622;
  --panel-2: #08111b;
  --border: #16324a;
  --border-2: #1f5a6e;
  --cyan: #3fe0ff;
  --on-cyan: #04121a;
  --amber: #ffb347;
  --term-bg: #0d0a05;
  --term-border: #3a2a12;
  --text-head: #f2fbfe;
  --text: #cfe3ee;
  --text-2: #9fbfcd;
  --muted: #7fa3b5;
  --down: #ff8a7a;

  --font-ui: "Rajdhani", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --cut: 14px;
  --glow: 0 0 18px rgba(63, 224, 255, 0.25);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1, h2, h3 {
  color: var(--text-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: var(--cyan); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 20px;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono { font-family: var(--font-mono); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--cyan);
  color: var(--on-cyan);
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Cut-corner panels & buttons ---------- */

.cut {
  clip-path: polygon(
    0 0, calc(100% - var(--cut)) 0, 100% var(--cut),
    100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))
  );
}

.panel {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  padding: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 26px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.97); filter: brightness(1.25); }
.btn-primary { background: var(--cyan); color: var(--on-cyan); box-shadow: var(--glow); }
.btn-ghost { background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 1px var(--border-2); }
.btn-ghost:hover { background: rgba(63, 224, 255, 0.08); }

/* ---------- Status chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-nominal { color: var(--cyan); }
.status-degraded { color: var(--amber); }
.status-down { color: var(--down); }

/* ---------- Terminal (amber) ---------- */

.terminal {
  position: relative;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.terminal::after {
  /* faint scanlines, terminal panels only */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(255, 179, 71, 0.05) 0 1px, transparent 1px 3px
  );
}
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--amber);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Boot line ---------- */

.bootline {
  padding: 6px 20px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.92);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-head);
  text-decoration: none;
}
.brand svg { width: 44px; height: 44px; flex: none; }
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.1; }
.brand-sub { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em; color: var(--muted); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--cyan); }

/* ---------- Sections ---------- */

section { padding-block: 72px; }
section + section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-head p { max-width: 62ch; color: var(--text-2); margin: 0; }

/* ---------- Hero ---------- */

.hero { padding-block: 64px 48px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
}
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.4rem); letter-spacing: 0.02em; }
.hero h1 span { color: var(--cyan); text-shadow: 0 0 24px rgba(63, 224, 255, 0.45); }
.hero p { font-size: 1.15rem; color: var(--text-2); max-width: 52ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-seal svg {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 22px rgba(63, 224, 255, 0.3));
}

/* ---------- Status strip ---------- */

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 48px;
  background: var(--border);
  border: 1px solid var(--border);
}
.status-strip div { background: var(--panel-2); padding: 16px 20px; }
.status-strip dt { margin-bottom: 4px; }
.status-strip dd { margin: 0; font-family: var(--font-mono); font-size: 1.35rem; color: var(--amber); }

/* ---------- Network ---------- */

.network-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}
.map-box { padding: 12px; }
.map-box svg { width: 100%; height: auto; display: block; }
.node-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}
.signal-line { stroke-dasharray: 4 6; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }

.station-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.station-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.station-list h3 { font-size: 1.15rem; margin: 0; letter-spacing: 0.04em; }
.station-list p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.network-note { margin-top: 16px; font-size: 0.95rem; color: var(--text-2); }

/* ---------- Couriers ---------- */

.courier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.courier-card { box-shadow: var(--glow); }
.courier-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.courier-card h3 { font-size: 1.6rem; margin: 0; }
.courier-class { font-family: var(--font-mono); color: var(--amber); font-size: 0.9rem; }
.courier-card .role { color: var(--text-2); min-height: 3.2em; }
.courier-card svg.courier-icon { width: 100%; height: 90px; display: block; margin: 8px 0 14px; }
.stats { margin: 0; display: grid; gap: 8px; }
.stat { display: grid; grid-template-columns: 7.5em 1fr 1.6em; align-items: center; gap: 10px; }
.stat dt { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 0; font-family: var(--font-mono); color: var(--text-head); text-align: right; }
.bar { height: 8px; background: #0e2433; position: relative; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--cyan); box-shadow: 0 0 8px rgba(63, 224, 255, 0.6); }

/* ---------- Archive ---------- */

.archive-log { padding: 22px 24px; max-height: 460px; overflow-y: auto; }
.archive-log ol { list-style: none; margin: 0; padding: 0; }
.archive-log li { padding: 8px 0; border-bottom: 1px dashed rgba(255, 179, 71, 0.18); }
.archive-log li:last-child { border-bottom: 0; }
.log-date { color: #ffd59a; }
.log-from { color: var(--text-head); }
.log-text { display: block; color: var(--amber); }

/* ---------- Channel ---------- */

.channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.channel-grid p { color: var(--text-2); }
.channel-grid code { font-family: var(--font-mono); color: var(--amber); overflow-wrap: anywhere; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding-block: 28px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero .wrap, .network-grid, .channel-grid { grid-template-columns: 1fr; }
  .hero-seal { order: -1; }
  .hero-seal svg { max-width: 260px; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  section { padding-block: 56px; }
}
@media (max-width: 420px) {
  .status-strip { grid-template-columns: 1fr; }
  .station-list li { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .node-pulse, .signal-line { animation: none; }
  .node-pulse { opacity: 0; }
  .btn { transition: none; }
}
