/* ============================================================================
   PBI IDENTITY — COB surface
   Pitch black, machined edges, one continuous warm light source.
   No remote fonts, no remote assets, no framework.
   ========================================================================== */

:root {
  --black: #000000;
  --panel: #070708;
  --panel-hi: #101012;
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.74);
  --ink-mute: rgba(244, 241, 234, 0.55);
  --ink-faint: rgba(244, 241, 234, 0.3);
  --hair: rgba(255, 255, 255, 0.075);
  --hair-hi: rgba(255, 255, 255, 0.14);
  --cob: #ffe6bd;
  --cob-hot: #fff6e6;
  --cob-deep: #ffc987;
  --cob-glow: rgba(255, 214, 160, 0.42);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, 0.08);
  --ok: #9fe3b0;
  --ok-soft: rgba(159, 227, 176, 0.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- ambient field ------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient::before {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  top: -30%;
  height: 95%;
  background:
    radial-gradient(46% 46% at 50% 40%, rgba(255, 216, 166, 0.12), transparent 70%),
    radial-gradient(48% 52% at 50% 12%, rgba(255, 216, 166, 0.07), transparent 68%),
    radial-gradient(30% 40% at 18% 8%, rgba(120, 168, 255, 0.035), transparent 70%);
  filter: blur(8px);
}

.halo {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(960px, 92vw);
  height: min(760px, 82vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 214, 160, 0.11), rgba(255, 214, 160, 0.035) 46%, transparent 74%);
  filter: blur(20px);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 88% at 50% 42%, transparent 38%, rgba(0, 0, 0, 0.82) 100%);
}

.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* vertical light rails, with a slow travelling current */

.rail {
  position: absolute;
  top: 6vh;
  bottom: 6vh;
  width: 1px;
  opacity: 0.72;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 230, 189, 0.16) 14%,
    rgba(255, 230, 189, 0.42) 50%,
    rgba(255, 230, 189, 0.16) 86%,
    transparent
  );
  box-shadow: 0 0 14px rgba(255, 214, 160, 0.13);
}

.rail::after {
  content: "";
  position: absolute;
  left: -1px;
  width: 3px;
  height: 16vh;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(255, 246, 230, 0.9), transparent);
  filter: blur(1.2px);
  animation: rail-travel 12s var(--ease) infinite;
}

.rail-a { left: max(22px, 5.5vw); }
.rail-b { right: max(22px, 5.5vw); }
.rail-b::after { animation-delay: -6s; }

@keyframes rail-travel {
  0%   { top: -18vh; opacity: 0; }
  12%  { opacity: 0.9; }
  88%  { opacity: 0.9; }
  100% { top: 102vh; opacity: 0; }
}

/* ---------- stage --------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 3.6vw, 42px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.mark svg {
  width: 32px;
  height: 32px;
  flex: none;
}

.mark-text {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--ink);
  line-height: 1;
}

.mark-text em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-weight: 400;
  font-size: 7.5px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
}

.node {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cob);
  box-shadow: 0 0 9px var(--cob-glow);
  animation: breathe 4.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

/* ---------- monolith ------------------------------------------------------ */

.monolith {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(92vw, 436px);
  padding: 38px 34px 26px;
  background:
    linear-gradient(180deg, rgba(255, 230, 189, 0.075), transparent 22%),
    linear-gradient(158deg, rgba(17, 17, 19, 0.94) 0%, rgba(7, 7, 8, 0.975) 48%, rgba(3, 3, 4, 0.99) 100%);
  border: 1px solid var(--hair);
  border-radius: 2px;
  box-shadow:
    0 36px 110px rgba(0, 0, 0, 0.86),
    0 70px 150px -90px rgba(255, 214, 160, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.045) inset,
    0 -18px 60px -40px rgba(255, 214, 160, 0.3) inset;
  backdrop-filter: blur(10px);
  isolation: isolate;
}

/* the continuous COB strip along the top edge: a static diffuse strip with a
   brighter current travelling through it, so the light never disappears */

.monolith::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 230, 189, 0.26) 12%,
    rgba(255, 246, 230, 0.8) 50%,
    rgba(255, 230, 189, 0.26) 88%,
    transparent 100%
  );
  box-shadow:
    0 0 10px rgba(255, 214, 160, 0.55),
    0 0 30px rgba(255, 214, 160, 0.18);
  opacity: 0.95;
}

.cob-run {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 246, 230, 0) 32%,
    rgba(255, 246, 230, 0.95) 50%,
    rgba(255, 246, 230, 0) 68%,
    transparent 100%
  );
  background-size: 42% 100%;
  background-repeat: no-repeat;
  animation: cob-run 9s linear infinite;
  filter: blur(0.5px) drop-shadow(0 0 7px rgba(255, 214, 160, 0.7));
  opacity: 0.9;
}

@keyframes cob-run {
  0%   { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}

/* soft bloom above the strip */

.monolith::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  top: -24px;
  height: 40px;
  background: radial-gradient(58% 100% at 50% 100%, rgba(255, 214, 160, 0.36), transparent 74%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}

/* vertical seam on the left edge */

.cob-edge {
  position: absolute;
  left: -1px;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 230, 189, 0.55), transparent);
  opacity: 0.45;
}

/* matching light seam along the lower edge, slower and quieter */

