:root {
  color-scheme: light;
  --bg: #e8f0fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #17324a;
  --muted: #587089;
  --accent: #366ea4;
  --accent-dark: #244e75;
  --line: #8fb0cf;
  --shadow: 0 18px 40px rgba(21, 45, 74, 0.16);
  --radius: 22px;
  --label-red: #d84b48;
  --label-orange: #e68a2e;
  --label-yellow: #d7b526;
  --label-green: #42a864;
  --label-blue: #3e7dd9;
  --label-purple: #8a5dd0;
  --label-pink: #db6fa8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #d9e7f7 0%, var(--bg) 100%);
  color: var(--text);
}

button,
a {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.hero,
.brain-card,
.modal__panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: var(--radius);
  padding: 1.25rem;
}

.eyebrow,
.modal__eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.hero h1,
.brain-card__header h2,
.modal__content h2 {
  margin: 0;
}

.hero-copy,
.brain-card__header p,
.modal__section p,
.modal__hint {
  color: var(--muted);
  line-height: 1.6;
}

.brain-card {
  margin-top: 1rem;
  border-radius: var(--radius);
  padding: 1rem;
}

.site-footer {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.brain-card__header {
  margin-bottom: 1rem;
}

.brain-map {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.75rem 0.25rem 5.5rem;
  overflow: visible;
}

.brain-map__image {
  width: min(100%, 26rem);
  border-radius: 1rem;
  border: 1px solid rgba(54, 110, 164, 0.16);
}

.brain-label {
  position: absolute;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  z-index: 2;
}

.brain-label__text {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--label-color, var(--surface-strong)) 14%, white);
  border: 2px solid var(--label-color, var(--line));
  box-shadow: 0 10px 20px rgba(41, 76, 112, 0.12);
  font-size: 0.92rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--label-color, var(--text)) 55%, #13283c);
}

.brain-label::after,
.brain-label::before {
  content: none;
}

.brain-label:focus-visible .brain-label__text,
.brain-label:hover .brain-label__text,
.modal__close:focus-visible,
.modal__close:hover,
#modal-link:focus-visible,
#modal-link:hover {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54, 110, 164, 0.2);
}

.brain-label--amygdala {
  --label-color: var(--label-red);
}

.brain-label--hippocampus {
  --label-color: var(--label-orange);
}

.brain-label--hypothalmus {
  --label-color: var(--label-yellow);
}

.brain-label--vta {
  --label-color: var(--label-green);
}

.brain-label--cerebrum {
  --label-color: var(--label-blue);
  top: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
}

.brain-label--cerebrum::after {
  width: 2px;
  height: 4.3rem;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
}

.brain-label--cerebrum::before {
  left: 50%;
  top: calc(100% + 4.15rem);
  transform: translate(-50%, -50%);
}

.brain-label--hippocampus {
  top: 31%;
  left: -0.6rem;
}

.brain-label--hippocampus::after {
  width: 5.8rem;
  height: 2px;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--hippocampus::before {
  left: calc(100% + 5.65rem);
  top: 50%;
  transform: translate(-50%, -50%);
}

.brain-label--amygdala {
  top: 50%;
  left: -1rem;
}

.brain-label--amygdala::after {
  width: 6rem;
  height: 2px;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--amygdala::before {
  left: calc(100% + 5.85rem);
  top: 50%;
  transform: translate(-50%, -50%);
}

.brain-label--hypothalmus {
  top: 60%;
  left: -0.4rem;
}

.brain-label--hypothalmus::after {
  width: 5.2rem;
  height: 2px;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--hypothalmus::before {
  left: calc(100% + 5.05rem);
  top: 50%;
  transform: translate(-50%, -50%);
}

.brain-label--vta {
  top: 72%;
  left: -0.15rem;
}

.brain-label--vta::after {
  width: 5rem;
  height: 2px;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--vta::before {
  left: calc(100% + 4.85rem);
  top: 50%;
  transform: translate(-50%, -50%);
}

.brain-label--cerebellum {
  --label-color: var(--label-purple);
  top: 42%;
  right: -0.75rem;
}

.brain-label--cerebellum::after {
  width: 5.6rem;
  height: 2px;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--cerebellum::before {
  right: calc(100% + 5.45rem);
  top: 50%;
  transform: translate(50%, -50%);
}

.brain-label--brain-stem {
  --label-color: var(--label-pink);
  top: 80%;
  right: -0.35rem;
}

.brain-label--brain-stem::after {
  width: 4.9rem;
  height: 2px;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.brain-label--brain-stem::before {
  right: calc(100% + 4.75rem);
  top: 50%;
  transform: translate(50%, -50%);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 35, 54, 0.6);
}

.modal__panel {
  position: relative;
  width: min(100%, 32rem);
  max-height: min(85vh, 42rem);
  overflow: auto;
  border-radius: 1.25rem;
  background: var(--surface-strong);
  padding: 1.25rem;
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--accent-dark);
  cursor: pointer;
}

.modal__content {
  padding-top: 1.5rem;
}

.modal__section + .modal__section {
  margin-top: 1.25rem;
}

.modal__section h3 {
  margin-bottom: 0.45rem;
}

.spotify-embed {
  position: relative;
  width: 100%;
  height: 152px;
  margin-top: 0.35rem;
  border-radius: 12px;
  overflow: hidden;
}

.spotify-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

#modal-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--accent-dark);
  text-decoration-thickness: 0.1em;
}

.modal__hint {
  margin: 0.55rem 0 0;
  font-size: 0.94rem;
}

@media (min-width: 700px) {
  .page-shell {
    padding: 2rem 1.5rem 4rem;
  }

  .hero,
  .brain-card {
    padding: 1.5rem;
  }

  .brain-map {
    padding: 5.25rem 1.75rem 5.75rem;
  }

  .brain-label__text {
    min-width: 8.25rem;
  }

  .brain-label--hippocampus {
    left: -1.5rem;
  }

  .brain-label--amygdala {
    left: -1.9rem;
  }

  .brain-label--hypothalmus {
    left: -1.15rem;
  }

  .brain-label--vta {
    left: -0.8rem;
  }

  .brain-label--cerebellum {
    right: -1.9rem;
  }

  .brain-label--brain-stem {
    right: -1.2rem;
  }
}
