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

:focus-visible { outline: 3px solid var(--ap-gold-500); outline-offset: 3px; }
[hidden] { display: none !important; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% -10%, rgba(62, 106, 168, .24), transparent 32rem),
    var(--ap-color-bg);
  color: var(--ap-color-ink);
  font: 16px/1.55 var(--ap-family-sans);
}
button,
input,
select { font: inherit; }
button,
a { -webkit-tap-highlight-color: transparent; }
a { color: var(--ap-gold-500); text-underline-offset: .2em; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .7rem 1rem;
  border-radius: .5rem;
  background: var(--ap-gold-500);
  color: var(--ap-navy-950);
  font-weight: 750;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--ap-color-border);
  background: rgba(6, 19, 38, .94);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--ap-stone);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, .65);
  border-radius: .75rem;
  color: var(--ap-gold-500);
  font-family: var(--ap-family-serif);
  font-weight: 700;
}
.brand strong,
.brand small { display: block; }
.brand small { color: var(--ap-horizon); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: .8rem; }
#identity { max-width: 18rem; overflow: hidden; color: var(--ap-horizon); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }

main { width: min(100% - 2rem, 100rem); margin: 0 auto; padding-bottom: 4rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(15rem, .6fr);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: end;
  padding: clamp(3rem, 8vw, 7rem) 0 2.5rem;
}
.hero h1 {
  max-width: 15ch;
  margin: .4rem 0 1.1rem;
  font: 600 clamp(2.5rem, 6vw, 5.5rem)/.98 var(--ap-family-serif);
  letter-spacing: -.035em;
}
.lede { max-width: 48rem; margin: 0; color: var(--ap-horizon); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.lede.compact { max-width: 64rem; font-size: 1rem; }
.eyebrow {
  margin: 0;
  color: var(--ap-gold-500);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.trust-card {
  display: grid;
  gap: .35rem;
  padding: 1.25rem;
  border: 1px solid var(--ap-color-border);
  border-left: 3px solid var(--ap-gold-500);
  border-radius: .75rem;
  background: rgba(11, 31, 59, .72);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .15);
}
.trust-card span { color: var(--ap-horizon); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.trust-card strong { color: var(--ap-stone); font-family: var(--ap-family-serif); font-size: 1.25rem; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}
.button.primary { background: var(--ap-gold-500); color: var(--ap-navy-950); }
.button.primary:hover { background: #e0c35c; }
.button.quiet { border-color: var(--ap-color-border); background: rgba(11, 31, 59, .45); color: var(--ap-stone); }
.button.quiet:hover { border-color: var(--ap-gold-500); }
.text-button { padding: .25rem; border: 0; background: transparent; color: var(--ap-gold-500); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }

.status {
  margin-bottom: 1.25rem;
  padding: .85rem 1rem;
  border: 1px solid var(--ap-color-border);
  border-left: 3px solid var(--ap-gold-500);
  border-radius: .6rem;
  background: rgba(11, 31, 59, .7);
  color: var(--ap-horizon);
}
.status.success { border-left-color: #68d391; }
.status.error { border-left-color: #fc8181; color: #fed7d7; }
.status.loading { animation: pulse 1.2s ease-in-out infinite alternate; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}
.summary-grid article {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--ap-color-border);
  border-radius: .7rem;
  background: rgba(11, 31, 59, .65);
}
.summary-grid span { display: block; color: var(--ap-horizon); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.summary-grid strong { display: block; overflow: hidden; margin-top: .2rem; color: var(--ap-stone); font-size: 1.15rem; text-overflow: ellipsis; white-space: nowrap; }

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(8rem, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--ap-color-border);
  border-radius: .75rem;
  background: rgba(11, 31, 59, .65);
}
.filters label { display: grid; gap: .3rem; color: var(--ap-horizon); font-size: .78rem; font-weight: 700; }
.filters .search { grid-column: span 2; }
.filter-actions { display: flex; align-items: end; gap: .5rem; }
input,
select {
  width: 100%;
  min-height: 44px;
  padding: .58rem .7rem;
  border: 1px solid var(--ap-color-border);
  border-radius: .5rem;
  background: var(--ap-navy-950);
  color: var(--ap-stone);
}
input::placeholder { color: #8094b7; }

.evidence-layout { display: grid; grid-template-columns: minmax(20rem, .8fr) minmax(0, 1.5fr); gap: 1rem; align-items: start; }
.timeline-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--ap-color-border);
  border-radius: .8rem;
  background: rgba(11, 31, 59, .8);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .12);
}
.timeline-panel { position: sticky; top: 5.5rem; overflow: hidden; }
.detail-panel { min-height: 36rem; padding: 1.25rem; }
.panel-heading,
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-heading { padding-bottom: 1rem; border-bottom: 1px solid var(--ap-color-border); }
.timeline-panel .panel-heading { padding: 1rem; }
.panel-heading h2 { margin: .2rem 0 0; font: 600 1.45rem/1.2 var(--ap-family-serif); }
.section-heading { margin-top: 2rem; }
.section-heading h3 { margin: 0; font: 600 1.2rem/1.2 var(--ap-family-serif); }

.timeline { max-height: calc(100vh - 15rem); margin: 0; padding: .5rem 0; overflow: auto; list-style: none; }
.timeline-event {
  display: grid;
  width: 100%;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: .8rem;
  padding: .85rem 1rem;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--ap-stone);
  cursor: pointer;
  text-align: left;
}
.timeline-event:hover,
.timeline-event[aria-pressed="true"] { border-left-color: var(--ap-gold-500); background: rgba(28, 60, 107, .48); }
.event-marker { width: .7rem; height: .7rem; margin-top: .35rem; border: 2px solid var(--ap-gold-500); border-radius: 50%; box-shadow: 0 0 0 4px rgba(212, 175, 55, .12); }
.type-agent-kill,
.type-gateway-deny { border-color: #fc8181; box-shadow: 0 0 0 4px rgba(252, 129, 129, .12); }
.type-deployment,
.type-backup-restore { border-color: #68d391; box-shadow: 0 0 0 4px rgba(104, 211, 145, .12); }
.event-copy { display: grid; min-width: 0; gap: .12rem; }
.event-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-copy > span:last-child { overflow: hidden; color: var(--ap-horizon); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.event-meta { color: var(--ap-gold-500); font-size: .7rem; }
.timeline-empty { padding: 2rem 1rem; color: var(--ap-horizon); text-align: center; }
.pagination { padding: .75rem 1rem; border-top: 1px solid var(--ap-color-border); }

.empty-state { display: grid; min-height: 31rem; place-content: center; justify-items: center; color: var(--ap-horizon); text-align: center; }
.empty-state > span { color: var(--ap-gold-500); font: 4rem/1 var(--ap-family-serif); }
.empty-state h2 { margin: 1rem 0 .25rem; color: var(--ap-stone); font-family: var(--ap-family-serif); }
.empty-state p { max-width: 30rem; margin: 0; }
.badge,
.verification {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border: 1px solid var(--ap-color-border);
  border-radius: 999px;
  color: var(--ap-horizon);
  font-size: .75rem;
  font-weight: 750;
  text-transform: uppercase;
}
.verification.valid { border-color: #68d391; color: #9ae6b4; }
.verification.invalid { border-color: #fc8181; color: #feb2b2; }
.facts { display: grid; grid-template-columns: minmax(8rem, .45fr) minmax(0, 1.55fr); margin: 1.5rem 0 0; border-top: 1px solid var(--ap-color-border); }
.facts dt,
.facts dd { margin: 0; padding: .65rem 0; border-bottom: 1px solid var(--ap-color-border); overflow-wrap: anywhere; }
.facts dt { color: var(--ap-horizon); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { color: var(--ap-stone); }
.facts.technical dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
.chain { margin: .5rem 0 0; padding: 0; list-style: none; }
.chain button { width: 100%; padding: .6rem 0; border: 0; border-bottom: 1px solid var(--ap-color-border); background: transparent; color: var(--ap-stone); cursor: pointer; text-align: left; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
details { margin-top: 1.5rem; border-top: 1px solid var(--ap-color-border); }
summary { padding: 1rem 0; color: var(--ap-gold-500); cursor: pointer; font-weight: 750; }
pre { max-height: 32rem; margin: 0; overflow: auto; padding: 1rem; border-radius: .6rem; background: var(--ap-navy-950); color: #d7e0ef; font: .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

footer {
  padding: 2rem max(1rem, calc((100vw - 100rem) / 2));
  border-top: 1px solid var(--ap-color-border);
  color: var(--ap-horizon);
  font-size: .82rem;
}

@keyframes pulse { from { opacity: .65; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .evidence-layout { grid-template-columns: 1fr; }
  .timeline-panel { position: static; }
  .timeline { max-height: 32rem; }
}
@media (max-width: 700px) {
  .site-header { align-items: flex-start; }
  #identity { display: none; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 3rem; }
  .summary-grid,
  .filters { grid-template-columns: 1fr; }
  .filters .search { grid-column: auto; }
  .filter-actions { align-items: stretch; }
  .filter-actions .button { flex: 1; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
  .facts dd { padding-top: .25rem; }
  .panel-heading { align-items: flex-start; }
}
