/* Hero D2 — "which laws apply" (2026-09-30, founder picked option 2 of the D content mockups).
 * Same page as D (d.css is kept unchanged): the deck's title slide, then the product once in view.
 * The labels on the robot now name the EU laws that apply to the part they point at and, after a
 * short "checking…", the audit result (EMC Directive covered · Machinery Regulation 2 gaps · Cyber
 * Resilience Act not in the spec); one line underneath says what is missing. The product demo tells
 * the same compliance story: a quality conflict (cycle time), a Machinery Regulation issue (padlock
 * instead of interlock) and a requirement Ontara adds because the Cyber Resilience Act applies to
 * the networked controller (Art. 2(1), Annex I Part I (2)(c)). All regulation text is quoted from the
 * public EU texts in v2/backend/regulatory; the robot cell itself is an illustrative example.
 * Hero layouts: photo mode (≥ 1280 px wide, landscape ≥ 5:4) puts the labels on the robot;
 * narrower landscape screens list them under the button; phones and portrait screens show the
 * photo as a banner above the text. Resting state = finished, so reduced motion and no-JS get
 * the complete picture. */

/* ================= hero ================= */
.dh { position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh; }
.dh__art { position: absolute; inset: 0; z-index: -1; overflow: clip; background: #f4f6f9; }
.dh__art picture, .dh__art img { display: block; width: 100%; height: 100%; }
.dh__art img { object-fit: cover; object-position: 76% 50%; }
.dh__art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16%; background: linear-gradient(rgba(247, 249, 252, 0), var(--bg)); }

