/**
 * Public pages — gallery, video demo, modal, rich hero shell
 */

body.pub-page--visual {
  background:
    radial-gradient(ellipse 90% 50% at 100% -10%, rgba(59, 130, 246, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 40% at 0% 20%, rgba(124, 58, 237, 0.06), transparent 50%),
    var(--pub-page-bg);
}

.pub-hero-shell {
  position: relative;
  margin-bottom: 8px;
}

/* —— Unified hero panel (pilot / rich pages) —— */
.pub-hero-panel {
  margin-bottom: 32px;
}

.pub-hero-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.pub-hero-panel-copy {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pub-hero-panel-copy .pub-kicker {
  margin-bottom: 8px;
}

.pub-hero-panel-copy h1 {
  font-size: clamp(1.625rem, 2.8vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.pub-hero-panel-copy .pub-lead {
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0 0 16px;
  max-width: none;
}

.pub-hero-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.pub-hero-steps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.pub-hero-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
}

.pub-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pub-hero-metric {
  flex: 1;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.65);
  border: none;
  text-align: center;
}

.pub-hero-metric strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.pub-hero-metric span {
  display: block;
  font-size: 0.625rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.pub-hero-metric--accent {
  background: rgba(219, 234, 254, 0.55);
  border: none;
}

.pub-hero-metric--accent strong {
  color: #1D4ED8;
}

.pub-hero-panel-copy .pub-hero-actions {
  margin-top: 0;
  gap: 8px;
}

.pub-hero-panel-copy .pub-hero-actions .pub-btn:not(.pub-btn-primary) {
  border: none;
  background: rgba(241, 245, 249, 0.75);
}

.pub-hero-panel-copy .pub-hero-actions .pub-btn:not(.pub-btn-primary):hover {
  background: rgba(226, 232, 240, 0.9);
}

.pub-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-accent);
  padding-left: 10px;
  padding-right: 10px;
}

.pub-btn-ghost:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: transparent;
}

.pub-hero-panel-visual {
  padding: 0;
  background: transparent;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  min-height: calc(var(--pub-flow-panel-height) + 72px);
}

.pub-hero-panel-visual .pub-showcase-wrap {
  max-width: none;
  width: 100%;
}

.pub-hero-panel-visual .pub-showcase-wrap::before {
  display: none;
}

.pub-hero-panel-visual .mk-action-window,
.pub-hero-panel-visual .mk-hero-report-frame {
  border: none;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(37, 99, 235, 0.12);
}

.pub-hero-panel-visual .mk-flow-tab {
  border: none;
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-text-secondary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.pub-hero-panel-visual .mk-flow-tab.is-active {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.pub-hero-panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 18px 0 0;
  margin-top: 20px;
  background: transparent;
  border: none;
}

.pub-hero-panel-foot-label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1D4ED8;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.5);
  border: none;
}

.pub-hero-panel-foot p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}

.pub-hero-visual {
  width: 100%;
  max-width: 540px;
  justify-self: end;
}

.pub-hero-grid--visual {
  align-items: center;
}

/* —— Gallery —— */
.pub-gallery-section {
  margin: 36px 0 8px;
}

.pub-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pub-gallery-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pub-gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

.pub-shot {
  aspect-ratio: 16 / 11;
  background: linear-gradient(165deg, #F8FAFC 0%, #EEF2FF 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.pub-shot-chrome {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.pub-shot-chrome span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #CBD5E1;
}

.pub-shot-body {
  flex: 1;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.75rem;
}

.pub-shot-label {
  display: block;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.pub-shot-score {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.pub-shot-bar {
  display: block;
  height: 5px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.pub-shot-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  border-radius: inherit;
}

.pub-shot-body ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--color-text-secondary);
}

.pub-shot-body li { margin: 2px 0; }

.pub-shot-pill {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #EFF6FF;
  color: #1D4ED8;
  margin-bottom: 6px;
}

.pub-shot-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 10px;
  line-height: 1.35;
}

