/* Interactive Cryptography Museum — DecodeCipher */

.edu-hero--museum {
  background:
    radial-gradient(circle at 18% 22%, rgba(82, 212, 255, 0.14), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(247, 184, 79, 0.12), transparent 28%),
    radial-gradient(circle at 50% 88%, rgba(79, 142, 247, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(10, 14, 22, 0.94) 0%, rgba(8, 12, 20, 0.92) 100%);
}

.edu-hero--museum::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.05) 0%, rgba(6, 10, 18, 0.55) 100%);
}

.hero-copy h1.hero-title-museum {
  background: linear-gradient(135deg, #d4b86a 0%, #52d4ff 42%, #8aa2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.museum-hero-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.museum-hero-deco canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.72;
}

.museum-hero-note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(212, 184, 106, 0.65);
  background: rgba(12, 18, 28, 0.55);
  color: #b8c5d8;
  font-size: 0.92rem;
  line-height: 1.65;
  max-width: 58ch;
}

.museum-section {
  width: 100%;
}

.museum-section + .museum-section {
  margin-top: 0.25rem;
}

/* ── Museum Map ── */

.museum-map-wrap {
  position: relative;
  width: 100%;
  border: 1px solid rgba(65, 80, 108, 0.58);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 40%, rgba(79, 142, 247, 0.08), transparent 55%),
    rgba(11, 16, 26, 0.88);
  box-shadow: 0 24px 80px rgba(3, 8, 18, 0.38);
  overflow: hidden;
  padding: 1.5rem 1rem 1.75rem;
}

.museum-map-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(82, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(82, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.45;
}

.museum-map-title {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 1rem;
}

.museum-map-title h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
}

.museum-map-title p {
  margin: 0.5rem auto 0;
  max-width: 52ch;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
}

.museum-map {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.museum-map-desktop {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.museum-map-svg {
  width: 100%;
  min-width: 720px;
  height: auto;
  display: block;
}

.map-path {
  fill: none;
  stroke: rgba(82, 212, 255, 0.22);
  stroke-width: 2;
  stroke-linecap: round;
}

.map-path-glow {
  fill: none;
  stroke: url(#mapPathGradient);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 12 18;
  opacity: 0.75;
}

.map-path-glow.animated {
  animation: map-path-flow 4s linear infinite;
}

@keyframes map-path-flow {
  to { stroke-dashoffset: -60; }
}

.map-node-link {
  cursor: pointer;
  text-decoration: none;
  outline: none;
}

.map-node-link:focus-visible {
  outline: 2px solid #f7d87a;
  outline-offset: 4px;
}

.map-node-ring {
  fill: rgba(14, 20, 32, 0.94);
  stroke: rgba(82, 212, 255, 0.5);
  stroke-width: 1.75;
  transition: stroke 0.2s ease, filter 0.2s ease, fill 0.2s ease;
}

.map-node-link:hover .map-node-ring,
.map-node-link:focus-visible .map-node-ring {
  stroke: rgba(247, 216, 122, 0.9);
  fill: rgba(18, 28, 44, 0.96);
  filter: drop-shadow(0 0 14px rgba(82, 212, 255, 0.42));
}

.map-node--featured .map-node-ring {
  stroke: rgba(247, 184, 79, 0.78);
  stroke-width: 2.25;
}

.map-node-link:hover .map-node--featured .map-node-ring,
.map-node-link:focus-visible .map-node--featured .map-node-ring {
  stroke: rgba(255, 220, 130, 0.95);
  filter: drop-shadow(0 0 18px rgba(247, 184, 79, 0.45));
}

.map-node--entrance .map-node-ring {
  fill: rgba(18, 26, 40, 0.96);
  stroke: rgba(212, 184, 106, 0.62);
}

.map-node-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  fill: #e8f0fc;
  pointer-events: none;
  text-anchor: middle;
}

.map-node--featured .map-node-label {
  font-size: 15px;
  fill: #f5e6b8;
}

.map-node--entrance .map-node-label {
  font-size: 12px;
}

.map-node--small .map-node-label {
  font-size: 11px;
}

.map-node-sub {
  font-size: 10px;
  fill: #9eacc4;
  pointer-events: none;
  text-anchor: middle;
}

.map-node--featured .map-node-sub {
  font-size: 11px;
  fill: #c9b87a;
}

.map-node-pulse {
  fill: none;
  stroke: rgba(82, 212, 255, 0.5);
  stroke-width: 1.5;
  opacity: 0;
  pointer-events: none;
}

.map-node--featured .map-node-pulse {
  animation: node-pulse-featured 2.8s ease-out infinite;
}

.map-node--medium .map-node-pulse {
  animation: node-pulse-medium 2.8s ease-out infinite;
}

@keyframes node-pulse-featured {
  0% { opacity: 0.5; }
  100% { opacity: 0; }
}

@keyframes node-pulse-medium {
  0% { opacity: 0.42; }
  100% { opacity: 0; }
}

/* Mobile map — vertical stack fallback */
.museum-map-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

.map-mobile-node {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.map-mobile-node:hover,
.map-mobile-node:focus-visible {
  text-decoration: none;
  background: rgba(79, 142, 247, 0.08);
  outline: 2px solid rgba(82, 212, 255, 0.45);
  outline-offset: 2px;
}

.map-mobile-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
  padding: 0.25rem 0;
}

.map-mobile-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(82, 212, 255, 0.55);
  background: rgba(14, 20, 32, 0.95);
  flex-shrink: 0;
}

.map-mobile-node--featured .map-mobile-dot {
  border-color: rgba(247, 184, 79, 0.8);
  box-shadow: 0 0 12px rgba(247, 184, 79, 0.35);
}

.map-mobile-line {
  flex: 1;
  width: 2px;
  min-height: 20px;
  background: linear-gradient(180deg, rgba(82, 212, 255, 0.35), rgba(82, 212, 255, 0.12));
}

.map-mobile-card {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(65, 80, 108, 0.45);
  border-radius: 14px;
  background: rgba(14, 20, 31, 0.82);
  margin-bottom: 0.65rem;
}

.map-mobile-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #eef5ff;
}

