/* EVA. Every selector sits under .evp. */
.evp {
  --ev-paper: #181818;
  --ev-paper-2: #1E1E1E;
  --ev-ink: #EAEAEA;
  --ev-ink-2: #A9AFB8;
  --ev-wall: #3A3F47;
  --ev-rule: rgba(234, 234, 234, .12);
  --ev-rule-strong: #4A515B;
  --ev-route: #90B9EE;
  --ev-brand: #90B9EE;
  --ev-fire: #DC2626;
  --ev-warning: #F97316;
  --ev-trouble: #EAB308;
  --ev-ok: #22C55E;
  --ev-text: 'Barlow', "Barlow Fallback: Segoe UI", "Barlow Fallback: Arial", system-ui, sans-serif;
  --ev-display: 'Barlow Semi Condensed', "Barlow Semi Condensed Fallback: Arial", 'Arial Narrow', sans-serif;
  --pa-primary-bg: #1976D2;
  --pa-primary-fg: #FFFFFF;
  --pa-secondary-fg: var(--ev-ink);
  --pa-secondary-border: var(--ev-rule-strong);
  --pa-secondary-border-hover: var(--ev-brand);
  --pa-focus: var(--ev-brand);
  --pa-font: var(--ev-text);
  padding-top: clamp(6rem, 11vw, 7.5rem);
  background: var(--ev-paper);
  color: var(--ev-ink);
  font-family: var(--ev-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
[data-theme="light"] .evp {
  --ev-paper: #F3F5F8;
  --ev-paper-2: #FFFFFF;
  --ev-ink: #14171C;
  --ev-ink-2: #4B5563;
  --ev-wall: #CFD5DD;
  --ev-rule: rgba(20, 23, 28, .12);
  --ev-rule-strong: #B7BEC8;
  --ev-route: #1976D2;
  --ev-brand: #1565C0;
}
.evp-wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 56px); }
.evp p { max-width: none; }
.evp-h2, .evp-title, .evp-closing { color: var(--ev-ink); font-family: var(--ev-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.02; }
.evp-h2 { font-size: clamp(2rem, 4vw, 2.9rem); text-wrap: balance; }
.evp-h3 { margin-bottom: .35rem; font-family: var(--ev-display); font-size: 1.3rem; font-weight: 600; letter-spacing: 0; }
.evp .evp-sub, .evp .evp-step p, .evp .evp-lede { color: var(--ev-ink-2); }
.evp .evp-sub { max-width: 34em; margin-top: 1rem; }
.evp .evp-sub--center { margin-inline: auto; text-align: center; }
.evp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; padding-top: 1.5rem; }
.evp-actions--center { justify-content: center; }

