/* ============================================================================
   HiltLock, homepage-only components

   The homepage is the only page that shows rather than tells. Everything in
   this file belongs to one of three figures and the hero that holds the first
   of them:

     01  .run      the autonomous run panel      (hero right)
     02  .stack    the attacked application      (section 01)
     03  .gov      the governance shell          (section 02)
     04  .stats    the record strip              (section 03)
     05  .arc      assess / monitor / control    (section 04)

   Loaded by index.html only, after styles.css, so the shared tokens, type
   scale and buttons are inherited rather than redefined. Every colour here
   comes from a token in styles.css; no new palette is introduced.

   Motion rules, applied to all three figures:

     - MOTION IS A ONE-TIME EVENT, NOT A LOOP. Each figure plays once when it
       is first seen and then comes to rest in its completed state. Looping
       figures mean the page is never still, and three of them at once read as
       noise rather than as evidence.
     - Never animate off screen (IntersectionObserver in home.js).
     - prefers-reduced-motion renders the final state and never moves.
     - Easing is ease-out only. Nothing bounces, nothing springs.
   ========================================================================== */

/* --- utilities ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The site default for these tracked mono labels is 11px, which is legible on
   a dense internal page and too small on a page with this much air. */
#main .micro {
  font-size: 12px;
}

/* --- responsible disclosure wall -----------------------------------------
   Twelve marks in a 6 x 2 wall (4 x 3 on tablets, 3 x 4 on phones - twelve
   divides cleanly by all three, so no row is ever half filled).

   Light cells, full-colour marks. The assets are a mix: some are colour, some
   are black-on-transparent, one has an opaque white background. Any single
   filter - grayscale, invert, brightness - makes at least one of them
   invisible or turns one cell into a bright plate. A light cell is the only
   treatment that shows all twelve as designed, and it reads as a credential
   wall rather than a strip of grey shapes.

   Static, not a marquee: a continuously translating band directly under a hero
   that already moves was two claims on the same attention. */
.logos {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 86px;
  padding: 24px 22px;
  background: var(--paper);
  transition: background 0.3s ease;
}
.logo-cell:hover {
  background: #fff;
}
/* One optical height for every mark, whatever its intrinsic size. */
.logos .logo-img {
  height: 30px;
  width: auto;
  max-width: 100%;
  margin: 0;
}
/* Three marks ship as white artwork drawn for a dark background. The cell
   carries the plate and the image carries the filter, so inverting the image
   does not invert the cell with it. */
.logos .logo-img--invert {
  filter: invert(1);
}

@media (max-width: 900px) {
  .logos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .logo-cell {
    height: 74px;
    padding: 18px 14px;
  }
  .logos .logo-img {
    height: 24px;
  }
}

/* --- hero ----------------------------------------------------------------- */
.hero {
  padding-top: 72px;
  padding-bottom: 68px;
}
.hero-split {
  gap: 48px;
  align-items: center;
}
.hero h1 {
  max-width: 19ch;
}
/* The coercion is the point: the model is made to do something it was never
   asked to. One phrase in the accent colour, not the whole line. */
.hero h1 .h1-ember {
  color: var(--ember-500);
}
.hero .lede {
  max-width: 46ch;
  font-size: 18px;
  line-height: 1.55;
}
/* Full column width. A note capped at 46ch in a 520px column broke two words
   onto a second line and read as an orphaned box. */
.hero-note {
  margin-top: 20px;
  max-width: none;
  font-size: 14px;
  line-height: 1.55;
}

.section-head p {
  font-size: 16.5px;
  max-width: 72ch;
}

@media (max-width: 980px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero h1 {
    max-width: 24ch;
  }
}

/* The governance column reads better top-aligned: a centred text block beside
   a tall figure leaves a hole above the eyebrow. `.grid.split` sets
   align-items:center, so this has to out-specify it. */
.grid.gov-split {
  align-items: start;
}