.map-mobile-card p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Exhibit Halls ── */

.halls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.hall-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(65, 80, 108, 0.58);
  border-radius: 20px;
  background: rgba(12, 18, 28, 0.88);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hall-card:hover {
  border-color: rgba(82, 212, 255, 0.38);
}

.hall-card--featured {
  grid-column: 1 / -1;
  border-color: rgba(247, 184, 79, 0.42);
  background:
    radial-gradient(circle at 85% 20%, rgba(247, 184, 79, 0.1), transparent 40%),
    rgba(12, 18, 28, 0.9);
}

.hall-card--featured:hover {
  border-color: rgba(247, 184, 79, 0.58);
}

.hall-visual {
  position: relative;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid rgba(65, 80, 108, 0.35);
  background: rgba(8, 12, 20, 0.6);
}

.hall-card--featured .hall-visual {
  height: 160px;
}

.hall-visual svg,
.hall-visual canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hall-body {
  padding: 1.15rem 1.2rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hall-number {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9bc7ff;
  font-weight: 700;
}

.hall-card--featured .hall-number {
  color: #e8c96a;
}

.hall-body h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #f0f6ff;
}

.hall-body > p {
  margin: 0.65rem 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.68;
  flex: 1;
}

.hall-exhibits {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hall-exhibits li {
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(65, 80, 108, 0.42);
  background: rgba(15, 20, 30, 0.75);
  font-size: 0.76rem;
  color: #b4c0d4;
  font-family: var(--font-mono);
}

.hall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.hall-actions .btn-primary,
.hall-actions .btn-secondary {
  padding: 0.65rem 1rem;
  font-size: 0.84rem;
}

/* Hall visual motifs (CSS/SVG animations) */
.hall-motif-ring {
  transform-origin: center;
  animation: hall-ring-spin 24s linear infinite;
}

@keyframes hall-ring-spin {
  to { transform: rotate(360deg); }
}

.hall-motif-bar {
  animation: hall-bar-pulse 2.4s ease-in-out infinite;
}

.hall-motif-bar:nth-child(2) { animation-delay: 0.2s; }
.hall-motif-bar:nth-child(3) { animation-delay: 0.4s; }
.hall-motif-bar:nth-child(4) { animation-delay: 0.6s; }
.hall-motif-bar:nth-child(5) { animation-delay: 0.8s; }

@keyframes hall-bar-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.hall-signal-dot {
  animation: hall-signal-blink 1.8s ease-in-out infinite;
}

.hall-signal-dot:nth-child(odd) { animation-delay: 0.3s; }

@keyframes hall-signal-blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ── Timeline ── */

.museum-timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  position: relative;
  padding-top: 1.5rem;
}