/* Hero: the title bar, then the tour beside the legend */
.evp-titlebar { display: flex; align-items: stretch; border: 1px solid var(--ev-wall); }
.evp-mark { display: grid; flex: none; place-items: center; width: 96px; border-right: 1px solid var(--ev-wall); background: #181818; }
.evp-title { flex: 1; min-width: 0; padding: 1.25rem 1.75rem; font-size: clamp(2.2rem, 5.2vw, 4.25rem); }
.evp-where { display: flex; flex-direction: column; justify-content: center; min-width: 250px; padding: .9rem 1.5rem; border-left: 1px solid var(--ev-wall); color: var(--ev-ink-2); font-size: .95rem; }
.evp-where a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.evp-where strong { color: var(--ev-ink); font-family: var(--ev-display); font-size: 1.25rem; font-weight: 600; }
@media (max-width: 760px) {
  .evp-titlebar { flex-wrap: wrap; }
  .evp-mark { width: 72px; }
  .evp-mark .plogo { --plogo-size: 46px !important; }
  .evp-where { width: 100%; border-top: 1px solid var(--ev-wall); border-left: 0; }
}
.evp-hero-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 1px solid var(--ev-wall); border-top: 0; }
.evp-plan { padding: clamp(12px, 2vw, 24px); border-right: 1px solid var(--ev-wall); background: var(--ev-paper-2); }
.evp-legend { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.evp-status { color: var(--ev-route); font-family: var(--ev-display); font-weight: 600; }
[data-theme="light"] .evp .evp-status { color: var(--ev-brand); }
.evp-key { display: grid; gap: .55rem; margin: 0; padding: 0; font-size: .95rem; list-style: none; }
.evp-key li { display: flex; align-items: center; gap: .75rem; }
.evp-key-glyph { flex: none; width: 18px; height: 18px; border-radius: 4px; }
.evp-key-glyph--alarm { background: var(--ev-fire); }
.evp-key-glyph--warning { background: var(--ev-warning); }
.evp-key-glyph--trouble { background: var(--ev-trouble); }
.evp-key-glyph--ok { background: var(--ev-ok); }
@media (max-width: 960px) {
  .evp-hero-body { grid-template-columns: 1fr; }
  .evp-plan { border-right: 0; border-bottom: 1px solid var(--ev-wall); }
}

/* The tour */
.tour { display: flex; flex-direction: column; gap: 12px; }
.tour-frame { position: relative; overflow: hidden; aspect-ratio: 2400 / 1407; border-radius: 6px; background: #181818; }
.tour-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.tour-layer.is-on { opacity: 1; }
/* The event dialog is a different shape: centred on EVA's canvas. */
.tour-layer--event { display: grid; place-items: center; padding: 4% 8%; }
.tour-camera { position: relative; width: 100%; height: 100%; transform-origin: 0 0; transition: transform 1.3s cubic-bezier(.65, 0, .35, 1); }
.tour-camera .pshot, .tour-camera img { width: 100%; height: 100%; object-fit: contain; }
.tour-layer--event .tour-camera { height: auto; }
.tour-layer--event .tour-camera .pshot, .tour-layer--event .tour-camera img { height: auto; border-radius: 8px; box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .7); }
/* A ring marking what the step is about. It counter-scales so it keeps its size while the camera zooms. */
.tour-mark {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 3px solid var(--ev-mark);
  border-radius: 50%;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--ev-mark) 25%, transparent);
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  pointer-events: none;
  animation: mark-in .5s ease-out .9s both, mark-pulse 1.6s ease-in-out 1.4s infinite;
}
.tour-mark[hidden] { display: none; }
.tour-mark--alarm { --ev-mark: #F87171; }
.tour-mark--trouble { --ev-mark: #FACC15; }
.tour-mark--info { --ev-mark: #90B9EE; }
@keyframes mark-in { from { opacity: 0; } }
@keyframes mark-pulse { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--ev-mark) 0%, transparent); } }
.tour-bar { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; }
.evp .tour-caption { min-height: 3em; padding: 0 6px; color: var(--ev-ink); font-size: .98rem; line-height: 1.45; }
.tour-count { margin-right: 8px; color: var(--ev-brand); font-family: var(--ev-display); font-weight: 600; }
.tour-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--ev-rule-strong); border-radius: 50%; background: transparent; color: var(--ev-ink); }
.tour-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tour-btn:hover { border-color: var(--ev-brand); }
.tour-btn:focus-visible { outline: 2px solid var(--ev-brand); outline-offset: 2px; }
.tour-icon-play, .tour.is-paused .tour-icon-pause { display: none; }
.tour.is-paused .tour-icon-play { display: contents; }
.tour-icon-pause { display: contents; }
/* Each step is a 44 px target around a short bar (audit M11). */
.tour-steps { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.tour-step { display: grid; place-items: center; width: 44px; height: 44px; }
.tour-step::before { content: ''; width: 28px; height: 4px; border-radius: 2px; background: var(--ev-rule-strong); }
.tour-step[aria-current="step"]::before { background: var(--ev-brand); }
.tour-step:focus-visible { outline: 2px solid var(--ev-brand); outline-offset: -4px; border-radius: 6px; }
html:not(.js) .tour-bar .tour-btn, html:not(.js) .tour-steps { display: none; }
html:not(.js) .tour-bar { grid-template-columns: 1fr; }

/* When a detector goes off */
.evp-sequence { padding-top: 6rem; }
.evp-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.evp-step { position: relative; padding-top: 1.25rem; border-top: 3px solid var(--ev-route); }
.evp-step-no { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: .9rem; border: 1px solid var(--ev-wall); font-family: var(--ev-display); font-size: 1.15rem; font-weight: 700; }
.evp .evp-recorded { max-width: 48em; margin-top: 2rem; padding: 1rem 1.25rem; border-left: 4px solid var(--ev-route); color: var(--ev-ink-2); }
@media (max-width: 960px) { .evp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .evp-steps { grid-template-columns: 1fr; } }

/* The film */
.evp-film { padding-top: 6rem; }
.evp-film-player {
  --pf-radius: 6px;
  --pf-screen-radius: 5px;
  --pf-border: 1px solid var(--ev-wall);
  --pf-stage-bg: #181818;
  --pf-accent: #1976D2;
  --pf-accent-ink: #FFFFFF;
  --pf-accent-text: var(--ev-brand);
  --pf-ink: var(--ev-ink);
  --pf-ink-2: var(--ev-ink-2);
  --pf-chapter-bg: rgba(144, 185, 238, .1);
  --pf-pill-bg: rgba(30, 30, 30, .9);
  --pf-pill-ink: #EAEAEA;
  margin-top: 2.25rem;
}

/* Callouts: real screens, tagged like plan details */
.evp-callout { position: relative; margin: 4.5rem 0 0; padding: 10px; border: 1px solid var(--ev-wall); background: var(--ev-paper-2); }
.evp-callout figcaption { padding: .75rem .25rem .1rem; color: var(--ev-ink-2); font-size: .92rem; }
.evp-callout--paper { background: #FFFFFF; }
.evp-callout--paper figcaption { color: #4B5650; }
.evp-tag {
  position: absolute;
  top: -22px;
  left: -22px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ev-wall);
  border-radius: 50%;
  background: var(--ev-paper);
  color: var(--ev-ink);
  font-family: var(--ev-display);
  font-size: 1.1rem;
  font-weight: 700;
}
@media (max-width: 560px) { .evp-tag { left: -6px; } }

/* What EVA does */
.evp-features { padding-top: 6rem; }
.evp-feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin: 2.25rem 0 0; padding: 0; border-top: 1px solid var(--ev-rule); list-style: none; }
.evp-feature-list li { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--ev-rule); }
.evp-feature-glyph { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ev-route); color: var(--ev-route); }
.evp-feature-glyph svg { width: 22px; height: 22px; }
@media (max-width: 760px) { .evp-feature-list { grid-template-columns: 1fr; } }