/* ==========================================================================
   01 THE AUTONOMOUS RUN PANEL
   A terminal, not an illustration. The sequence is real: it is the published
   BOLA case, and every value shown appears in
   /articles/case-study-ai-sales-platform. The loop node strip above the log
   is the point of the panel, plan -> act -> observe -> update, because that
   is the difference between an attack library and an attacker.
   ========================================================================== */
.run {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--ink-850);
  overflow: hidden;
}

.run-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  background: var(--ink-800);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-lo);
}
.run-bar span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  color: var(--verify-500);
}
.run-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verify-500);
  box-shadow: 0 0 0 3px rgba(53, 208, 165, 0.15);
}

/* the thinking loop: plan, act, observe, update */
.run-loop {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
}
.run-loop span {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.run-loop span.on {
  color: var(--ember-400);
  border-color: var(--ember-edge);
  background: var(--ember-tint);
}
.run-loop b {
  font-weight: 400;
  color: var(--line-strong);
}

.run-log {
  list-style: none;
  margin: 0;
  padding: 14px 15px 6px;
  height: 268px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.62;
  transition: opacity 0.3s ease;
}
/* With scripting off there is nothing to type, so the panel would be a blank
   box. Collapse it and let the caption carry the meaning. */
.run-log:empty {
  display: none;
}
.run-log li {
  display: flex;
  gap: 10px;
  color: var(--text-mid);
  animation: runLine 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes runLine {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.run-log .t {
  flex: none;
  width: 60px;
  color: var(--text-lo);
}
.run-log .m {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-log .r {
  flex: none;
  color: var(--text-lo);
}
.run-log li.is-ok .r {
  color: var(--verify-500);
}
.run-log li.is-bad .r {
  color: var(--sev-critical);
}
.run-log li.is-note .r {
  color: var(--sev-medium);
}
.run-log li.is-hit .m {
  color: var(--text-hi);
}

.run-foot {
  margin: 0;
  padding: 11px 15px;
  border-top: 1px solid var(--line-faint);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-lo);
  background: var(--ink-800);
}

/* ==========================================================================
   02 THE STACK, WALKED BY AN ATTACKER THAT LEARNS
   The original instruction, restated: the complete AI application stack on
   the right, a thinking attacker on the left, and a slow loop of probes
   travelling from the attacker into each layer and returning as learning.

   Network, infrastructure and the cloud sit last and greyed - they are
   outside scope, and saying so is the honest thing.

   Every result tag beside a layer is a published finding. The loop is slow on
   purpose: plan, attack, observe, learn, then the next layer. Nothing races,
   nothing flashes; a probe lands and holds long enough to read.
   ========================================================================== */
.stack {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 0 44px;
  align-items: start;
}

/* --- the attacker ---------------------------------------------------------- */
.brain {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--ink-850);
  padding: 22px;
}
.brain-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-hi);
}
.brain-loop {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.brain-loop li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-lo);
  transition: color 0.6s ease, border-color 0.6s ease, background 0.6s ease;
}
.brain-loop li.on {
  color: var(--ember-400);
  border-color: var(--ember-edge);
  background: var(--ember-tint);
}
.brain-loop li.on.learn {
  color: var(--verify-500);
  border-color: rgba(53, 208, 165, 0.4);
  background: var(--verify-tint);
}
.brain-note {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-lo);
}

/* --- the stack ------------------------------------------------------------ */
.stack-disco {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-mid);
}
.stack-disco .sd-key {
  margin-right: 12px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember-500);
}
.js .stack-disco {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.layers {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.layer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 14px 22px;
}
.layer::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-900);
  border: 1px solid var(--line-strong);
  transition: background 0.6s ease, border-color 0.6s ease,
    box-shadow 0.6s ease;
}
.layer-id {
  flex: 1 1 auto;
  min-width: 0;
}
.layer-id b {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-hi);
}
.layer-id i {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-lo);
}
.layer-hit {
  display: inline-block;
  flex: none;
  max-width: 44%;
  margin-top: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ember-500);
  /* border-bottom: 1px solid var(--ember-edge); */
  transition: color 0.3s ease, border-color 0.3s ease;
}
.layer-hit::after {
  content: " \2192";
  color: inherit;
}
.layer-hit:hover {
  color: var(--ember-400);
  border-color: var(--ember-400);
}
/* Only the scripted reveal hides the findings; with JavaScript off the whole
   result set is visible at rest. */
