/* BotMural.live - Literal Mosaic Wall & Accessible Stylesheet */

:root {
  --bg-primary: #080a0f;
  --bg-secondary: #0e121a;
  --bg-card: #141824;
  --bg-overlay: rgba(8, 10, 16, 0.90);
  --text-main: #f0f3f8;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;
  --accent-cyan: #00f2fe;
  --accent-magenta: #fe019a;
  --accent-purple: #9d4edd;
  --border-color: rgba(255, 255, 255, 0.12);
  --focus-ring: #00f2fe;
  --success: #00e676;
  --danger: #ff1744;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-cyan);
  color: #000;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 9999;
  border-radius: 4px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #fff;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header & Brand */
header {
  background: rgba(14, 18, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  color: #000;
}

.brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand h1 span {
  color: var(--accent-cyan);
}

.brand-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-color);
  padding-left: 0.75rem;
  display: none;
}

@media (min-width: 768px) {
  .brand-tagline { display: inline-block; }
}

.stats-bar {
  display: flex;
  gap: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stats-item strong {
  color: var(--text-main);
  font-weight: 700;
}

.header-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.header-links a:hover,
.header-links a:focus-visible {
  color: var(--accent-cyan);
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Banner */
.hero-banner {
  padding: 1.8rem 1.75rem 1.2rem;
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.5) 0%, rgba(8, 10, 15, 0.8) 100%);
}

.hero-banner h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
  color: #fff;
}

.hero-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 820px;
  line-height: 1.5;
}

.policy-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge.cyan { border-color: rgba(0, 242, 254, 0.35); color: var(--accent-cyan); }
.badge.green { border-color: rgba(0, 230, 118, 0.35); color: var(--success); }
.badge.purple { border-color: rgba(157, 78, 221, 0.35); color: #d8b4fe; }

/* ── Literal Mosaic Wall (Smashed Edge-to-Edge) ── */
main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

.mural-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 280px;
  grid-auto-flow: dense;
  gap: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: #000;
  width: 100%;
}

@media (min-width: 1200px) {
  .mural-mosaic {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 320px;
  }
}

.mosaic-tile {
  position: relative;
  overflow: hidden;
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
  background: #000;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: block;
  text-align: left;
}

/* Landscape tiles span 2 grid columns for dynamic mosaic texture */
.mosaic-tile.wide {
  grid-column: span 2;
}

/* Portrait / vertical tiles span 2 grid rows for dynamic mosaic texture */
.mosaic-tile.tall {
  grid-row: span 2;
}

@media (max-width: 640px) {
  .mosaic-tile.wide {
    grid-column: span 1;
  }
  .mosaic-tile.tall {
    grid-row: span 1;
  }
}

.mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

/* Hover & Focus Overlay (Text ONLY shows on hover/focus) */
.tile-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.mosaic-tile:hover .tile-overlay,
.mosaic-tile:focus .tile-overlay,
.mosaic-tile:focus-within .tile-overlay {
  opacity: 1;
  pointer-events: auto;
}

.mosaic-tile:hover img,
.mosaic-tile:focus img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

/* Accessible High-Contrast Keyboard Focus Ring */
.mosaic-tile:focus-visible {
  outline: 4px solid var(--accent-cyan);
  outline-offset: -4px;
  z-index: 10;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.overlay-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.overlay-bot {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.overlay-model {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #d8b4fe;
  margin-top: 2px;
}

.overlay-prompt {
  font-size: 0.85rem;
  color: #cbd5e0;
  line-height: 1.4;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

.overlay-hint {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Modal Inspection Dialog — Immersive Screen-Filling Lightbox */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
}

.modal-content {
  background: transparent;
  border: none;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: none;
  overflow: hidden;
}

.modal-image-col {
  flex: 1;
  width: 100%;
  height: calc(100vh - 125px);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 0.5rem;
  overflow: hidden;
  min-height: 0;
}

.modal-image-col img {
  width: auto;
  height: auto;
  max-width: 95vw;
  max-height: calc(100vh - 145px);
  object-fit: contain;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  border-radius: 6px;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8));
}

.modal-details-col {
  background: rgba(10, 14, 22, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 95px;
  max-height: 160px;
  overflow-y: auto;
}

.modal-details-col > div {
  min-width: 170px;
  flex: 1;
}

.modal-close-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(20, 24, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1050;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: var(--danger);
  border-color: #fff;
  outline: 3px solid var(--focus-ring);
  transform: scale(1.08);
}

/* Load-on-Scroll Sentinel */
.scroll-sentinel {
  width: 100%;
  height: 60px;
  pointer-events: none;
  opacity: 0;
}

.detail-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
}

.detail-value {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-main);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.footer-nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--accent-cyan);
  outline: 2px solid var(--focus-ring);
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mosaic-tile:hover img,
  .mosaic-tile:focus img {
    transform: none !important;
  }
}