.museum-timeline::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 4%;
  right: 4%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(82, 212, 255, 0.35), rgba(212, 184, 106, 0.35), transparent);
}

.timeline-era {
  position: relative;
  padding-top: 0.5rem;
}

.timeline-era::before {
  content: "";
  position: absolute;
  top: -1.15rem;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(82, 212, 255, 0.55);
  background: rgba(12, 18, 28, 0.95);
}

.timeline-era-card {
  height: 100%;
  padding: 0.9rem 0.75rem;
  border: 1px solid rgba(65, 80, 108, 0.45);
  border-radius: 14px;
  background: rgba(14, 20, 31, 0.82);
}

.timeline-era-card h3 {
  margin: 0;
  font-size: 0.82rem;
  color: #eef5ff;
  line-height: 1.35;
}

.timeline-era-card .era-date {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #d4b86a;
  letter-spacing: 0.06em;
}

.timeline-era-card p {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.timeline-era-card a {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
}

/* ── Purpose / Editorial ── */

.museum-purpose {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1rem;
  width: 100%;
}

.museum-purpose-main {
  padding: 1.35rem 1.4rem;
  border: 1px solid rgba(65, 80, 108, 0.58);
  border-radius: 20px;
  background: rgba(12, 18, 28, 0.88);
}

.museum-purpose-main h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.museum-purpose-main p {
  margin: 0 0 0.85rem;
  color: #c0cad9;
  line-height: 1.72;
  font-size: 0.95rem;
}

.museum-purpose-main p:last-child {
  margin-bottom: 0;
}

.museum-purpose-aside {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.museum-stat-card {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(65, 80, 108, 0.45);
  border-radius: 16px;
  background: rgba(14, 20, 31, 0.82);
}

.museum-stat-card strong {
  display: block;
  font-size: 1.5rem;
  color: #52d4ff;
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.museum-stat-card span {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Visitor Routes ── */

.routes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.route-card {
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(65, 80, 108, 0.58);
  border-radius: 18px;
  background: rgba(12, 18, 28, 0.88);
  display: flex;
  flex-direction: column;
}

.route-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #eef5ff;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.55rem 0 0.75rem;
}

.route-meta span {
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(65, 80, 108, 0.42);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #a8b8d0;
}

.route-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
}

.route-steps li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.35rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.route-steps li::before {
  content: counter(route-step);
  counter-increment: route-step;
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #52d4ff;
  font-weight: 700;
}

.route-steps {
  counter-reset: route-step;
}

.route-steps a {
  font-weight: 600;
}

.route-card .btn-primary {
  margin-top: 1rem;
  align-self: flex-start;
  padding: 0.7rem 1.1rem;
  font-size: 0.84rem;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .map-path-glow.animated,
  .map-node--featured .map-node-pulse,
  .map-node--medium .map-node-pulse,
  .hall-motif-ring,
  .hall-motif-bar,
  .hall-signal-dot {
    animation: none !important;
  }

  .hall-card:hover,
  .map-mobile-node:hover {
    transform: none;
  }
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .museum-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .museum-timeline::before {
    display: none;
  }

  .timeline-era::before {
    display: none;
  }
}

@media (max-width: 820px) {
  .halls-grid,
  .routes-grid,
  .museum-purpose {
    grid-template-columns: 1fr;
  }

  .hall-card--featured {
    grid-column: auto;
  }

  .museum-map-desktop {
    display: none;
  }

  .museum-map-mobile {
    display: flex;
  }

  .museum-timeline {
    grid-template-columns: 1fr;
    padding-top: 0;
  }
}

@media (max-width: 700px) {
  .hero-body {
    grid-template-columns: 1fr;
  }

  .museum-map-wrap {
    padding: 1.15rem 0.75rem 1.25rem;
  }
}