.js .layer-hit {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.js .layer.is-hit .layer-hit {
  opacity: 1;
  transform: none;
}
.js .layer.is-out .layer-hit {
  opacity: 1;
  transform: none;
}
.layer.is-attacking::before {
  background: var(--ember-500);
  border-color: var(--ember-500);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.14);
}
.layer.is-learned::before {
  background: var(--verify-500);
  border-color: var(--verify-500);
  box-shadow: 0 0 0 4px rgba(53, 208, 165, 0.16);
}
/* platform: named, greyed, excluded */
.layer.is-out {
  padding-bottom: 6px;
}
.layer.is-out .layer-id b {
  color: var(--text-mid);
}
.layer.is-out .layer-id i,
.layer.is-out .layer-hit {
  color: var(--text-lo);
}
.layer.is-out .layer-hit {
  display: block;
  border-bottom: none;
}
.layer.is-out .layer-hit::after {
  content: none;
}

.stack-note {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line-faint);
  font-size: 14px;
  color: var(--text-lo);
}
.stack-note b {
  color: var(--text-mid);
  font-weight: 500;
}
.stack-note a {
  color: var(--ember-500);
  border-bottom: 1px solid var(--ember-edge);
}

@media (max-width: 860px) {
  .stack {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* On narrow screens the finding cannot sit beside the layer label, so it
   drops back underneath - same as the old layout, which is why the desktop
   flex row is the only thing this overrides. */
@media (max-width: 720px) {
  .layer {
    display: block;
    padding-bottom: 22px;
  }
  .layer::before {
    top: 8px;
    transform: none;
  }
  .layer-hit {
    display: block;
    margin-top: 8px;
    max-width: none;
    text-align: left;
  }
}

/* ==========================================================================
   03 THE GOVERNANCE SHELL
   Model in the middle, two rings around it. Everything the model reads or
   writes crosses both rings and leaves a tick; universal threats fail closed
   at the outer ring, your policy decides at the inner one.

   Geometry is percentage-based so the figure holds at any width without a
   resize handler. Token travel is a CSS transition on left/top.
   ========================================================================== */
/* The figure reserves room above, below and to the right so the three flow
   labels sit outside the outer ring instead of over it. */
.gov-figure {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 58px 0 64px;
}
.gov-shell {
  position: relative;
  width: 92%;
  margin: 0 auto;
  aspect-ratio: 1 / 0.84;
}
.gov-ring {
  position: absolute;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-lg);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.gov-ring.outer {
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(17, 20, 25, 0.6),
    rgba(12, 14, 17, 0.2)
  );
}
.gov-ring.inner {
  inset: 17%;
  background: rgba(17, 20, 25, 0.55);
}
.gov-ring.live {
  border-color: var(--verify-500);
  box-shadow: 0 0 24px rgba(53, 208, 165, 0.16);
}
.gov-tag {
  position: absolute;
  left: 22px;
  top: 16px;
  max-width: 42%;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-lo);
  line-height: 1.45;
}
.gov-ring.inner .gov-tag {
  left: 20px;
  top: 14px;
  color: var(--text-mid);
}
.gov-tag small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-lo);
}
.gov-tag b {
  color: var(--ember-400);
  font-weight: 500;
}

.gov-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--ember-edge);
  border-radius: 50%;
  background: radial-gradient(
      circle at 50% 28%,
      rgba(255, 90, 31, 0.2),
      transparent 68%
    ),
    var(--ink-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.gov-core.live {
  border-color: var(--ember-500);
  box-shadow: 0 0 32px rgba(255, 90, 31, 0.26);
}
.gov-core .c-name {
  color: var(--text-hi);
  font-size: 18px;
  font-weight: 600;
}
.gov-core .c-sub {
  color: var(--text-lo);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.gov-io {
  position: absolute;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mid);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--ink-900);
  padding: 4px 9px;
  white-space: nowrap;
}
.gov-io.in {
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
}
.gov-io.out {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
}
/* Between the two rings: the plan leaves the model and must clear both, so
   its label sits in the band they enclose rather than over either line.
   Shell 92% with a 17% inner inset puts the band centre at 88.2%. */
