/* Security section: security in layers, told with panes. Loaded after styles.css (tokens,
   .sec grid, .svc list, .chip). Every pane plays its story through CSS animations keyed to
   .is-built, which layers.js adds and removes to replay. Diagram on the left, copy on the
   right: the mirror of the AI section below. */

:root { --ease: cubic-bezier(.32, .72, 0, 1); --pw: 420px; --ph: 300px; }

/* The services list carries each layer's colour: its tags always, its bar when it's the
   one in view. The assessment covers every layer, so its bar runs through all five. */
:root { --c-all: linear-gradient(#ff4b4b, #ffd02b, #3d8bff, #2fd16b, #b25cff); }
.svc li { --c: var(--teal); }
.svc .tags { color: color-mix(in srgb, var(--c) 70%, #8b95a3); }
.svc.is-live li.is-on { border-left-color: var(--c); }
.svc.is-live li.is-on .tags { color: var(--c); }
.svc.is-live li.all-layers.is-on { border-image: var(--c-all) 1; }
.svc li.all-layers .tags, .svc.is-live li.all-layers.is-on .tags { color: #c3cad3; }

/* The stage: pinned in the middle of the screen while the list scrolls. */
.stage-col { order: -1; position: sticky; top: max(84px, calc(50vh - 300px)); align-self: start; }
/* --cx is the stack centre. Half a pane in from the column edge, so a pulled-out pane sits on the
   content left edge and the section has the same margin on both sides at any width. */
.stage { --cx: calc(var(--pw) / 2); position: relative; height: 590px; perspective: 2400px; }
.stage-note { margin: 4px 0 0; color: #5d6876; }

/* A layer is a pane. In the stack it is shrunk and tilted into an isometric slab; pulled
   out, the same element turns face-on below the stack. Same transform functions in both
   states, so the browser animates between them. */
.layer {
  position: absolute; left: calc(var(--cx) - var(--pw) / 2); top: 0;
  width: var(--pw); height: var(--ph);
  z-index: calc(10 - var(--i));
  transform: translate3d(0, calc(-80px + var(--i) * 30px), 0) rotateX(60deg) rotateZ(-45deg) scale(.5);
  transition: transform .8s var(--ease);
}
.layer .pane {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  background: #11171f; border: 1px solid #2b3541;
  transition: background .35s, border-color .5s, box-shadow .6s var(--ease);
}
/* Stacked: content hidden; a solid face in the layer's colour covers the pane. */
.layer .pane::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 5;
  background: color-mix(in srgb, var(--c) 78%, #10151c);
  transition: opacity .45s .15s;
}
.layer:not(.is-out) .pane { background: color-mix(in srgb, var(--c) 78%, #10151c); box-shadow: -16px 16px 0 0 color-mix(in srgb, var(--c) 45%, #06080b); border-color: transparent; }
.layer.is-out .pane::after { opacity: 0; transition: opacity .35s; }
.layer .pane > * { opacity: 0; transition: opacity .25s; }
.stage.is-fanned .layer { transform: translate3d(0, calc(10px + var(--i) * 56px), 0) rotateX(60deg) rotateZ(-45deg) scale(.5); }

.layer.is-out {
  z-index: 20;
  transform: translate3d(0, 268px, 0) rotateX(0deg) rotateZ(0deg) scale(1);
}
.layer.is-out .pane {
  border-color: color-mix(in srgb, var(--c) 30%, rgba(255,255,255,.08));
  box-shadow: 0 0 0 6px rgba(255,255,255,.02), 0 40px 90px -20px rgba(0,0,0,.85);
}
.layer.is-out .pane > * { opacity: 1; transition: opacity .4s .45s; }
/* While replaying, the content dips out so the reset is never seen. */
.layer.is-out.is-fading .pane > * { opacity: 0; transition: opacity .3s; }
.is-fading * { animation: none !important; }

/* Labels on leader lines, right of the stack. The pulled-out layer's label lights up. */
.labels { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.labels li {
  position: absolute; left: calc(var(--cx) + 140px); top: calc(150px - 80px + var(--i) * 30px);
  transform: translateY(-50%); display: flex; align-items: center; gap: 8px;
  color: #5d6876; font-size: 12px; transition: top .8s var(--ease), color .4s;
}
.labels li::before { content: ''; width: 22px; height: 1px; background: color-mix(in srgb, var(--c) 45%, transparent); transition: background .4s; }
.labels li::after { content: ''; order: -1; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: -4px; opacity: .8; }
.stage.is-fanned .labels li { top: calc(150px + 10px + var(--i) * 56px); }
.labels li.is-out { color: var(--c); }
.labels li.is-out::before { background: var(--c); }

/* Assessment: grades appear by each label as the scan passes; then the verdict. */
.labels .nm { width: 74px; }
.grade {
  width: 32px; height: 26px; display: grid; place-items: center; border-radius: 7px; opacity: 0; transform: scale(.8);
  font: 600 14px/1 var(--sans); color: var(--g);
  border: 1.5px solid var(--g); background: color-mix(in srgb, var(--g) 12%, transparent);
}
.grade-head {
  position: absolute; left: calc(var(--cx) + 140px + 123px); top: calc(150px + 10px - 46px); width: 32px;
  display: flex; justify-content: center; font-size: 10.5px; color: #7d8794; opacity: 0;
}
.stage.is-fanned.is-built .grade-head { animation: show .4s .6s both; }
.scan {
  position: absolute; left: calc(var(--cx) - 190px); width: 380px; height: 1px; top: 120px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 14px 2px rgba(92,200,214,.35);
}
.verdict {
  position: absolute; left: calc(var(--cx) - 150px); width: 300px; top: 500px; text-align: center;
  color: var(--teal); opacity: 0; transform: translateY(6px);
  padding: 10px 14px; border: 1px solid rgba(92,200,214,.3); border-radius: 10px; background: rgba(92,200,214,.05);
}
.stage.is-fanned.is-built .scan { animation: scan 2.2s var(--ease) .5s both; }
.stage.is-fanned.is-built .grade { animation: pop .4s var(--ease) both; animation-delay: calc(.8s + var(--i) * .4s); }
.stage.is-fanned.is-built .labels li { color: #a3acb8; }
.stage.is-fanned.is-built .verdict { animation: rise .5s var(--ease) 3s both; }
.labels li .grade { --i: inherit; }
@keyframes scan { 0% { top: 120px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 440px; opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes riseC { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes show { from { opacity: 0; } to { opacity: 1; } }

/* Pane header shared by the dark panes. */
.ph { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); color: #a9b2be; font-size: 12px; }
.ph-meta { color: var(--c); }
/* Light along the top edge of a pulled-out pane, in its layer's colour. */
.layer .pane::before {
  content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; z-index: 6; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--c), transparent); transition: opacity .4s .5s;
}
.layer.is-out .pane::before { opacity: 1; }

/* ---- Edge: attack path ---- */
.path { position: relative; height: 150px; margin: 34px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.wire { position: absolute; left: 40px; right: 40px; top: 50%; height: 1px; background: #2b3541; }
.node {
  position: relative; width: 84px; text-align: center;
  z-index: 1; padding: 9px 6px; border-radius: 9px; background: #10151c; border: 1px solid #2b3541; color: #c3cad3; font-size: 11.5px;
}
.node.data { border-color: rgba(92,200,214,.4); color: var(--teal); }
.lock {
  position: absolute; left: 50%; top: -12px; transform: translateX(-50%) scale(.8); opacity: 0;
  font-size: 10px; padding: 3px 7px; border-radius: 6px; color: var(--teal); background: #0d2a30; border: 1px solid rgba(92,200,214,.5);
}
.probe { position: absolute; top: 50%; left: 9%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 12px var(--alert); opacity: 0; z-index: 2; }
.blocked { position: absolute; top: 22px; left: 63%; transform: translateX(-50%); color: var(--ok); font-size: 11px; opacity: 0; }
.status { position: relative; height: 22px; margin: 18px 22px 0; font-size: 12.5px; }
.status span { position: absolute; left: 0; top: 0; opacity: 0; color: #a3acb8; }
.status .bad { color: var(--alert); } .status .fix { color: var(--teal); } .status .good { color: var(--ok); }
.layer.is-built .p1 { animation: probe1 1.5s cubic-bezier(.5,0,.5,1) .5s both; }
.layer.is-built .portal { animation: portal 4.6s linear .5s both; }
.layer.is-built .lock { animation: pop .4s var(--ease) 3.1s both; }
.layer.is-built .p2 { animation: probe2 1.3s cubic-bezier(.5,0,.5,1) 3.7s both; }
.layer.is-built .blocked { animation: riseC .4s var(--ease) 4.6s both; }
.layer.is-built .s1 { animation: seg 1.5s .3s both; }
.layer.is-built .s2 { animation: seg 1.3s 1.8s both; }
.layer.is-built .s3 { animation: seg 1.2s 3.1s both; }
.layer.is-built .s4 { animation: show .3s 4.4s both; }
@keyframes probe1 { 0% { opacity: 0; left: 9%; } 10% { opacity: 1; } 75% { left: 62%; opacity: 1; } 100% { left: 62%; opacity: 0; transform: scale(2.4); } }
@keyframes probe2 { 0% { opacity: 0; left: 9%; } 10% { opacity: 1; } 70% { left: 50%; opacity: 1; } 100% { left: 43%; opacity: 0; } }
@keyframes portal { 0%, 30% { border-color: #2b3541; } 32%, 55% { border-color: var(--alert); box-shadow: 0 0 0 4px rgba(242,114,107,.15); } 58%, 100% { border-color: var(--teal); box-shadow: none; } }
@keyframes seg { 0% { opacity: 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---- Identity: sign-in and second-factor prompt ---- */
.signin { position: relative; height: calc(100% - 45px); }
.login {
  position: absolute; left: 20px; top: 26px; width: 182px; display: grid; gap: 10px;
  padding: 18px; border-radius: 12px; background: #10151c; border: 1px solid #222b36;
}
.login > b { font-weight: 500; font-size: 16px; }
.field { height: 32px; border-radius: 7px; border: 1px solid #2b3541; padding: 0 10px; display: flex; align-items: center; font-size: 11.5px; color: #c3cad3; overflow: hidden; }
.typed { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; }
.go { justify-self: start; padding: 7px 14px; border-radius: 7px; background: #edf0f3; color: #0a0d12; font-size: 13px; font-weight: 500; }
.prompt {
  position: absolute; right: 18px; top: 52px; width: 168px; display: grid; gap: 6px; padding: 16px;
  border-radius: 16px; background: #1a222c; border: 1px solid #344050; box-shadow: 0 20px 50px -10px rgba(0,0,0,.7);
  opacity: 0; transform: translateX(30px);
}
.pr-src { color: #7d8794; font-size: 10.5px; }
.prompt > b { font-weight: 500; font-size: 15px; }
.pr-where { color: #a3acb8; font-size: 12px; line-height: 1.4; }
.pr-btns { display: flex; gap: 8px; margin-top: 6px; }
.pr-btns i { flex: 1; text-align: center; font-style: normal; font-size: 12px; padding: 7px 0; border-radius: 8px; background: #232d39; color: #c3cad3; }
.pr-done { display: none; font-size: 12.5px; color: #c3cad3; }
.pr-done b { color: var(--ok); font-weight: 500; }
.layer.is-built .login .typed { animation: type .8s steps(17, end) .5s both; }
.layer.is-built .login .pw .typed { animation: type .5s steps(10, end) 1.4s both; }
.layer.is-built .go { animation: press .3s 2.0s both; }
.layer.is-built .prompt { animation: slidein .5s var(--ease) 2.4s both; }
.layer.is-built .deny { animation: deny .3s 3.6s both; }
.layer.is-built .pr-btns { animation: hide .01s 4.1s both; }
.layer.is-built .pr-done { display: block; animation: show .3s 4.1s both; }
@keyframes type { from { width: 0; } to { width: 100%; } }
@keyframes press { 50% { transform: scale(.94); } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes deny { to { background: var(--red, var(--alert)); color: #fff; } }
@keyframes hide { to { opacity: 0; height: 0; margin: 0; overflow: hidden; } }

/* ---- Cloud: alerts arriving on a phone ---- */
.phone-wrap { display: flex; align-items: center; justify-content: space-between; height: calc(100% - 45px); padding: 0 26px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: #7d8794; font-size: 11.5px; }
.facts b { display: block; color: var(--text); font: 500 22px/1.1 var(--sans); letter-spacing: -0.02em; }
.facts li { opacity: 0; }
.phone {
  position: relative; width: 156px; height: 236px; border-radius: 26px; padding: 14px 9px;
  background: linear-gradient(170deg, #1b2531, #0f151d); border: 1px solid #3a4553;
  display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden;
}
.phone::before { content: ''; position: absolute; top: 8px; width: 40px; height: 5px; border-radius: 3px; background: #0a0d12; }
.clock { font: 500 28px/1 var(--sans); letter-spacing: -0.03em; margin-top: 8px; }
.date { color: #7d8794; font-size: 10px; margin-bottom: 4px; }
.note {
  width: 100%; display: grid; gap: 1px; padding: 7px 9px; border-radius: 12px; margin-top: 5px;
  background: rgba(255,255,255,.08); font-size: 10.5px; color: #a3acb8; line-height: 1.35;
  opacity: 0; transform: translateY(-14px);
}
.note .mono { font-size: 9px; color: #7d8794; }
.note b { color: var(--text); font-weight: 500; font-size: 11.5px; }
.n2 b { color: var(--ok); }
.layer.is-built .facts li { animation: rise .4s var(--ease) both; }
.layer.is-built .facts li:nth-child(1) { animation-delay: .4s; }
.layer.is-built .facts li:nth-child(2) { animation-delay: .55s; }
.layer.is-built .facts li:nth-child(3) { animation-delay: .7s; }
.layer.is-built .n1 { animation: drop .5s var(--ease) 1.2s both, buzz .4s 1.7s; }
.layer.is-built .n2 { animation: drop .5s var(--ease) 3.3s both; }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes buzz { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* ---- People: phishing email, reported ---- */
.mail { list-style: none; margin: 0; padding: 6px 0 0; }
.mail li { position: relative; display: grid; grid-template-columns: 74px 1fr auto; gap: 4px 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: #8b95a3; }
.mail .from { color: #c3cad3; font-weight: 500; }
.mail .phish { background: rgba(255,255,255,.025); }
.mail .phish .subj { color: var(--text); }
.rep { grid-column: 3; grid-row: 1; opacity: 0; font-size: 10.5px; padding: 4px 7px; }
.body { grid-column: 1 / -1; color: #a3acb8; font-size: 12.5px; max-height: 0; overflow: hidden; position: relative; }
.link { color: var(--teal); text-underline-offset: 3px; }
.hover {
  display: inline-block; margin-left: 8px; font-size: 10.5px; color: var(--alert); padding: 3px 7px; border-radius: 6px;
  background: rgba(242,114,107,.1); opacity: 0;
}
.report {
  grid-column: 1 / -1; justify-self: start; font-size: 11px; padding: 6px 10px; border-radius: 7px; border: 1px solid #2b3541; color: #c3cad3;
  max-height: 0; padding-block: 0; border-width: 0; overflow: hidden; opacity: 0;
}
.toast {
  position: absolute; left: 18px; right: 18px; bottom: 16px; padding: 10px 12px; border-radius: 10px; font-size: 11.5px;
  color: var(--ok); background: rgba(95,211,155,.08); border: 1px solid rgba(95,211,155,.25); opacity: 0;
}
.layer.is-built .body { animation: open .5s var(--ease) .7s both; }
.layer.is-built .hover { animation: show .3s 1.7s both; }
.layer.is-built .link { animation: flag .3s 1.7s both; }
.layer.is-built .report { animation: openbtn .4s var(--ease) 2.5s both, pressbtn .3s 3.2s both; }
.layer.is-built .rep { animation: pop .4s var(--ease) 3.6s both; }
.layer.is-built .toast { animation: rise .5s var(--ease) 4.2s both; }
@keyframes open { to { max-height: 40px; margin-top: 4px; } }
@keyframes flag { to { color: var(--red, var(--alert)); text-decoration-color: var(--red, var(--alert)); } }
@keyframes openbtn { to { max-height: 40px; padding-block: 6px; border-width: 1px; opacity: 1; margin-top: 6px; } }
@keyframes pressbtn { to { background: var(--red, var(--alert)); border-color: var(--red, var(--alert)); color: #fff; } }

/* ---- Your data: a light document, then the stamp ---- */
.doc { position: relative; padding: 24px 28px; color: var(--text); height: 100%; }
.doc-kicker { color: #5d6876; font-size: 11px; }
.doc-title { display: block; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0 14px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.checks li { position: relative; padding-left: 28px; font-size: 14px; color: #7d8794; }
.checks li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #3a4553;
}
.checks li::after {
  content: ''; position: absolute; left: 5px; top: 5px; width: 6px; height: 9px; border: solid var(--c); border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); opacity: 0;
}
.stamp {
  position: absolute; right: 26px; bottom: 30px; padding: 10px 16px; border: 2.5px solid var(--c); border-radius: 8px;
  color: var(--c); font-size: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transform: rotate(-9deg) scale(1.8); opacity: 0;
}
.layer.is-built .checks li::after { animation: tick .3s var(--ease) both; animation-delay: calc(.6s + var(--k) * .45s); }
.layer.is-built .checks li { animation: ink .3s both; animation-delay: calc(.6s + var(--k) * .45s); }
.layer.is-built .stamp { animation: stamp .35s cubic-bezier(.3,1.6,.6,1) 3.2s both; }
@keyframes tick { to { transform: rotate(45deg) scale(1); opacity: 1; } }
@keyframes ink { to { color: var(--text); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-9deg) scale(1.8); } to { opacity: .9; transform: rotate(-9deg) scale(1); } }



/* Narrow screens: no stage. Each service carries its own pane, face-on (added by layers.js). */
@media (max-width: 860px) {
  .stage-col { display: none; }
  .svc .layer { position: relative; left: auto; top: auto; transform: none !important; width: 100%; max-width: var(--pw); margin-top: 22px; transition: none; }
  .svc .layer .pane > * { opacity: 1; }
  .svc .layer .pane::after { display: none; }
  .svc .layer li { padding: 11px 18px; border-left: 0; }
  .svc .layer .checks li, .svc .layer .facts li { padding: 0 0 0 28px; }
  .svc .layer .facts li { padding: 0; }
  .svc .layer .signin .login { width: 170px; left: 14px; }
  .svc .layer .prompt { right: 12px; width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .layer, .labels li { transition: none; }
  .layer.is-built *, .stage.is-built * { animation-duration: .001s !important; animation-delay: 0s !important; }
}
