/* Home page only. Loaded after concept.css, pages.css and ui.css.
   Colours are the product's tokens (docs/design/tokens.css in the product repository). */

/* ---------- 1. First screen: the audit log as a field ---------- */
.hero.scene { position: relative; overflow: hidden; isolation: isolate; }
/* depth behind the field: the dark surface of the product, lit from where the incident is assembled */
.home .hero.scene { background: radial-gradient(ellipse 70% 62% at 74% 36%, #243150 0%, #191f29 46%, #11161e 78%), #11161e; }
.home .masthead { background: #11161ee6; backdrop-filter: blur(10px); }
.scene-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero.scene .hero-wrap { position: relative; }
.hero.scene .hero-grid { grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); align-items: center; }

.chain { --access: #9aafff; --persist: #8cd8da; --collect: #e2bd7b; --action: #f09ba5; min-width: 0; }
.chain-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.chain-src { font: 500 12px/1.3 var(--mono); color: #a6b3c6; letter-spacing: .01em; }
.chain-src i { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #9aafff; vertical-align: 1px; }
.chain.is-run .chain-src i { animation: chain-pulse 1.8s ease-out infinite; }
@keyframes chain-pulse { from { box-shadow: 0 0 0 0 #9aafff80; } to { box-shadow: 0 0 0 9px #9aafff00; } }
.chain-ctl { display: flex; gap: 8px; }
.chain-ctl button { min-height: 30px; padding: 0 12px; border: 1px solid #3f4c60; border-radius: 6px; background: transparent; color: #e8edf5; font: 600 12px/1 var(--font); }
.chain-ctl button:hover { background: #252f3d; }

/* the four stages: the canvas draws the caught marks above these labels */
.chain-map { display: grid; grid-template-columns: repeat(4,1fr); align-items: end; height: clamp(120px,19vh,170px); margin-top: 6px; }
.chain-map span { padding: 9px 0 0 2px; border-top: 2px solid #303b4c; font: 600 12px/1.2 var(--mono); color: #7e8ea5; transition: color .35s, border-color .35s; }
.chain-map span + span { margin-left: 6px; }
.chain-map .is-lit { color: #e8edf5; }
.chain-map [data-stage="access"].is-lit { border-color: var(--access); }
.chain-map [data-stage="persist"].is-lit { border-color: var(--persist); }
.chain-map [data-stage="collect"].is-lit { border-color: var(--collect); }
.chain-map [data-stage="action"].is-lit { border-color: var(--action); }

.chain-rows { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.chain-rows li { display: grid; grid-template-columns: 46px 96px 1fr; column-gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid #263142; }
.chain-rows time { font: 500 12px/1.4 var(--mono); color: #a6b3c6; }
.chain-rows b { font: 600 11px/1.4 var(--mono); letter-spacing: .02em; }
.chain-rows [data-s="access"] b { color: var(--access); }
.chain-rows [data-s="persist"] b { color: var(--persist); }
.chain-rows [data-s="collect"] b { color: var(--collect); }
.chain-rows [data-s="action"] b { color: var(--action); }
.chain-rows strong { font-size: 15px; font-weight: 600; line-height: 1.3; color: #e8edf5; }
.chain-rows p { grid-column: 3; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: #a6b3c6; }

.chain-verdict { margin-top: 4px; padding-top: 16px; border-top: 1px solid #69404b; }
.chain-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chain-sev { padding: 3px 9px; border: 1px solid #69404b; border-radius: 4px; background: #38242d; color: #f09ba5; font-size: 12px; font-weight: 600; }
.chain-result strong { font-size: clamp(19px,1.7vw,24px); font-weight: 700; letter-spacing: -.01em; }
.chain-verdict > p:not(.chain-result) { margin-top: 8px; max-width: 56ch; font-size: 14.5px; line-height: 1.5; color: #a6b3c6; }
.chain-verdict .text-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; color: #9aafff; font-weight: 600; }

/* while the scene plays, rows and the verdict wait for their marks */
.chain.is-run .chain-rows li { opacity: 0; transform: translateY(8px); transition: opacity .32s cubic-bezier(.2,.8,.2,1), transform .32s cubic-bezier(.2,.8,.2,1); }
.chain.is-run .chain-rows li.is-in { opacity: 1; transform: none; }
.chain.is-run .chain-verdict { opacity: 0; transform: translateY(8px); transition: opacity .45s cubic-bezier(.2,.8,.2,1), transform .45s cubic-bezier(.2,.8,.2,1); }
.chain.is-run.is-verdict .chain-verdict { opacity: 1; transform: none; }

/* ---------- 2. Cadence strip ---------- */
.cadence { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 0; margin: 0; padding-top: 22px; border-top: 1px solid #303b4c; }
.cadence > div { padding-right: 24px; }
.cadence > div + div { padding-left: 28px; border-left: 1px solid #303b4c; }
.cadence dt { font: 500 12px/1.3 var(--mono); color: #a6b3c6; }
.cadence dd { margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cadence-live { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: end; }
.cadence-live dt,.cadence-live dd { grid-column: 1; }
.cadence-track { grid-column: 2; grid-row: 1 / span 2; position: relative; display: flex; justify-content: space-between; align-items: flex-end; height: 22px; margin: 0; border-bottom: 1px solid #3f4c60; }
.cadence-track i { width: 1px; height: 8px; background: #7e8ea5; }
.cadence-track i:first-of-type,.cadence-track i:last-of-type { height: 14px; background: #e8edf5; }
.cadence-track span { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: #9aafff; }
.cadence.is-in .cadence-track span { width: 100%; transition: width 1.4s cubic-bezier(.3,0,.2,1) .1s; }
.cadence-note { grid-column: 2; margin: 6px 0 0; font: 500 11.5px/1.3 var(--mono); color: #7e8ea5; text-align: right; }
.cadence-clock { color: #e8edf5; font-variant-numeric: tabular-nums; }

/* ---------- 3. One day at Contoso ---------- */
.shift { padding-block: clamp(72px,11vh,128px) clamp(56px,9vh,104px); background: #f3f5f8; }
.shift .section-intro { margin-bottom: clamp(28px,5vh,52px); }
.shift-rail { position: sticky; top: var(--header); z-index: 2; display: flex; gap: clamp(18px,3vw,40px); margin-bottom: clamp(28px,5vh,56px); padding: 12px 0; border-bottom: 1px solid #dce2ea; background: #f3f5f8; font: 500 13px/1.3 var(--mono); color: #586779; overflow-x: auto; }
.shift-rail a { display: inline-flex; gap: 8px; padding: 6px 0; white-space: nowrap; border-bottom: 2px solid transparent; }
.shift-rail span { font-family: var(--font); font-weight: 600; }
.shift-rail a[aria-current="true"] { color: #202936; border-color: #345bd8; }
.shift-rail a:hover { color: #202936; }

.shift-chapter { display: grid; grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr); gap: clamp(28px,5vw,76px); align-items: start; padding-block: clamp(28px,5vh,56px); scroll-margin-top: calc(var(--header) + 70px); }
.shift-chapter + .shift-chapter { border-top: 1px solid #dce2ea; }
.shift-copy { position: sticky; top: calc(var(--header) + 86px); }
.shift-when { font: 500 13px/1.3 var(--mono); color: #345bd8; }
.shift-copy h3 { margin-top: 12px; font-size: clamp(26px,2.6vw,38px); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.shift-copy p:not(.shift-when) { margin-top: 16px; max-width: 46ch; color: #586779; line-height: 1.6; }
.shift-copy .text-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: #345bd8; font-weight: 600; }
.shift-replay { display: block; margin-top: 22px; min-height: 30px; padding: 0 12px; border: 1px solid #cdd4de; border-radius: 6px; background: #ffffff; color: #202936; font: 600 12px/1 var(--font); }
.shift-replay:hover { background: #eef2f7; }
.shift-replay[hidden] { display: none; }

.shift-screen { min-width: 0; padding: clamp(10px,1.4vw,18px); border: 1px solid #dce2ea; border-radius: 10px; background: #f8f9fb; box-shadow: 0 24px 50px -34px rgb(25 40 65 / 45%); }
.shift-screen .ui { width: 100%; }
.shift-pair { display: grid; gap: clamp(10px,1.4vw,18px); }
.shift-paper { background: #e9edf2; }
.shift-film { margin-top: clamp(20px,4vh,40px); }

/* parts of a fragment arrive in order (the script adds .ui-anim, so nothing is hidden without it) */
.ui-anim [data-step] { opacity: 0; transform: translateY(8px); transition: opacity .28s cubic-bezier(.2,.8,.2,1), transform .28s cubic-bezier(.2,.8,.2,1); }
.ui-anim [data-step].is-in { opacity: 1; transform: none; }
.ui-anim [data-stage]:not([data-step]) { transition: filter .35s, opacity .35s; }
.ui-anim [data-stage]:not([data-step]):not(.is-lit) { filter: grayscale(1); opacity: .4; }
.ui-anim [data-verdict] { transition: opacity .35s; }
.ui-anim:not(.is-done) [data-verdict] { opacity: .35; }
.ui-anim [data-meter] { transition: transform 1.1s cubic-bezier(.3,0,.2,1); transform-origin: left center; }
.ui-anim:not(.is-done) [data-meter] { transform: scaleX(0); }
.ui-anim [data-row="featured"] { transition: box-shadow .4s, background-color .4s; }
.ui-anim.is-done [data-row="featured"] { box-shadow: inset 3px 0 0 #345bd8; background-color: #edf2ff; }

/* ---------- 4. The close takes the whole screen ---------- */
.home footer.contact-section .contact-wrap { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.home footer .contact-copy h2 { font-size: clamp(44px,6vw,92px); font-weight: 800; line-height: .98; letter-spacing: -.03em; }

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 1000px) {
  .hero.scene .hero-grid { grid-template-columns: 1fr; }
  .shift-chapter { grid-template-columns: 1fr; }
  .shift-copy { position: static; }
}
@media (max-width: 700px) {
  .chain-map { height: 104px; }
  .chain-map span { font-size: 11px; }
  .chain-rows li { grid-template-columns: 44px 1fr; }
  .chain-rows b { grid-column: 2; }
  .chain-rows strong,.chain-rows p { grid-column: 1 / -1; }
  .cadence { grid-template-columns: 1fr; gap: 16px; }
  .cadence > div + div { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid #303b4c; }
  .cadence > div { padding-right: 0; }
  .shift-screen { margin-inline: -8px; padding: 8px; }
  .home footer.contact-section .contact-wrap { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .chain-src i,.cadence-track span { animation: none; transition: none; }
}

/* the old twelve-column placement of the intro does not apply to the scene */
.home .hero.scene .intro { grid-column: auto; }
.home .hero.scene .chain { grid-column: auto; }