.gov-io.plan {
  left: 88.2%;
  top: 50%;
  transform: translate(-50%, -50%);
}
/* Under 620px the shell band is too shallow for three chips and two detail
   lines without collisions, so the figure keeps its rings, tokens and ticks
   and drops the text furniture. The caption below already names all three
   crossings and both ring roles, so nothing is lost. */
@media (max-width: 620px) {
  .gov-io {
    display: none;
  }
  .gov-tag {
    top: 14px;
    max-width: 46%;
    font-size: 11px;
  }
  .gov-ring.inner .gov-tag {
    top: 14px;
  }
  .gov-tag small {
    display: none;
  }
}

.gov-token {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--verify-500);
  box-shadow: 0 0 10px rgba(53, 208, 165, 0.85);
  opacity: 0;
  transition: left 0.62s cubic-bezier(0.22, 0.85, 0.3, 1),
    top 0.62s cubic-bezier(0.22, 0.85, 0.3, 1), opacity 0.25s ease;
}
.gov-token.plan {
  background: var(--sev-medium);
  box-shadow: 0 0 10px rgba(240, 169, 59, 0.85);
}
.gov-token.show {
  opacity: 1;
}

.gov-tick {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-900);
  background: var(--verify-500);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.gov-tick.on {
  opacity: 1;
  transform: scale(1);
}

.gov-caption {
  margin: 0 auto;
  max-width: 52ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-lo);
}.gov-caption b {
  color: var(--text-mid);
  font-weight: 500;
}

/* The two enforcement modes. They sit under the copy so the left column
   carries the same weight as the figure beside it, and because "observe first"
   is the answer to the obvious objection: buying a control you have not yet
   measured. */
.gov-modes {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  max-width: 46ch;
  border-top: 1px solid var(--line-faint);
}
.gov-modes li {
  display: flex;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-faint);
}
.gm-key {
  flex: none;
  width: 64px;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ember-400);
}
.gm-val {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-mid);
}

/* ==========================================================================
   04 THE RECORD
   Big number, five-word label. The previous version set these in 10px
   uppercase grey, which was the hardest thing on the page to read.
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-faint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat {
  display: block;
  padding: 22px 20px;
  background: var(--ink-900);
  border: none;
  transition: background 0.2s ease;
}
.section.band .stat {
  background: var(--ink-850);
}
.stat:hover {
  background: var(--ink-800);
}
.stat .stat-n {
  display: block;
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--ember-500);
  font-variant-numeric: tabular-nums;
}
.stat .stat-t {
  display: block;
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-mid);
}
@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat .stat-n {
    font-size: 27px;
  }
}

/* ==========================================================================
   05 THE ARC, assess then monitor then control
   A timeline, not three cards. This is the spine of the offer and it appears
   on every other surface, so it has to be on the homepage as a sequence the
   reader can follow, not as a footnote under the numbers.
   ========================================================================== */
.arc {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}
.arc::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  height: 1px;
  background: var(--line);
}
.arc-step {
  position: relative;
  padding-top: 54px;
}
.arc-n {
  position: absolute;
  top: 0;
  left: 0;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--ember-edge);
  background: var(--ink-900);
  color: var(--ember-500);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.arc-step h3 {
  font-size: 19px;
}
.arc-step p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-mid);
}
.arc-step a {
  display: inline-block;
  margin-top: 12px;
  font-size: 13.5px;
}
@media (max-width: 760px) {
  .arc {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .arc::before {
    top: 18px;
    bottom: 18px;
    left: 17px;
    right: auto;
    width: 1px;
    height: auto;
  }
}

/* --- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .run-log li,
  .run-dot,
  .gov-token,
  .gov-tick,
  .gov-ring,
  .gov-core {
    animation: none !important;
    transition: none !important;
  }
}
