/*
 * secure: 02 Secure, the page's one night (full-bleed), the same story row flipped (lib/story.css) with
 * the laptop (lib/devices.css). Home Reframe 2026-11-28.
 */

/* NEW TOKENS (scoped to this section) */
[data-section="secure"] {
  --sec-dot: rgb(233 238 244 / 0.17);
  --sec-dot-step: 18px;
  --sec-hot: rgb(20 44 58 / 0.9);  /* a cool glow behind the laptop, so the black lid lifts off the night */
}

[data-section="secure"].secure { isolation: isolate; overflow: clip; }

/* The night's dotted field (still: no drift, nothing to repaint), densest behind the laptop, gone
   under the text. The map never mirrors, but this field does: it follows the laptop's side. */
[data-section="secure"] .sec-dots {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 58% at 30% 50% in oklab, var(--sec-hot) 0%, rgb(13 24 34 / 0) 75%);
}
[data-section="secure"] .sec-dots::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--sec-dot) 1px, transparent 1.5px);
  background-size: var(--sec-dot-step) var(--sec-dot-step);
  -webkit-mask-image: radial-gradient(48% 66% at 30% 50%, #000 0%, rgb(0 0 0 / 0.55) 48%, transparent 82%);
          mask-image: radial-gradient(48% 66% at 30% 50%, #000 0%, rgb(0 0 0 / 0.55) 48%, transparent 82%);
}
[dir="rtl"] [data-section="secure"] .sec-dots { background: radial-gradient(42% 58% at 70% 50% in oklab, var(--sec-hot) 0%, rgb(13 24 34 / 0) 75%); }
[dir="rtl"] [data-section="secure"] .sec-dots::before {
  -webkit-mask-image: radial-gradient(48% 66% at 70% 50%, #000 0%, rgb(0 0 0 / 0.55) 48%, transparent 82%);
          mask-image: radial-gradient(48% 66% at 70% 50%, #000 0%, rgb(0 0 0 / 0.55) 48%, transparent 82%);
}
@media (max-width: 63.99rem) {
  /* one column: the laptop sits under the text */
  [data-section="secure"] .sec-dots { background: radial-gradient(70% 36% at 50% 74% in oklab, var(--sec-hot) 0%, rgb(13 24 34 / 0) 75%); }
  [data-section="secure"] .sec-dots::before,
  [dir="rtl"] [data-section="secure"] .sec-dots::before {
    -webkit-mask-image: radial-gradient(80% 40% at 50% 74%, #000 0%, rgb(0 0 0 / 0.5) 50%, transparent 85%);
            mask-image: radial-gradient(80% 40% at 50% 74%, #000 0%, rgb(0 0 0 / 0.5) 50%, transparent 85%);
  }
}

/* The device on the night: lib/devices.css carries the night rim, shadow and caption inks
   (.hf-ground--night .hf-dev); here only the screen's own ground before the kit mounts. */
[data-section="secure"] .hf-dev__screen,
[data-section="secure"] .hf-dev__viewport { background: var(--hf-color-inst-ground, #0B0F14); }

/* Latin standard names inside the Arabic points never break. */
[data-section="secure"] .hf-row__points .hf-ltr { unicode-bidi: isolate; }

/* "red-teamed" never breaks at its hyphen; it keeps the heading's first ink (story.css tones every span). */
[data-section="secure"] .hf-row__title .hf-nowrap { color: inherit; }

/* The kit screen fills the laptop (lib/devices.css seats it like an app). The run and the findings report
   run to the bottom of the window: the body takes the window's height instead of the kit's fixed one. On
   a phone the report is the kit's sheet, anchored to the bottom of that body, so it now meets the bottom
   of the screen (polish 2026-11-28). */
[data-section="secure"] .hf-dev__viewport .hf-rt__body { flex: 1 1 auto; block-size: auto; min-block-size: 0; }
/* screens-restore (2026-11-28, D-041): on the laptop (the kit's wide layout) the findings report runs to the bottom of
   the screen: the OWASP LLM Top 10 coverage and the finding's MITRE ATLAS chain come back (page.css hides them on the
   home page; without them the report pane left a blank band under the finding card, about a third of the pane). The
   per-row codes stay hidden. Measured at the composed moment (19 s): the report fills to 28 px of the pane's bottom
   padding in English. On a phone the report is the kit's sheet and keeps its own content. */
@container hf-screen (min-width: 760px) {
  [data-section="secure"] .hf-dev__viewport [data-screen="red-team-run"] .hf-rt__cover,
  [data-section="secure"] .hf-dev__viewport [data-screen="red-team-run"] .hf-rt__chain { display: flex !important; flex-direction: column; }
}
/* The sheet is sized to the finding, its fix and its retest (232 px of content in English, 250 in Arabic,
   measured at the composed moment), so the run above it gets the rest of the screen. */
@media (max-width: 47.99rem) {
  [data-section="secure"] .hf-dev__viewport .hf-rt { --hf-rt-sheet-h: 262px; }
  [data-section="secure"] .hf-dev__viewport .hf-rt:lang(ar) { --hf-rt-sheet-h: 280px; }
}
/* screens-fix (2026-11-28): on a phone the sheet stays up (the loop comes back at 12.4 s, the finding logged:
   section.js loopFromPhone), so the run never leaves a blank band where the sheet drops between loops */
@container hf-screen (max-width: 759px) {
  [data-section="secure"] .hf-dev__viewport [data-screen="red-team-run"] .hf-rt__report { transform: none; }
  [data-section="secure"] .hf-dev__viewport [data-screen="red-team-run"] .hf-rt__stage { padding-block-end: calc(var(--hf-rt-sheet-h) + var(--hf-rt-sheet-gap)); }
}

/* home-bots-pricing (2026-11-28; the founder: "Where are the bots?"): the Red-team tester stands beside the laptop,
   on the outer side, at the corner of its base, facing the screen; its name in real text on the caption's line.
   It sends its probes at the screen (section.js: small sea-glass dots, transform and opacity only) and the target
   holds: a ring where they stop, and the tester's blocked face. The laptop gives the tester 96 px of its column
   (it stays at most 560 px, from devices.css). Phones: the tester and its name are one row above the phone. */
[data-section="secure"] {
  --sec-bot: 88px;
  --sec-probe: #7FDCCF;            /* sea glass on the night (never amber) */
  --sec-held: rgb(127 220 207 / 0.85);
}
[data-section="secure"] .sec-stage {
  position: relative; display: flex; flex-direction: row-reverse; align-items: flex-end; justify-content: center;
  inline-size: 100%;
}
[data-section="secure"] .sec-stage > .sec-dev { flex: none; inline-size: min(560px, calc(100% - 96px)); margin-inline: 0; }
[data-section="secure"] .sec-bot {
  position: relative; z-index: 2; flex: none; display: grid; justify-items: center;
  inline-size: 112px; margin-inline-end: -16px;   /* it stands at the corner of the laptop's base */
}
[data-section="secure"] .sec-bot__fig { display: grid; place-items: end center; inline-size: var(--sec-bot); block-size: var(--sec-bot); line-height: 0; }
[data-section="secure"] .sec-bot__name {
  margin: 18px 0 0; font-size: 14px; font-weight: 600; line-height: 1.45; text-align: center; color: #F5F5F1; white-space: nowrap;
}
[data-section="secure"]:lang(ar) .sec-bot__name { line-height: 1.6; }
/* screens-fix (2026-11-28): the long Arabic name widened the bot's column and pushed the tester onto the laptop's
   screen; beside the laptop it wraps under the bot instead */
@media (min-width: 48rem) {
  [data-section="secure"]:lang(ar) .sec-bot__name { white-space: normal; text-wrap: balance; }
}
[data-section="secure"] .sec-probes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
[data-section="secure"] .sec-probe,
[data-section="secure"] .sec-held {
  position: absolute; inset-block-start: 0; left: 0; display: block; border-radius: 50%; will-change: transform, opacity;
}
[data-section="secure"] .sec-probe { inline-size: 7px; block-size: 7px; margin: -3.5px 0 0 -3.5px; background: var(--sec-probe); box-shadow: 0 0 0 3px rgb(127 220 207 / 0.16); }
[data-section="secure"] .sec-held { inline-size: 28px; block-size: 28px; margin: -14px 0 0 -14px; box-shadow: inset 0 0 0 2px var(--sec-held); }
@media (max-width: 47.99rem) {
  [data-section="secure"] { --sec-bot: 64px; }
  [data-section="secure"] .sec-stage { flex-direction: column-reverse; align-items: center; gap: 14px; }
  [data-section="secure"] .sec-stage > .sec-dev { inline-size: min(100%, 300px); }
  [data-section="secure"] .sec-bot { display: flex; align-items: center; gap: 12px; inline-size: auto; margin: 0; }
  [data-section="secure"] .sec-bot__name { margin: 0; }
}