.cob-foot {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 189, 0.34), transparent);
  box-shadow: 0 0 8px rgba(255, 214, 160, 0.25);
  opacity: 0.6;
  pointer-events: none;
}

.cob-foot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 230, 0.85), transparent);
  background-size: 28% 100%;
  background-repeat: no-repeat;
  animation: cob-run 12s linear infinite reverse;
  opacity: 0.55;
}

/* a faint scan travelling across the panel */

.scan {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  z-index: -1;
}

.scan::before {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  width: 46%;
  left: -60%;
  transform: skewX(-14deg);
  background: linear-gradient(90deg, transparent, rgba(255, 240, 214, 0.035), transparent);
  animation: scan 13s var(--ease) infinite;
}

@keyframes scan {
  0%, 72% { left: -60%; }
  100%    { left: 130%; }
}

/* ---------- contents ------------------------------------------------------ */

.monolith-head { position: relative; }

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
}

.eyebrow b {
  color: var(--cob);
  font-weight: 500;
}

h1 {
  margin: 0 0 11px;
  font-size: clamp(29px, 4.6vw, 38px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 300;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  margin: 0 0 25px;
  max-width: 33ch;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-dim);
}

.notice {
  margin: 0 0 20px;
  padding: 11px 13px;
  border-left: 1px solid var(--cob);
  background: rgba(255, 230, 189, 0.035);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.7;
  letter-spacing: 0.09em;
  color: rgba(244, 241, 234, 0.82);
}

.notice.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #ffd9d4;
}

.notice.is-ok {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: #d8f5df;
}

.notice[hidden] { display: none; }

.field {
  position: relative;
  margin-bottom: 17px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.27em;
  color: var(--ink-mute);
  transition: color 0.25s var(--ease);
}

.field input {
  width: 100%;
  padding: 7px 0 11px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  outline: 0;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.field input::placeholder { color: rgba(255, 255, 255, 0.16); }

.field:focus-within label { color: var(--cob); }

.field:focus-within input {
  border-color: rgba(255, 230, 189, 0.62);
  box-shadow: 0 13px 28px -20px rgba(255, 214, 160, 0.9);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #0a0a0c inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out;
}

.btn-primary {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 0 18px;
  border: 0;
  border-radius: 1px;
  background: linear-gradient(180deg, #fff3df 0%, #ffe0b7 100%);
  color: #0a0805;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  cursor: pointer;
  box-shadow: 0 12px 34px -18px rgba(255, 214, 160, 0.85);
  transition: filter 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.16s var(--ease);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.045);
  box-shadow: 0 16px 40px -16px rgba(255, 214, 160, 0.95);
}

.btn-primary:active:not(:disabled) { transform: translateY(1px); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary svg { flex: none; }

.links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.link {
  padding: 2px 0;
  border: 0;
  background: none;
  color: rgba(244, 241, 234, 0.68);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.link:hover { color: var(--cob); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 23px 0 17px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.26em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.btn-ghost {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.014);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 230, 189, 0.26);
}

.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

.telemetry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 25px 0 0;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.telemetry div { min-width: 0; }

.telemetry dt {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.23);
}

.telemetry dd {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(244, 241, 234, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry dd.is-live { color: var(--cob); }
.telemetry dd.is-dead { color: var(--danger); }

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

.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.foot p {
  margin: 0;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.34);
  overflow-wrap: anywhere;
}

.foot-sub { color: rgba(255, 255, 255, 0.2); }

/* ---------- states -------------------------------------------------------- */

body.is-busy .btn-primary span::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

body.is-error .monolith::before {
  background: linear-gradient(90deg, transparent, rgba(255, 107, 94, 0.12) 12%, rgba(255, 107, 94, 0.9) 50%, rgba(255, 107, 94, 0.12) 88%, transparent);
  filter: drop-shadow(0 0 7px rgba(255, 107, 94, 0.5));
  animation-duration: 2.2s;
}

body.is-error .cob-edge { background: linear-gradient(180deg, transparent, rgba(255, 107, 94, 0.6), transparent); }

body.is-inactive .monolith { filter: saturate(0.55); }
body.is-inactive .btn-primary { opacity: 0.35; }

:focus-visible {
  outline: 1px solid rgba(255, 230, 189, 0.72);
  outline-offset: 3px;
}

::selection { background: rgba(255, 214, 160, 0.24); color: var(--cob-hot); }

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

@media (max-width: 720px) {
  .rail { display: none; }
  .stage { padding: 20px 16px; gap: 18px; }
  .monolith { width: 100%; padding: 30px 22px 22px; }
  .node { display: none; }
  .foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .foot p { font-size: 8px; line-height: 1.8; letter-spacing: 0.05em; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .telemetry div:last-child { display: none; }
  .links { flex-direction: column; align-items: flex-start; gap: 10px; }
  .link { font-size: 8.5px; letter-spacing: 0.16em; }
}

@media (max-height: 720px) {
  .monolith { padding-top: 28px; padding-bottom: 20px; }
  .lede { margin-bottom: 18px; }
  .telemetry { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink-dim: rgba(244, 241, 234, 0.82);
    --ink-mute: rgba(244, 241, 234, 0.62);
    --hair: rgba(255, 255, 255, 0.18);
  }
}
