/* AnonyLabs — Products (products.html only, owner 2026-10-13: "more like products", every product presented alike).
   Loaded after site.css; uses its tokens (--fg, --rule, --ease, --pad-*, …) and its catalogue index (.index).

   Every product is one <article class="product"> with the same parts, in this order:
     1. the file header (.dossier): file line + state, mark, name, definition, abstract, facts, the way in;
     2. the plate (.plate): the specimen figure (sticky) and its walkthrough (.walk), five steps.
   The figure is drawn in the product's colour (--accent); so are the active step's rule and number, the "Live"
   square, the open link's corner and the product strip's progress line. */

.products {
  --pnav-h: 48px;
  --bar-h: 48px;
  --gap: clamp(40px, 5vw, 128px);
  --sticky-top: calc(var(--pnav-h) + clamp(12px, 2.4vh, 28px));
  --accent: var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  row-gap: clamp(48px, 7vh, 112px);
  padding-top: clamp(24px, 4.5vh, 80px);
}

.product[data-product="id"],
.pnav[data-current="id"] { --accent: #a98bff; }
.product[data-product="chat"],
.pnav[data-current="chat"] { --accent: #f6d83a; }
.product[data-product="vpn"],
.pnav[data-current="vpn"] { --accent: #ff9f43; }
.product[data-product="mail"],
.pnav[data-current="mail"] { --accent: #4da3ff; }

/* ------------------------------------------------------------------ */
/* Head: kicker, title, one line, the catalogue index                 */
/* ------------------------------------------------------------------ */

.products__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px clamp(32px, 5vw, 120px);
}

.products__intro {
  margin-top: clamp(14px, 2.2vh, 26px);
  max-width: 26em;
  font-size: clamp(16px, 0.45vw + 10px, 22px);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--fg-2);
  text-wrap: pretty;
}

.page a.index__item--sealed {
  color: var(--fg-3);
}

/* ------------------------------------------------------------------ */
/* The product strip: appears once the catalogue has scrolled away,   */
/* marks the product in view, its progress in that product's colour.  */
/* ------------------------------------------------------------------ */

.pnav {
  display: none;
}

.has-pnav .pnav {
  display: block;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  height: var(--pnav-h);
  padding: 0 var(--pad-r) 0 var(--pad-l);
  background: rgba(10, 10, 11, 0.9);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-101%);
  visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s linear 0.5s;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .has-pnav .pnav {
    background: rgba(10, 10, 11, 0.78);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.has-pnav .pnav[data-shown="true"] {
  transform: none;
  visibility: visible;
  transition: transform 0.5s var(--ease), visibility 0s;
}

.pnav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 2.6vw, 48px);
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page a.pnav__item {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: 44px;
  padding: 0 8px;
  font-size: clamp(11px, 0.6vw, 13px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-decoration: none;
  transition: color 0.24s var(--ease);
}

.pnav__mark {
  display: block;
  height: 16px;
  width: auto;
  opacity: 0.45;
  transition: opacity 0.24s var(--ease), scale 0.24s var(--ease);
}

.page a.pnav__item:hover,
.page a.pnav__item:focus-visible,
.page a.pnav__item[aria-current] {
  color: var(--fg);
}

.pnav__item:hover .pnav__mark,
.pnav__item:focus-visible .pnav__mark,
.pnav__item[aria-current] .pnav__mark {
  opacity: 1;
}

.pnav__item:hover .pnav__mark {
  scale: 1.08;
}

.page a.pnav__item:focus-visible {
  outline-offset: -4px;
}

.pnav__bar {
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
}

.pnav__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition: background-color 0.4s var(--ease);
}

[dir="rtl"] .pnav__fill {
  transform-origin: right center;
}

/* Phones: the marks, and the current product's name. */
@media (max-width: 600px) {
  .pnav__item:not([aria-current]) .pnav__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .page a.pnav__item {
    min-width: 44px;
    justify-content: center;
  }
}

/* ------------------------------------------------------------------ */
/* A product                                                          */
/* ------------------------------------------------------------------ */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(32px, 6vh, 88px);
  scroll-margin-top: calc(var(--pnav-h) + 16px);
}

/* 1. The file header. */
.dossier {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas:
    "file file"
    "id facts"
    "id open";
  column-gap: clamp(32px, 6vw, 160px);
  row-gap: clamp(18px, 3vh, 32px);
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

/* The product's colour on the rule: a short stroke that draws itself in. */
.dossier::before {
  content: "";
  position: absolute;
  top: -1px;
  inset-inline-start: 0;
  width: clamp(48px, 8vw, 128px);
  height: 1px;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 1.1s var(--ease) 0.2s;
}

[dir="rtl"] .dossier::before {
  transform-origin: right center;
}

.dossier__file {
  grid-area: file;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--fg-2);
}

.dossier__state {
  color: var(--fg-2);
}

.dossier__id {
  grid-area: id;
}

/* Each product's own mark (flat, on dark), ink-tight box; the width follows the mark's own proportions. */
.dossier__mark {
  display: block;
  height: clamp(36px, min(3.2vw, 6vh), 64px);
  width: auto;
  aspect-ratio: auto 79 / 85;
  margin-bottom: clamp(14px, 2vh, 24px);
}

.dossier__name {
  margin: 0;
  font-size: clamp(34px, min(4.4vw, 8vh), 104px);
  font-weight: 470;
  line-height: 0.92;
  letter-spacing: -0.018em;
  text-transform: uppercase;
  font-feature-settings: "kern", "case";
  color: var(--fg);
  margin-inline-start: -0.04em;
  overflow-wrap: anywhere;
}

.dossier__def {
  margin-top: clamp(14px, 2vh, 24px);
  font-size: clamp(18px, 0.55vw + 10.5px, 26px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.dossier__abstract {
  margin-top: 10px;
  max-width: 30em;
  font-size: clamp(14px, 0.3vw + 9.6px, 18px);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

.dossier__facts {
  grid-area: facts;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px clamp(16px, 2vw, 40px);
}

.dossier__facts div,
.sealed__facts div {
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.dossier__facts dt,
.sealed__facts dt {
  margin-bottom: 9px;
}

.dossier__facts dd,
.sealed__facts dd {
  margin: 0;
  font-size: clamp(14px, 0.18vw + 11.4px, 16.5px);
  line-height: 1.4;
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* "Live": a small square in the product's colour, with a slow ring now and then. */
.dossier__live {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 0.6em;
  vertical-align: 0.12em;
  background: var(--accent);
}

.dossier__live::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid var(--accent);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .dossier__facts .dossier__live::after {
    animation: live-ring 4.8s var(--ease) infinite;
  }
}

@keyframes live-ring {
  0%,
  62% { opacity: 0; scale: 0.6; }
  70% { opacity: 0.8; }
  100% { opacity: 0; scale: 2.2; }
}

/* The way in: a drawn button with a corner mark (leaves the site); the mark takes the product's colour on hover. */
.page a.open-link {
  grid-area: open;
  justify-self: start;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  min-height: 44px;
  padding: 13px 20px 13px 16px;
  font-size: clamp(11.5px, 0.66vw, 14px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--fg-3);
  transition: border-color 0.24s var(--ease), background-color 0.24s var(--ease);
}

.page a.open-link::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
}

.page a.open-link::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: 0.2em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  translate: 0 -1px;
  transition: translate 0.24s var(--ease), border-color 0.24s var(--ease);
}

.page a.open-link:hover,
.page a.open-link:focus-visible {
  border-color: var(--fg);
  background: rgba(232, 230, 225, 0.05);
}

.page a.open-link:hover::after,
.page a.open-link:focus-visible::after {
  translate: 2px -3px;
  border-color: var(--accent);
}

.page a.open-link:focus-visible {
  outline-offset: 3px;
}

/* 2. The plate: the figure (sticky while its steps scroll by) and the walkthrough. */
.plate {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: var(--gap);
  align-items: start;
}

.plate__stage {
  position: sticky;
  top: var(--sticky-top);
  display: grid;
  grid-template-rows: auto var(--bar-h);
  justify-items: center;
}

.plate__field {
  position: relative;
  width: min(100%, calc(100vh - var(--sticky-top) - var(--bar-h) - 72px), 760px);
  width: min(100%, calc(100dvh - var(--sticky-top) - var(--bar-h) - 72px), 760px);
  aspect-ratio: 1 / 1;
}

.plate__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.plate__bar {
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}

.plate__caption {
  display: flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
}

/* The product's mark, small, on the plate's caption line: the figure's stamp. */
.plate__mark {
  display: block;
  height: 14px;
  width: auto;
}

.stepper {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 22px);
  margin-inline-end: -4px;
}

.stepper__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  min-height: 44px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: clamp(10px, 0.56vw, 12px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color 0.24s var(--ease);
}

.stepper__btn::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  transition: background-color 0.24s var(--ease), border-color 0.24s var(--ease);
}

.stepper__btn--next {
  flex-direction: row-reverse;
}

.stepper__btn:hover,
.stepper__btn:focus-visible {
  color: var(--fg);
}

.stepper__btn:hover::before {
  background: var(--accent);
  border-color: var(--accent);
}

.stepper__btn:focus-visible {
  outline-offset: -2px;
}

.stepper__count {
  min-width: 7ch;
  text-align: center;
  color: var(--fg-2);
}

.stepper__now {
  color: var(--fg);
}

/* The walkthrough: five numbered steps; the active one carries the product's colour on its rule and number. */
.walk {
  list-style: none;
  margin: 0;
  /* Desktop: the first step starts level with the middle of the pinned figure, so it has its moment too. */
  padding: max(0px, calc(52vh - var(--sticky-top))) 0 clamp(120px, 34vh, 420px);
}

.walk__step {
  position: relative;
  padding-block: clamp(18px, 4.6vh, 56px);
  padding-inline-start: clamp(20px, 2vw, 36px);
  border-inline-start: 1px solid var(--rule);
  font-size: clamp(12.5px, 0.25vw + 9.4px, 15px);
}

.walk__step::before {
  content: "";
  position: absolute;
  inset-inline-start: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center top;
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}

.walk__step[data-state="seen"]::before {
  transform: scaleY(1);
  opacity: 0.3;
}

.walk__step[data-state="active"]::before {
  transform: scaleY(1);
}

.walk__head {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.walk__key {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9em;
  min-height: 44px;
  padding: 8px 0;
  text-align: start;
  font-size: 1em;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color 0.24s var(--ease);
}

.walk__key:hover,
.walk__key:focus-visible {
  color: var(--fg);
}

.walk__key:focus-visible {
  outline-offset: 2px;
}

.walk__n {
  color: var(--fg-3);
  transition: color 0.24s var(--ease);
}

.walk__key:hover .walk__n,
.walk__step[data-state="active"] .walk__n {
  color: var(--accent);
}

.walk__step[data-state="active"] .walk__key {
  color: var(--fg);
}

.walk__text {
  margin-top: 2px;
  max-width: 30em;
  padding-inline-start: calc(2ch + 0.9em + 0.2em);
  font-size: clamp(14px, 0.25vw + 10.6px, 17px);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
  transition: color 0.4s var(--ease);
}

.walk__step[data-state="active"] .walk__text {
  color: var(--fg);
}

/* ------------------------------------------------------------------ */
/* Sealed file (AL-003): redacted                                     */
/* ------------------------------------------------------------------ */

.sealed-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 3vw, 64px);
}