.dh__in { display: flex; align-items: center; min-height: 100vh; min-height: 100svh; max-width: 1344px; margin: 0 auto; padding: 96px 32px 64px; }
.dh__copy { max-width: min(740px, 58%); } /* never positioned: the labels below place themselves on the hero */
.dh__copy .display { font-size: clamp(40px, 4.4vw, 72px); }
.dh__copy .display span { color: var(--ink); }
.dh__copy .lede { margin-top: 22px; color: var(--ink-2); }
.dh__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* the finding: one line that adds the three labels up */
.dh__find { display: grid; gap: 8px; max-width: 30em; margin: 44px 0 0; padding-top: 16px; border-top: 1px solid rgba(13, 36, 64, 0.14); }
.dh__find-k { font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-deep); }
.dh__find-t { font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.dh__find b { font-weight: 600; color: var(--ink); } /* red stays on the status tags */

/* ---- the three labels: a list by default ---- */
.dn { display: grid; gap: 8px; max-width: 380px; margin: 36px 0 0; padding: 0; list-style: none; }
.dn__dot, .dn__lead { display: none; }
.dn__card { display: grid; gap: 4px; padding: 9px 12px 10px; border: 1px solid rgba(13, 36, 64, 0.16); border-radius: 4px; background: #fff; }
.dn__v { font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.dn__v b { margin-right: 5px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--accent-deep); } /* resting = after the check */
.dn__k { font: 500 10.5px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.dn__v b { margin-right: 0; color: var(--ink); }
.dn__s { display: inline-grid; }
.dn__s > em { grid-area: 1 / 1; font-style: normal; }
.dn__p { color: var(--muted-2); opacity: 0; } /* resting = the result */
.dn__r--ok { color: var(--muted); }
.dn__r--bad { font-weight: 600; color: var(--danger); }

/* ---- photo mode: the labels sit on the robot ---- */
@media (min-width: 1280px) and (min-aspect-ratio: 5/4) {
  .dh { height: 100vh; height: 100svh; min-height: 600px; container-type: size; overflow: clip; } /* the photo box is wider than the screen */
  .dh__in { height: 100%; min-height: 0; padding-top: 66px; padding-bottom: 0; }
  /* the list becomes a box with the photo's exact size and crop (object-fit: cover, 76% 50%),
     so each label can point at a spot in the picture (1672 × 941 px) */
  .dn {
    --fw: max(100cqw, 177.68cqh);
    --fh: max(100cqh, 56.28cqw);
    position: absolute;
    left: calc((100cqw - var(--fw)) * 0.76);
    top: calc((100cqh - var(--fh)) * 0.5);
    display: block;
    width: var(--fw);
    height: var(--fh);
    max-width: none;
    margin: 0;
    pointer-events: none;
  }
  .dn__i { position: absolute; width: 0; height: 0; --lead: calc(40px + var(--dx, 0) * var(--fw) / 100); } /* leads end on one line */
  .dn__dot { position: absolute; left: -5px; top: -5px; display: block; width: 10px; height: 10px; border: 1.5px solid var(--ink); border-radius: 50%; background: #fff; }
  .dn__lead { position: absolute; right: 6px; top: -0.5px; display: block; width: var(--lead); height: 1px; background: var(--ink-2); transform-origin: 100% 50%; }
  .dn__card { position: absolute; right: calc(var(--lead) + 6px); top: 0; transform: translateY(-50%); white-space: nowrap; }
}

/* ---- phones and portrait screens: the photo as a banner above the text ---- */
@media (max-width: 759px), (max-aspect-ratio: 1/1) {
  .dh { min-height: 0; }
  .dh__art { position: relative; z-index: auto; height: 46vh; height: 46svh; min-height: 240px; max-height: 560px; }
  .dh__art img { object-position: 84% 45%; }
  .dh__art::after { height: 30%; }
  .dh__in { display: block; min-height: 0; padding: 8px 20px 24px; }
  .dh__copy { max-width: 36em; }
  .dh__find { margin-top: 32px; }
}

/* ---- the labels appear one by one, then the line that adds them up (motion only) ---- */
.motion .dh:not(.is-on) :is(.dn, .dn *, .dh__find, .dh__find *) { animation-play-state: paused !important; }
.motion .dn__i:nth-child(1) .dn__dot { animation: dn-dot 0.3s var(--ease) 0.5s both; }
.motion .dn__i:nth-child(1) .dn__lead { animation: dn-lead 0.4s var(--ease) 0.6s both; }
.motion .dn__i:nth-child(1) .dn__card { animation: dn-card 0.4s var(--ease) 0.8s both; }
.motion .dn__i:nth-child(2) .dn__dot { animation: dn-dot 0.3s var(--ease) 1.1s both; }
.motion .dn__i:nth-child(2) .dn__lead { animation: dn-lead 0.4s var(--ease) 1.2s both; }
.motion .dn__i:nth-child(2) .dn__card { animation: dn-card 0.4s var(--ease) 1.4s both; }
.motion .dn__i:nth-child(3) .dn__dot { animation: dn-dot 0.3s var(--ease) 1.7s both; }
.motion .dn__i:nth-child(3) .dn__lead { animation: dn-lead 0.4s var(--ease) 1.8s both; }
.motion .dn__i:nth-child(3) .dn__card { animation: dn-card 0.4s var(--ease) 2s both; }
.motion .dn__i:nth-child(1) .dn__p { animation: dn-out 0.2s linear 2.6s both; }
.motion .dn__i:nth-child(1) .dn__r { animation: dn-in 0.3s linear 2.7s both; }
.motion .dn__i:nth-child(2) .dn__p { animation: dn-out 0.2s linear 2.9s both; }
.motion .dn__i:nth-child(2) .dn__r { animation: dn-in 0.3s linear 3s both; }
.motion .dn__i:nth-child(3) .dn__p { animation: dn-out 0.2s linear 3.2s both; }
.motion .dn__i:nth-child(3) .dn__r { animation: dn-in 0.3s linear 3.3s both; }
.motion .dh__find { animation: dn-find 0.5s var(--ease) 3.7s both; }
@keyframes dn-dot { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }
@keyframes dn-lead { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes dn-card { from { opacity: 0; translate: 6px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes dn-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dn-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dn-find { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

/* ================= the product ================= */
.dp { padding: 120px 0 24px; }
.dp__in { max-width: 1344px; margin: 0 auto; padding: 0 32px; }
.dp__title { max-width: 15em; margin-top: 16px; }

.dp__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 48px 0 0; padding: 0; list-style: none; }
.dp__step { display: grid; align-content: start; gap: 6px; }
.dp__bar { position: relative; display: block; height: 2px; margin-bottom: 14px; background: var(--line); overflow: clip; }
.dp__fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; }
.dp__step b { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.dp__step em { margin-right: 10px; font: 500 11.5px/1 var(--mono); font-style: normal; letter-spacing: 0.08em; color: var(--accent-deep); }
.dp__step > span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

.dp__box { position: relative; width: 100%; aspect-ratio: 1180 / 660; margin-top: 40px; }

/* ---- the app window (1180 × 660 design px, scaled to the box by d.js) ---- */
.appw {
  position: absolute;
  left: 0;
  top: 0;
  width: 1180px;
  height: 660px;
  transform: scale(var(--k, 1));
  transform-origin: 0 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(13, 36, 64, 0.05), 0 28px 56px -40px rgba(13, 36, 64, 0.3);
  overflow: clip;
  font-size: 13px;
  color: var(--ink);
}
.appw__chrome { position: relative; display: flex; align-items: center; height: 42px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.appw__dots { display: flex; gap: 7px; }
.appw__dots i { width: 11px; height: 11px; border-radius: 50%; background: #dfe5ee; }
.appw__url { position: absolute; left: 50%; transform: translateX(-50%); padding: 5px 14px; border-radius: 6px; background: #eef2f7; font: 500 11.5px/1 var(--mono); color: var(--muted); }
.appw__ctl { position: absolute; right: 12px; top: 8px; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font: 600 11.5px/1 var(--sans); color: var(--ink-2); cursor: pointer; }
.appw__ctl[hidden] { display: none; }
.appw__ctl:hover { border-color: var(--muted-2); color: var(--ink); }
.appw__ctl:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.appw__ctl .ic { width: 12px; height: 12px; }

.appw__body { position: relative; display: grid; grid-template-columns: 208px minmax(0, 1fr); height: calc(100% - 42px); }
.appw__side { display: flex; flex-direction: column; padding: 16px 12px; border-right: 1px solid var(--line); background: #fbfcfe; }
.appw__proj { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; font-size: 13px; }
.appw__proj b { font-weight: 650; }
.appw__proj .ic { width: 14px; height: 14px; margin-left: auto; color: var(--muted-2); }
.appw__mark { width: 20px; height: 20px; border-radius: 5px; background: var(--ink); }
.appw__nav { display: flex; flex-direction: column; gap: 2px; }
.appw__nav span { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.appw__nav .ic { color: var(--muted-2); }
.appw__nav .on { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.appw__nav .on .ic { color: var(--accent); }
.appw__user { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 8px; font-size: 12.5px; color: var(--ink-2); }
.appw__user span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dfe7f3; font: 600 10.5px/1 var(--sans); color: var(--accent-deep); }

.appw__main { position: relative; min-width: 0; padding: 20px 24px; }
.appw__head { display: flex; align-items: center; justify-content: space-between; }
.appw__title { display: flex; align-items: baseline; gap: 12px; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.appw__count { font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.appw__btns { display: flex; gap: 8px; }
.mini { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font: 600 12px/1 var(--sans); color: var(--ink-2); white-space: nowrap; }
.mini .ic { width: 13px; height: 13px; }
.mini--primary { border-color: var(--accent); background: var(--accent); color: #fff; }

@property --n { syntax: "<integer>"; inherits: false; initial-value: 0; }
.cnt { --n: 214; counter-reset: n var(--n); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cnt::before { content: counter(n); }

.imp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.imp__f { display: flex; gap: 10px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.imp__f .tag { flex: none; }
.imp__m { flex: 1; min-width: 0; }
.imp__m b { display: block; overflow: hidden; font: 600 12px/1.3 var(--sans); white-space: nowrap; text-overflow: ellipsis; }
.imp__s { position: relative; display: block; height: 15px; margin-top: 3px; overflow: hidden; font-size: 11px; color: var(--muted); }
.imp__s em { position: absolute; left: 0; top: 0; font-style: normal; white-space: nowrap; }
.imp__s em:first-child { opacity: 0; } /* "Reading…" — only during the demo */
.imp__bar { position: relative; display: block; height: 4px; margin-top: 7px; border-radius: 99px; background: #edf1f6; overflow: clip; }
.imp__bar i { position: absolute; inset: 0; border-radius: 99px; background: var(--accent); transform-origin: 0 50%; }

.appw__table { margin-top: 18px; }
.appw__table .rgt__row { grid-template-columns: 96px minmax(0, 1fr) 124px 180px 156px; min-height: 44px; }
.appw__table .rgt__head { min-height: 34px; }

/* detail panel */
.dw { position: absolute; top: 0; right: 0; bottom: 0; width: 412px; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line-strong); }
.dw__top { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); }
.dw__title { display: block; margin-top: 8px; font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.dw__pills { display: flex; gap: 6px; margin-top: 10px; }
.dw__sec { padding: 14px 22px; border-bottom: 1px solid var(--line); }
.dw__h { margin-bottom: 10px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dw__src { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dw__src li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.dw__src .tag { flex: none; margin-top: -1px; }
.dw__src b { font-weight: 600; color: var(--ink); }
.rgt__row--new .rgt__id, .dw__new { font-weight: 600; color: var(--accent-deep); } /* proposed by Ontara */
.dw__quote { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.dw__quote mark { padding: 0 2px; border-radius: 2px; background: var(--danger-soft); box-shadow: inset 0 -1.5px 0 var(--danger); color: var(--ink); }
.dw__fix { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fbfcfe; font-size: 12.5px; line-height: 1.5; }
.dw__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding: 12px 22px; border-top: 1px solid var(--line); }

/* ---- the demo (motion only; ~8.5 s once in view): 01 read the sources and list the
   requirements · 02 quality check · 03 compliance audit, then the finding in detail ---- */
.motion .dp:not(.is-on) :is(.dp__steps, .appw) * { animation-play-state: paused !important; }

.motion .s-1 { animation: d-step 3.4s linear 0.2s both; }
.motion .s-2 { animation: d-step 1.5s linear 3.7s both; }
.motion .s-3 { animation: d-step 3.2s linear 5.3s both; }
@keyframes d-step { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.motion .d-b1 { animation: d-bar 1.1s var(--ease) 0.4s both; }
.motion .d-b2 { animation: d-bar 1.1s var(--ease) 0.7s both; }
.motion .d-b3 { animation: d-bar 1.1s var(--ease) 1s both; }
.motion .d-b4 { animation: d-bar 1.1s var(--ease) 1.3s both; }
@keyframes d-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.motion .d-rd1 { animation: d-hide 0.2s linear 1.5s both; }
.motion .d-rd2 { animation: d-hide 0.2s linear 1.8s both; }
.motion .d-rd3 { animation: d-hide 0.2s linear 2.1s both; }
.motion .d-rd4 { animation: d-hide 0.2s linear 2.4s both; }
.motion .d-dn1 { animation: d-show 0.3s linear 1.6s both; }
.motion .d-dn2 { animation: d-show 0.3s linear 1.9s both; }
.motion .d-dn3 { animation: d-show 0.3s linear 2.2s both; }
.motion .d-dn4 { animation: d-show 0.3s linear 2.5s both; }
@keyframes d-hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes d-show { from { opacity: 0; } to { opacity: 1; } }

.motion .d-cnt { animation: d-cnt 1.4s var(--ease) 2.4s both; }
@keyframes d-cnt { from { --n: 0; } to { --n: 214; } }
.motion .d-r1 { animation: d-row 0.45s var(--ease) 2.4s both; }
.motion .d-r2 { animation: d-row 0.45s var(--ease) 2.52s both; }
.motion .d-r3 { animation: d-row 0.45s var(--ease) 2.64s both; }
.motion .d-r4 { animation: d-row 0.45s var(--ease) 2.76s both; }
.motion .d-r5 { animation: d-row 0.45s var(--ease) 2.88s both; }
.motion .d-r6 { animation: d-row 0.45s var(--ease) 3s both; }
.motion .d-r7 { animation: d-row 0.45s var(--ease) 3.12s both; }
.motion .d-r8 { animation: d-row 0.45s var(--ease) 3.24s both; }
@keyframes d-row { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.motion .d-run { animation: d-press 0.8s ease-out 3.8s both; }
@keyframes d-press { 40% { background: var(--accent-deep); border-color: var(--accent-deep); transform: scale(0.98); } }
.motion .d-q { animation: d-show 0.3s linear 4.2s both; }
.motion .d-qx { animation: d-pop 0.4s var(--ease) 4.5s both; }
.motion .d-c { animation: d-show 0.3s linear 5.4s both; }
.motion .d-cx { animation: d-pop 0.4s var(--ease) 5.6s both; }
.motion .d-rn { animation: d-row 0.45s var(--ease) 5.9s both; }
.motion .d-cx2 { animation: d-pop 0.4s var(--ease) 6.2s both; }
@keyframes d-pop { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.motion .d-hl { animation: d-show 0.3s linear 6.6s both; }
.motion .d-dw { animation: d-drawer 0.75s var(--ease) 6.8s both; }
@keyframes d-drawer { from { transform: translateX(104%); } to { transform: none; } }
.motion .d-m1 { animation: d-mark 0.4s linear 7.7s both; }
@keyframes d-mark { from { background-color: transparent; box-shadow: inset 0 0 0 transparent; } to { background-color: var(--danger-soft); box-shadow: inset 0 -1.5px 0 var(--danger); } }
.motion .d-fix { animation: d-pop 0.4s var(--ease) 8.1s both; }

/* ---- phones: the steps stack ---- */
@media (max-width: 759px) {
  .dp { padding-top: 88px; }
  .dp__in { padding: 0 20px; }
  .dp__steps { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 36px; }
  .dp__bar { margin-bottom: 10px; }
}
/* ---- below 900 px the window re-flows instead of shrinking to unreadable text ---- */
@media (max-width: 899px) {
  .dp__box { aspect-ratio: auto; margin-top: 32px; }
  .appw { position: relative; width: auto; height: auto; transform: none; }
  .appw__url { display: none; }
  .appw__body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .appw__side,
  .appw__btns,
  .appw__table .rgt__head,
  .appw__table :is(.d-q, .d-c) { display: none; }
  .appw__main { padding: 16px; }
  .imp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .appw__table .rgt__row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0; }
  .appw__table .rgt__row > * { padding: 0 10px; }
  .appw__table .rgt__t { white-space: normal; }
  .dw { position: relative; width: auto; border-left: 0; border-top: 1px solid var(--line-strong); }
}
