:root {
  --bg: #050505;
  --panel: #101010;
  --panel-soft: #171717;
  --text: #f3f3f3;
  --muted: rgba(255, 255, 255, 0.68);
  --muted-soft: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Manrope", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 24%),
    linear-gradient(180deg, #020202 0%, #090909 46%, #030303 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.site-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 88px;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-text strong,
.hero h1,
.spotlight-body h2,
.section-heading h2,
.results-header h2,
.about-card h3,
.card-title {
  font-family: var(--font-display);
}

.brand-text strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
}

.site-nav a:hover,
.card-link:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.hero,
.generator-section,
.results-section,
.about-section,
.faq-section {
  margin-top: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
}

.hero-copy,
.spotlight-card,
.generator-surface,
.image-card,
.about-card,
.library-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-copy {
  padding: 36px;
}

.eyebrow,
.control-label {
  margin: 0 0 12px;
  color: var(--muted-soft);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 0.93;
}

.hero-lead,
.spotlight-caption,
.spotlight-meta,
.section-heading p,
.card-meta,
.results-meta,
.toolbar-copy p,
.about-card p {
  color: var(--muted);
}

.hero-lead {
  max-width: 58ch;
  margin: 20px 0 0;
  font-size: 1.03rem;
  line-height: 1.72;
}

.hero-note {
  max-width: 54ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.control-actions,
.pill-row,
.spotlight-links,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.button,
.pill,
.search-input,
.image-card {
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.button:hover,
.pill:hover,
.image-card:hover {
  transform: translateY(-1px);
}

.button {
  padding: 0.95rem 1.18rem;
  border-radius: 999px;
  cursor: pointer;
}

.button-primary {
  background: #ffffff;
  color: #000000;
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.spotlight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  overflow: hidden;
  min-height: 620px;
}

.spotlight-image-wrap,
.image-frame {
  position: relative;
  background: #0a0a0a;
}

/* Shimmer skeleton while image loads */
.spotlight-image-wrap::after,
.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: img-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.spotlight-image-wrap.is-loaded::after,
.image-frame.is-loaded::after {
  opacity: 0;
}

@keyframes img-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Fade-in images on load */
.spotlight-image-wrap img,
.image-frame img,
.education-modal__media img {
  opacity: 0;
  transition: opacity 360ms ease;
}

.spotlight-image-wrap img.is-loaded,
.image-frame img.is-loaded,
.education-modal__media img.is-loaded {
  opacity: 1;
}

.spotlight-image-wrap img,
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotlight-body {
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.06));
}

.spotlight-body h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 0.95;
}

.spotlight-body p {
  margin: 14px 0 0;
}

.section-heading {
  max-width: 60ch;
  margin-bottom: 18px;
}

.section-heading h2,
.results-header h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.section-heading p {
  margin: 10px 0 0;
  line-height: 1.7;
}

.generator-surface {
  padding: 24px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 18px;
}

.control-block {
  min-width: 0;
}

.pill {
  padding: 0.82rem 1rem;
  color: var(--text);
  cursor: pointer;
}