.evp-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 48px; }
@media (max-width: 860px) { .evp-pair { grid-template-columns: 1fr; gap: 0; } }

/* The panels it speaks to */
.evp-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding-top: 6rem; }
.evp-panel-list { display: grid; grid-template-columns: auto 1fr; margin: 0; border-top: 1px solid var(--ev-rule); }
.evp-panel-list > div { display: contents; }
.evp-panel-list dt, .evp-panel-list dd { margin: 0; padding: .8rem 0; border-bottom: 1px solid var(--ev-rule); }
.evp-panel-list dt { padding-right: 2rem; font-family: var(--ev-display); font-size: 1.15rem; font-weight: 600; }
.evp-panel-list dd { color: var(--ev-ink-2); }
@media (max-width: 860px) { .evp-panels { grid-template-columns: 1fr; gap: 2rem; } }

.evp-mobile { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 56px; padding-top: 4rem; }
.evp-mobile .evp-callout { margin-top: 2rem; }
@media (max-width: 860px) { .evp-mobile { grid-template-columns: 1fr; gap: 1rem; } }

/* Made for XEON */
.evp-xeon { padding: 7rem clamp(16px, 4vw, 56px) 6rem; text-align: center; }
.evp-closing { font-size: clamp(2.4rem, 6vw, 4.25rem); }
.evp-xeon-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; color: var(--ev-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.evp-xeon-link:hover { color: var(--ev-brand); }

@media (prefers-reduced-motion: reduce) {
  .tour-layer, .tour-camera { transition: none; }
  .tour-mark { animation: none; }
}
/* On a phone the caption gets its own row above the controls */
@media (max-width: 560px) {
  .tour-bar { grid-template-columns: auto 1fr auto auto; }
  .evp .tour-caption { grid-column: 1 / -1; grid-row: 1; min-height: 4.4em; }
  .tour-bar [data-tour-prev] { grid-column: 1; grid-row: 2; }
  .tour-bar [data-tour-play] { grid-column: 3; grid-row: 2; }
  .tour-bar [data-tour-next] { grid-column: 4; grid-row: 2; }
}