.sealed {
  display: grid;
  align-content: start;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--mark);
}

.sealed__file {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.sealed__note {
  color: var(--fg-2);
}

.sealed__name {
  margin: 4px 0 0;
}

.sealed__lines {
  display: grid;
  gap: 9px;
}

.sealed__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.sealed__facts dd {
  color: var(--fg-2);
}

/* A redaction bar: a flat block, with a slow sheen passing now and then. */
.redact {
  display: block;
  width: 100%;
  height: 0.8em;
  background-color: rgba(232, 230, 225, 0.075);
  background-image: linear-gradient(100deg, transparent 40%, rgba(232, 230, 225, 0.09) 50%, transparent 60%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0;
  animation: redact-sheen 9s var(--ease) infinite;
}

.redact--title {
  width: min(78%, 11em);
  height: clamp(26px, min(2.6vw, 5vh), 56px);
  font-size: inherit;
}

.redact--title-short {
  width: min(56%, 8em);
}

.redact--mid { width: 86%; }
.redact--shorter { width: 48%; }

.redact--word {
  display: inline-block;
  width: 4.5em;
  height: 0.8em;
  vertical-align: -0.05em;
}

.index li .redact {
  animation-delay: 2.2s;
}

@keyframes redact-sheen {
  0% { background-position: 100% 0; }
  40%,
  100% { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .redact {
    animation: none;
  }
}

/* ------------------------------------------------------------------ */
/* Reveals (products.js): what starts below the first screen rises in */
/* once. Transform and opacity only, so nothing moves the layout.     */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  .has-reveals .is-held {
    transition: opacity 0.9s var(--ease), translate 1s var(--ease);
  }

  .has-reveals .is-held:not(.is-in) {
    opacity: 0;
    translate: 0 22px;
  }

  .has-reveals .dossier.is-held:not(.is-in)::before {
    transform: scaleX(0);
  }

  .has-reveals .walk__step.is-held {
    transition-delay: 0.08s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-pnav .pnav,
  .has-pnav .pnav[data-shown="true"],
  .walk__step::before,
  .dossier::before {
    transition: none;
  }
}

/* ------------------------------------------------------------------ */
/* Mid-size screens: the file header stacks                           */
/* ------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .dossier {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "file" "id" "facts" "open";
  }

  .dossier__facts {
    align-self: start;
  }
}

/* Phones and tablets: the figure sticks under the product strip; the steps follow below it, and the one that crosses
   a reading line under the figure is active. */
@media (max-width: 1100px) {
  html:has(.products) {
    background: var(--bg);
  }

  .products {
    --field: min(calc(100vw - var(--pad-l) - var(--pad-r)), 42vh, 560px);
    --field: min(calc(100vw - var(--pad-l) - var(--pad-r)), 42svh, 560px);
    row-gap: clamp(56px, 10vh, 120px);
  }

  .plate {
    display: block;
  }

  .plate__stage {
    top: var(--pnav-h);
    z-index: 2;
    margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l));
    padding: 12px var(--pad-r) 0 var(--pad-l);
    background: var(--bg);
  }

  .plate__field {
    width: var(--field);
  }

  .walk {
    padding: 8px 0 22vh;
  }

  .walk__step {
    padding-block: 10px 20px;
    scroll-margin-top: calc(var(--pnav-h) + var(--field) + var(--bar-h) + 40px);
  }
}

@media (max-width: 600px) {
  .dossier__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .walk__text {
    padding-inline-start: 0;
  }
}

@media (max-width: 420px) {
  .plate__caption {
    display: none;
  }

  .plate__bar {
    justify-content: center;
  }
}

/* Short landscape screens: the figure scrolls with the page. */
@media (max-width: 1100px) and (orientation: landscape) and (max-height: 520px) {
  .products {
    --field: min(calc(100vw - var(--pad-l) - var(--pad-r)), 80vh, 420px);
  }

  .plate__stage {
    position: relative;
    top: auto;
  }
}