.pub-shot-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.pub-shot-steps span {
  font-size: 0.5625rem;
  font-weight: 700;
  text-align: center;
  padding: 5px 2px;
  border-radius: 6px;
  background: #F3F4F6;
  color: var(--color-text-muted);
}

.pub-shot-steps span.done { background: #E5E7EB; color: var(--color-text-secondary); }

.pub-shot-steps span.active {
  background: var(--color-accent);
  color: #fff;
}

.pub-shot-checks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-shot-checks li {
  position: relative;
  padding-left: 16px;
  margin: 4px 0;
  color: var(--color-text-secondary);
}

.pub-shot-checks li::before {
  content: "○";
  position: absolute;
  left: 0;
  color: #CBD5E1;
}

.pub-shot-checks li.done::before { content: "✓"; color: #059669; font-weight: 800; }

.pub-shot-checks li.active { color: var(--color-text); font-weight: 600; }

.pub-shot-checks li.active::before { content: "→"; color: var(--color-accent); }

.pub-gallery-cap {
  padding: 14px 16px 16px;
}

.pub-gallery-cap strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--color-text);
}

.pub-gallery-cap span {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* —— Video-style demo band —— */
.pub-media-band {
  margin: 32px 0;
  padding: 28px 28px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(239, 246, 255, 0.9) 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
}

.pub-media-band-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 32px;
  align-items: center;
}

.pub-media-copy h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.pub-media-copy > p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
  line-height: 1.6;
}

.pub-media-points {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.pub-media-points li {
  position: relative;
  padding-left: 18px;
  margin: 8px 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.pub-media-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.pub-media-play-inline { margin-top: 4px; }

.pub-video-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 16px;
  overflow: hidden;
}

.pub-video-poster {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #0F172A 0%, #1E3A8A 45%, #2563EB 100%);
  box-shadow: 0 12px 40px rgba(30, 58, 138, 0.35);
}

.pub-video-poster-layer {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #E0E7FF;
}

.pub-video-poster-layer--scan {
  top: 14%;
  left: 8%;
  width: 38%;
}

.pub-video-poster-layer--action {
  top: 38%;
  right: 10%;
  width: 42%;
}

.pub-video-poster-layer--report {
  bottom: 12%;
  left: 22%;
  width: 48%;
}

.pub-video-mini-score {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.pub-video-mini-pill {
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.5625rem;
}

.pub-video-mini-bar {
  display: block;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.pub-video-mini-bar i {
  display: block;
  width: 64%;
  height: 100%;
  background: #93C5FD;
  border-radius: inherit;
}

.pub-video-play-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pub-video-card:hover .pub-video-play-ring {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.pub-video-duration {
  display: block;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* —— Modal —— */
.pub-modal[hidden] { display: none !important; }

.pub-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pub-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.pub-modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.pub-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.pub-modal-head h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.pub-modal-close {
  appearance: none;
  border: none;
  background: var(--color-surface-sunken);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.pub-modal-body {
  padding: 16px 20px 20px;
}

.pub-modal-body .pub-showcase-wrap::before { display: none; }

/* —— Timeline icons —— */
.pub-timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: color-mix(in srgb, var(--pub-week-accent, var(--color-accent)) 14%, white);
  color: var(--pub-week-accent, var(--color-accent));
}

.pub-timeline-icon svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .pub-gallery { grid-template-columns: 1fr; }
  .pub-media-band-grid { grid-template-columns: 1fr; }
  .pub-hero-visual { max-width: none; }

  .pub-hero-panel-grid {
    grid-template-columns: 1fr;
  }

  .pub-hero-panel-copy {
    padding: 0;
  }

  .pub-hero-panel-visual {
    padding: 0;
  }

  .pub-hero-panel-foot {
    padding: 16px 0 0;
  }
}

@media (max-width: 640px) {
  .pub-media-band { padding: 20px 18px; }
}