.pill.is-active {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.search-input {
  width: 100%;
  padding: 0.96rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.search-input:focus-visible {
  outline: 1px solid #ffffff;
  outline-offset: 2px;
}

.toolbar {
  align-items: end;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.toolbar-copy strong {
  display: block;
  font-size: 1.2rem;
}

.toolbar-copy p {
  margin: 6px 0 0;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.results-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.results-meta strong {
  font-size: 2rem;
}

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

.image-card {
  overflow: hidden;
}

.image-card:hover {
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.5);
}

.image-frame {
  aspect-ratio: 4 / 3;
}

.image-card__trigger,
.card-title-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.image-expand-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(10, 10, 10, 0.74);
  color: #ffffff;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.image-expand-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-expand-button span {
  font-size: 1.1rem;
  line-height: 1;
}

.card-title-button {
  text-align: left;
}

.card-body {
  padding: 16px;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.card-title {
  margin: 12px 0 0;
  font-size: 1.82rem;
  line-height: 0.95;
}

.card-meta {
  margin: 12px 0 0;
  min-height: 48px;
  line-height: 1.6;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.card-button {
  padding: 0;
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.image-card__trigger:hover img,
.card-title-button:hover .card-title {
  opacity: 0.92;
}

.card-link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

.about-card {
  padding: 22px;
}

.about-link {
  display: block;
}

.about-card h3 {
  margin: 0 0 12px;
  font-size: 1.65rem;
}

.about-card p {
  margin: 0;
  line-height: 1.7;
}

.about-link:hover {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  padding: 20px 22px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.5;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  float: right;
  color: var(--muted-soft);
  content: "+";
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
  line-height: 1.75;
}

.image-lightbox {
  width: min(1200px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: rgba(5, 5, 5, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.image-lightbox__inner {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.image-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 0.72rem 0.94rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
  cursor: pointer;
}

.image-lightbox__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 64px 32px 20px;
  background: #050505;
}

.image-lightbox__media img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  border-radius: 20px;
  object-fit: contain;
}

.image-lightbox__meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.image-lightbox__meta h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.94;
}

.image-lightbox__meta p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.education-modal {
  width: min(420px, calc(100vw - 20px), calc((100vh - 20px) * 9 / 16));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: #090909;
  color: var(--text);
  box-shadow: var(--shadow);
}

.education-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.education-modal__inner {
  display: grid;
  grid-template-rows: minmax(0, 0.42fr) minmax(0, 0.58fr);
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
}

.education-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 0.64rem 0.88rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.education-modal__media {
  min-height: 0;
  background: #000000;
}

.education-modal__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.education-modal__content {
  padding: 22px 20px 24px;
  border-top: 1px solid var(--line);
  overflow: auto;
  overscroll-behavior: contain;
}

.education-modal__content h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 0.94;
}

.education-modal__subtitle,
.education-modal__overview,
.education-section p,
.education-fact span:last-child {
  color: var(--muted);
}

.education-modal__subtitle {
  margin: 12px 0 0;
}

.education-modal__overview {
  margin: 14px 0 0;
  line-height: 1.6;
}

.education-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.education-fact {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.education-fact span:first-child {
  color: var(--muted-soft);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.education-section {
  margin-top: 18px;
}

.education-section h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.education-section p {
  margin: 0;
  line-height: 1.6;
}

.education-section--question {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.education-scientific-name {
  display: block;
  margin-top: 6px;
  color: var(--muted-soft);
  font-style: italic;
  font-size: 0.92rem;
}

.education-wow-factor {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(255, 210, 60, 0.22);
  border-radius: 14px;
  background: rgba(255, 210, 60, 0.05);
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.55;
}

.education-wow-factor::before {
  display: block;
  margin-bottom: 5px;
  content: "WOW FACTOR";
  color: rgba(255, 210, 60, 0.6);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.education-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.site-footer {
  margin-top: 64px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.84rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 1120px) {
  .hero,
  .control-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .spotlight-body {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 16px, 100%);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 28px;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .hero-copy,
  .spotlight-body,
  .generator-surface,
  .about-card,
  .card-body,
  .faq-item summary,
  .faq-item p,
  .education-modal__content {
    padding: 18px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .hero-actions,
  .control-actions {
    width: 100%;
  }

  .hero-actions .button,
  .control-actions .button {
    width: 100%;
    justify-content: center;
  }

  .image-lightbox__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-copy,
  .control-block,
  .pill-row,
  .search-input {
    width: 100%;
  }

  .pill-row .pill {
    flex: 1 1 calc(33.333% - 10px);
    text-align: center;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .results-header,
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .faq-item summary::after {
    margin-left: 12px;
  }
}

@media (max-width: 560px) {
  .site-header {
    margin: 12px 0 20px;
    padding: 14px 16px;
  }

  .brand {
    width: 100%;
  }

  .brand-text strong {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }

  .site-nav {
    gap: 12px;
    font-size: 0.92rem;
  }

  .results-meta strong {
    font-size: 1.6rem;
  }

  .card-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .education-modal {
    width: min(calc(100vw - 12px), calc((100vh - 12px) * 9 / 16));
    border-radius: 22px;
  }

  .image-expand-button {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .image-lightbox {
    width: min(calc(100vw - 12px), 100%);
    border-radius: 22px;
  }

  .image-lightbox__media {
    padding: 56px 12px 16px;
  }

  .image-lightbox__media img {
    max-height: 62vh;
    border-radius: 16px;
  }

  .image-lightbox__meta {
    padding: 16px;
  }

  .image-lightbox__close {
    top: 10px;
    right: 10px;
    padding: 0.56rem 0.8rem;
    font-size: 0.9rem;
  }

  .education-modal__content {
    padding: 18px 16px 20px;
  }

  .education-modal__close {
    top: 10px;
    right: 10px;
    padding: 0.56rem 0.8rem;
    font-size: 0.9rem;
  }

  .education-modal__content h2 {
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }
}
