/* XAU Ventures page helpers. Visual language (tokens, colour, type, components)
   comes entirely from ui.css; this file only adds a few layout pieces the page needs. */

/* Built-in illustrations inside .media panels. A Midjourney <img>/<video> placed after
   them in the same figure covers them; until then the panel never looks empty. */
.media > .scene { position: absolute; inset: 0; display: grid; place-items: center; padding: 6%; }
.media > img, .media > video { z-index: 1; }
.media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .media > video { display: none; } }
.scene .mock { width: 100%; max-width: 34rem; box-shadow: var(--shadow-lg); }
.scene .mock-body { padding: 1rem; gap: .75rem; }
.scene .kpi { padding: .75rem; }
.scene .kpi-value { font-size: 1.25rem; }
.scene .chart { height: 6rem; }
.scene-list { display: grid; gap: .5rem; width: 100%; max-width: 30rem; }
.scene-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xxs); font-size: .875rem; }
.scene-row span:first-child { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.scene-row .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-row .mono { color: var(--fg-muted); font-size: .75rem; }
.chat { display: grid; gap: .625rem; width: 100%; max-width: 30rem; }
.bubble { max-width: 85%; padding: .75rem 1rem; font-size: .875rem; line-height: 1.45; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-xxs); }
.bubble.is-user { justify-self: end; background: var(--accent); color: #fff; border-color: var(--accent); }
.bubble small { display: block; margin-top: .375rem; font: .7rem var(--font-mono); color: var(--fg-muted); }
.chat-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* ---------- Hero animation: blank → build → attack → fix → secure (10s loop) ----------
   Every element runs the same 10s cycle; keyframe percentages are the timeline:
   0–20 blank/wireframe · 22–45 build · 48–70 attack · 70–80 fix · 80–100 secure. */
.flow { --t: 10s; --red: var(--error-600); --green: var(--success-600); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; }
/* .media > .scene sets display:grid (higher specificity); the flow needs a full-width column instead. */
.media > .scene.flow { display: flex; padding: 3% 4%; }
.flow-stage { position: relative; width: 100%; max-width: 52rem; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.flow .kpi-value { font-size: 1.35rem !important; }
.flow .kpi-label { font-size: .75rem !important; }
.flow .mock-bar span { font-size: .8rem; }
.flow-win { position: relative; width: 78%; height: 78%; display: flex; flex-direction: column; background: #fff; border: 2px solid var(--border); box-shadow: var(--shadow-lg); animation: flow-border var(--t) infinite; }
.flow-win .mock-bar { padding: .5rem .75rem; }
.flow-body { position: relative; flex: 1; padding: .875rem; }
.flow-layer { position: absolute; inset: .875rem; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto 1fr; gap: .5rem; }
.flow-wire { animation: flow-wire var(--t) infinite; }
.flow-wire span { border: 1.5px dashed var(--gray-300); min-height: 2.75rem; transform-origin: left; animation: flow-draw var(--t) infinite both; }
.flow-wire span:nth-child(2) { animation-delay: .25s; } .flow-wire span:nth-child(3) { animation-delay: .5s; }
.flow-wire span:nth-child(4) { grid-column: 1 / -1; animation-delay: .75s; }
.flow-ui { animation: flow-ui var(--t) infinite; }
.flow-ui .kpi { padding: .5rem .625rem; }
.flow-ui .kpi-label { font-size: .65rem; }
.flow-ui .kpi-value { font-size: 1rem; margin-top: .125rem; }
.flow-chart { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 5px; padding: .5rem .625rem; border: 1px solid var(--border); }
.flow-chart b { flex: 1; background: var(--blue-500); transform-origin: bottom; animation: flow-bar var(--t) infinite both; }
.flow-chart b:nth-child(even) { background: var(--blue-200); }
.flow-chart b:nth-child(1){height:35%;animation-delay:0s}.flow-chart b:nth-child(2){height:50%;animation-delay:.08s}.flow-chart b:nth-child(3){height:42%;animation-delay:.16s}.flow-chart b:nth-child(4){height:62%;animation-delay:.24s}.flow-chart b:nth-child(5){height:56%;animation-delay:.32s}.flow-chart b:nth-child(6){height:74%;animation-delay:.4s}.flow-chart b:nth-child(7){height:68%;animation-delay:.48s}.flow-chart b:nth-child(8){height:90%;animation-delay:.56s}

/* Attack arrows: wrapper sits on the hit point and is rotated to aim; inner line flies in. */
.flow-arrow { position: absolute; width: 0; height: 0; }
.flow-arrow i { position: absolute; right: 0; top: -1px; width: 5.5rem; height: 2px; background: linear-gradient(90deg, transparent, var(--red)); animation: flow-fly var(--t) infinite both; }
.flow-arrow i::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 8px solid var(--red); border-right: 0; }
.flow-arrow.a1 { left: 11%; top: 38%; transform: rotate(10deg); }
.flow-arrow.a2 { left: 62%; top: 11%; transform: rotate(65deg); }
.flow-arrow.a3 { left: 89%; top: 64%; transform: rotate(195deg); }
.flow-arrow.a4 { left: 30%; top: 89%; transform: rotate(-60deg); }
.flow-arrow.a2 i { animation-delay: .35s; } .flow-arrow.a3 i { animation-delay: .7s; } .flow-arrow.a4 i { animation-delay: 1.05s; }
/* Hit markers: red on impact, green once fixed. */
.flow-hit { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; animation: flow-hit var(--t) infinite both; }
.flow-hit.h1 { left: 11%; top: 38%; } .flow-hit.h2 { left: 62%; top: 11%; animation-delay: .35s; } .flow-hit.h3 { left: 89%; top: 64%; animation-delay: .7s; } .flow-hit.h4 { left: 30%; top: 89%; animation-delay: 1.05s; }
.flow-toast { position: absolute; top: 18%; right: 4%; display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .625rem; background: #fff; border: 1px solid; font: 500 .7rem var(--font-mono); box-shadow: var(--shadow-sm); }
.flow-toast.is-bad { color: var(--error-700); border-color: #fecdca; animation: flow-bad var(--t) infinite; }
.flow-toast.is-good { color: var(--success-700); border-color: #a9efc5; animation: flow-good var(--t) infinite; }
.flow-shield { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; animation: flow-shield var(--t) infinite; }
.flow-shield span { display: inline-flex; align-items: center; gap: .5rem; padding: .625rem 1rem; background: #fff; border: 1px solid #a9efc5; color: var(--success-700); font-weight: 500; font-size: .9rem; box-shadow: 0 12px 32px -8px rgb(7 148 85 / .35); }
.flow-shield svg { width: 1.25rem; height: 1.25rem; }
.flow-steps { display: flex; gap: .375rem; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; justify-content: center; }
.flow-steps li { padding: .3rem .7rem; border: 1px solid var(--border); background: #fff; font: .72rem var(--font-mono); color: var(--gray-400); animation: var(--k) var(--t) infinite; }
.flow-steps li:nth-child(1) { --k: step1; } .flow-steps li:nth-child(2) { --k: step2; } .flow-steps li:nth-child(3) { --k: step3; } .flow-steps li:nth-child(4) { --k: step4; } .flow-steps li:nth-child(5) { --k: step5; }

@keyframes flow-wire { 0%, 20% { opacity: 1; } 27%, 100% { opacity: 0; } }
@keyframes flow-draw { 0% { transform: scaleX(0); } 12%, 100% { transform: scaleX(1); } }
@keyframes flow-ui { 0%, 22% { opacity: 0; } 30%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes flow-bar { 0%, 26% { transform: scaleY(0); } 40%, 100% { transform: scaleY(1); } }
@keyframes flow-fly { 0%, 47% { opacity: 0; transform: translateX(-9rem); } 50% { opacity: 1; } 55% { opacity: 1; transform: translateX(0); } 60%, 100% { opacity: 0; transform: translateX(0); } }
@keyframes flow-hit { 0%, 54% { opacity: 0; transform: scale(.4); background: var(--red); box-shadow: 0 0 0 0 rgb(217 45 32 / .45); } 56% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 0 10px rgb(217 45 32 / 0); } 58%, 70% { opacity: 1; transform: scale(1); background: var(--red); box-shadow: 0 0 0 4px rgb(217 45 32 / .18); } 74%, 88% { opacity: 1; transform: scale(1); background: var(--green); box-shadow: 0 0 0 4px rgb(7 148 85 / .18); } 94%, 100% { opacity: 0; background: var(--green); } }
@keyframes flow-border { 0%, 52% { border-color: var(--border); } 56%, 70% { border-color: var(--red); } 74%, 95% { border-color: var(--green); } 100% { border-color: var(--border); } }
@keyframes flow-bad { 0%, 57% { opacity: 0; transform: translateY(4px); } 60%, 69% { opacity: 1; transform: none; } 72%, 100% { opacity: 0; } }
@keyframes flow-good { 0%, 72% { opacity: 0; transform: translateY(4px); } 75%, 95% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes flow-shield { 0%, 78% { opacity: 0; transform: scale(.92); } 82%, 95% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes step1 { 0%, 20% { color: var(--fg); border-color: var(--gray-400); } 22%, 100% { color: var(--gray-400); border-color: var(--border); } }
@keyframes step2 { 0%, 21% { color: var(--gray-400); } 23%, 46% { color: var(--accent); border-color: var(--blue-300); background: var(--blue-50); } 48%, 100% { color: var(--gray-400); border-color: var(--border); background: #fff; } }
@keyframes step3 { 0%, 47% { color: var(--gray-400); } 49%, 70% { color: var(--error-700); border-color: #fecdca; background: var(--error-50); } 72%, 100% { color: var(--gray-400); border-color: var(--border); background: #fff; } }
@keyframes step4 { 0%, 70% { color: var(--gray-400); } 72%, 80% { color: var(--warning-600); border-color: #fedf89; background: var(--warning-50); } 82%, 100% { color: var(--gray-400); border-color: var(--border); background: #fff; } }
@keyframes step5 { 0%, 80% { color: var(--gray-400); } 82%, 97% { color: var(--success-700); border-color: #a9efc5; background: var(--success-50); } 100% { color: var(--gray-400); border-color: var(--border); background: #fff; } }

/* Reduced motion: show the finished, secure state only. ui.css shortens animations to ~0; override with a static frame. */
@media (prefers-reduced-motion: reduce) {
  .flow *, .flow-win { animation: none !important; }
  .flow-wire, .flow-arrow, .flow-hit, .flow-toast.is-bad { opacity: 0 !important; }
  .flow-ui, .flow-shield, .flow-toast.is-good { opacity: 1 !important; }
  .flow-win { border-color: var(--green); }
  .flow-steps li:nth-child(5) { color: var(--success-700); border-color: #a9efc5; background: var(--success-50); }
}
@media (max-width: 600px) {
  .flow-stage { aspect-ratio: 4 / 3.4; }
  .flow-win { width: 88%; height: 84%; }
  .flow .kpi-value { font-size: 1rem !important; }
  .flow-toast { top: auto !important; bottom: 6%; }
  .flow-arrow i { width: 3.5rem; }
  .flow-toast { font-size: .6rem; top: 20%; }
  .flow-steps li { font-size: .65rem; padding: .25rem .5rem; }
}

/* One service = panel + its detail cards, grouped. */
.service-block { display: grid; gap: .5rem; scroll-margin-top: calc(var(--nav-h) + 1rem); }
.service-block + .service-block { margin-top: 4rem; }
.service-block .panel-split + * { margin-top: 0; }
.note-strip { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--border); font-size: .925rem; color: var(--gray-600); }
.note-strip .badge { flex: none; }

@media (max-width: 991px) {
  /* Below desktop the illustration sets the panel height instead of a fixed ratio, so nothing clips. */
  .panel-split { grid-template-columns: 1fr; }
  .panel-split .media { order: -1; }
  .media:has(> .scene) { aspect-ratio: auto !important; }
  .media > .scene { position: relative; padding: 2rem 1.5rem; }
}
@media (max-width: 600px) {
  .media > .scene { padding: 1rem; }
  .note-strip { flex-direction: column; }
  .scene .mock-body { grid-template-columns: 1fr 1fr; }
  .scene .mock-hide-sm { display: none; }
  .scene .kpi.span-2 { grid-column: 1 / -1; }
  .scene-row { padding: .625rem .75rem; font-size: .8rem; }
  .scene-row:nth-child(n+4) { display: none; }
  .bubble { max-width: 92%; font-size: .8rem; }
}

/* Logo mark (SVG). */
.logo svg { width: 1.75rem; height: 1.75rem; flex: none; }

/* Numbered label above each service block. */
.pillar-tag { display: inline-flex; align-items: center; gap: .5rem; font: .8rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.pillar-tag b { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 6px; background: var(--blue-100); font-weight: 500; }
.is-dark .pillar-tag { color: var(--blue-300); }
.is-dark .pillar-tag b { background: rgb(255 255 255 / .08); }

/* Reference layout: the whole page sits on light gray, with white cards on top. */
body { background: var(--gray-100); }
.footer { background: #fff; }
.card-grid { gap: .5rem; }
.card-grid.is-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 991px) { .card-grid.is-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .card-grid.is-4 { grid-template-columns: 1fr; } }
.case-grid { gap: .5rem; }
.steps .step { border-top-color: var(--gray-300); }

.feature-grid.is-4 { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
@media (max-width: 991px) { .feature-grid.is-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid.is-4 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }

.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: start; }
.contact-card { padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-sm); }
.contact-lines { display: grid; gap: 1.25rem; }
.contact-line { display: flex; align-items: center; gap: .875rem; }
.contact-line a, .contact-line strong { color: var(--fg); text-decoration: none; font-size: 1.125rem; font-weight: 500; }
.contact-line a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 991px) { .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
@media (max-width: 600px) { .contact-card { padding: 1.25rem; } }
