/* End-to-end encryption explainer animation (encrypted-screen-recorder page).
   Without JS (or with reduced motion) the figure shows its final state: everything visible at once. */
.ea { margin: 24px 0 8px; }
.ea-card { position: relative; background: var(--card); border-radius: 30px; padding: 18px 18px 14px; box-shadow: 0 6px 0 rgba(11,36,64,.08), 0 26px 60px rgba(11,36,64,.11); display: grid; gap: 14px; }
.ea-stage { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 4vw, 40px); align-items: end; padding: 64px 4px 0; }
.ea-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ea-label { font: 700 clamp(12px, 1.6vw, 14px)/1.2 var(--display); color: var(--navy); text-align: center; }

/* Screens: a grid of tiles that is either the picture or scrambled */
.ea-screen { position: relative; width: 100%; aspect-ratio: 16 / 10; border: 3px solid var(--navy); border-radius: 12px; background: var(--navy); overflow: hidden; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(6, 1fr); }
.ea-screen { background: #DCEBFA; }
.ea-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: opacity .4s ease; }
.ea-screen i { position: relative; z-index: 1; display: block; background-color: rgba(11,36,64,0); transition: background-color .45s ease; }
.ea-mac .ea-screen { border-radius: 12px 12px 4px 4px; }
.ea-base { width: 116%; height: 9px; margin-top: -8px; background: #C9D9EA; border: 3px solid var(--navy); border-radius: 0 0 12px 12px; }
.ea-srv .ea-screen { border-radius: 10px; }
.ea-rack { width: 100%; display: grid; gap: 4px; margin-top: -4px; }
.ea-rack span { display: block; height: 8px; border: 3px solid var(--navy); border-radius: 6px; background: #DCEBFA; }
.ea-view .ea-screen { border-top-width: 16px; border-radius: 12px; }
.ea-dots { position: absolute; top: -12px; left: 6px; display: flex; gap: 4px; z-index: 1; }
.ea-dots b { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .8; }

/* Badges (lock, eye-off, play, rec) */
.ea-badge { position: absolute; top: -12px; right: -10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); z-index: 2; transition: transform .35s cubic-bezier(.3,1.6,.5,1), opacity .25s; }
.ea-badge svg { width: 17px; height: 17px; }
.ea-lock { background: var(--sun); }
.ea-rec { position: absolute; z-index: 2; left: 8px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 2px #fff; z-index: 1; }
.ea-play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; transition: opacity .3s; }
.ea-play span { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(11,36,64,.3); }
.ea-play svg { width: 13px; height: 13px; margin-left: 2px; color: var(--rec); }

/* Moving parts */
.ea-packet { position: absolute; left: 0; top: 0; width: 34px; height: 24px; border: 3px solid var(--navy); border-radius: 7px; background: repeating-linear-gradient(90deg, #0B2440 0 5px, #45627F 5px 9px, #1B3A5C 9px 14px); box-shadow: 0 4px 0 rgba(11,36,64,.25); opacity: 0; pointer-events: none; z-index: 3; }
.ea-key { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 8px; background: var(--sun); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); font: 700 13px/1.2 ui-monospace, "SF Mono", Menlo, monospace; color: var(--navy); white-space: nowrap; opacity: 0; pointer-events: none; z-index: 4; }
.ea-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; transition: opacity .4s; }
.ea-arc path { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-dasharray: 6 7; stroke-linecap: round; }

/* Link bar */
.ea-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; background: var(--bg); border: 3px solid var(--navy); border-radius: 999px; box-shadow: 0 4px 0 var(--navy); color: var(--navy); transition: opacity .4s, transform .4s; }
.ea-link svg { flex: none; width: 18px; height: 18px; }
.ea-url { min-width: 0; font: 600 clamp(12px, 1.6vw, 15px)/1.3 ui-monospace, "SF Mono", Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ea-url-key { background: var(--sun); border-radius: 6px; padding: 1px 5px; margin-left: 1px; box-shadow: 0 0 0 2px var(--navy); transition: background-color .3s; }

/* Caption + controls */
.ea-foot { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.ea-step { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--sun); border: 3px solid var(--navy); box-shadow: 0 3px 0 var(--navy); font: 800 14px/1 var(--display); color: var(--navy); }
.ea-cap { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 1.35; color: var(--body); transition: opacity .25s; }
.ea-cap b { color: var(--navy); }
.ea-btn { flex: none; display: none; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; border: 2.5px solid var(--navy); background: #fff; color: var(--navy); font: 700 13px/1 var(--display); cursor: pointer; box-shadow: 0 3px 0 var(--navy); }
.ea-btn:active { translate: 0 2px; box-shadow: 0 1px 0 var(--navy); }
.ea-btn svg { width: 12px; height: 12px; }
.ea-steps { margin: 0; padding: 0 4px; list-style: none; display: grid; gap: 6px; font-size: 14.5px; color: var(--body); counter-reset: ea; }
.ea-steps li { display: flex; gap: 8px; }
.ea-steps li::before { counter-increment: ea; content: counter(ea); flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--sun); border: 2px solid var(--navy); font: 800 12px/1 var(--display); color: var(--navy); }

/* JS-driven states. Default (no JS): final state, captions list shown. */
.ea.is-js .ea-steps { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ea.is-js .ea-btn { display: inline-flex; }
.ea:not(.is-js) .ea-foot { display: none; }
.ea:not(.is-js) .ea-arc { opacity: 1; }
.ea.is-js .ea-badge.is-off, .ea.is-js .ea-play.is-off { opacity: 0; transform: scale(.4); }
.ea.is-js .ea-link.is-off { opacity: .35; }
.ea.is-js .ea-link.is-off .ea-url-key { background: transparent; box-shadow: none; }
.ea.is-js .ea-arc.is-on { opacity: 1; }
.ea .ea-rec { animation: ea-blink 1.2s steps(2, jump-none) infinite; }
@keyframes ea-blink { 50% { opacity: .25; } }

@media (max-width: 560px) {
  .ea-card { padding: 14px 12px 12px; border-radius: 24px; }
  .ea-stage { padding-top: 52px; }
  .ea-badge { width: 28px; height: 28px; right: -6px; top: -10px; }
  .ea-badge svg { width: 14px; height: 14px; }
  .ea-key { font-size: 11px; padding: 2px 6px; }
  .ea-packet { width: 26px; height: 19px; }
  .ea-cap { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ea .ea-rec { animation: none; }
}
/* No-JS fallback pictures behind the tiles */
.ea:not(.is-js) .ea-srv .ea-screen { background: repeating-linear-gradient(90deg, #0B2440 0 9%, #45627F 9% 17%, #1B3A5C 17% 26%, #5B7896 26% 31%); }
/* Break out of the narrow text column on wide screens so the diagram has room. */
@media (min-width: 900px) {
  .ea { margin-left: calc(50% - min(440px, 50vw - 24px)); margin-right: calc(50% - min(440px, 50vw - 24px)); }
}
