/* Mesozoic Atlas — amber / deep forest editorial palette */

:root {
  --bg-deep: #0f1410;
  --bg-panel: #161d17;
  --text: #e8e6e1;
  --text-muted: #a8b0a3;
  --accent: #e8a54b;
  --accent-soft: rgba(232, 165, 75, 0.15);
  --triassic: #5c7d6e;
  --jurassic: #4a6fa5;
  --cretaceous: #a85d4a;
  --track: #2a332b;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #1a1208;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.container.narrow {
  width: min(720px, 92vw);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(232, 165, 75, 0.12);
}

.header-inner {
  width: min(1120px, 92vw);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}

.logo:hover {
  color: #f2be68;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-btn {
  border: 1px solid rgba(232, 165, 75, 0.35);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.lang-btn:hover {
  color: var(--accent);
  border-color: rgba(232, 165, 75, 0.8);
}

.lang-btn.is-active {
  background: rgba(232, 165, 75, 0.14);
  color: var(--accent);
  border-color: rgba(232, 165, 75, 0.82);
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav a.is-current {
  color: var(--accent);
}

/* Inner page header + home hub */

.page-head {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid rgba(232, 165, 75, 0.12);
  background: linear-gradient(180deg, #121812 0%, var(--bg-deep) 100%);
}

.page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-head h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  line-height: 1.15;
}

.page-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--text-muted);
}

.hub-section {
  padding: 3rem 0 4rem;
  background: var(--bg-panel);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.15);
  background: var(--bg-deep);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.hub-card-visual {
  margin: 0;
  line-height: 0;
  border-bottom: 1px solid rgba(232, 165, 75, 0.12);
}

.hub-card-visual img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hub-card-periods .hub-card-visual img {
  object-position: center 34%;
}

.hub-card-overview .hub-card-visual img {
  object-position: center 26%;
}

.hub-card-timeline .hub-card-visual img {
  object-position: center 30%;
}

.hub-card-species .hub-card-visual img {
  object-position: center 22%;
}

.hub-card-quiz .hub-card-visual img {
  object-position: center 36%;
}

.hub-card-videos .hub-card-visual img {
  object-position: center 30%;
}

.hub-card-extinction .hub-card-visual img {
  object-position: center 24%;
}

.hub-card-resources .hub-card-visual img {
  object-position: center 34%;
}

.hub-card-body {
  padding: 1.2rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hub-card:hover {
  border-color: rgba(232, 165, 75, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.hub-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent);
}

.hub-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  flex: 1;
}

.hub-card .hub-go {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.period-banner {
  margin: 0 0 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(232, 165, 75, 0.12);
}

.period-banner img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.two-col {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Hero */

.hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
  padding: 4rem 0 3.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 14, 11, 0.88) 0%, rgba(11, 14, 11, 0.54) 36%, rgba(11, 14, 11, 0.18) 62%, rgba(11, 14, 11, 0.46) 100%),
    linear-gradient(180deg, rgba(15, 20, 16, 0.42) 0%, rgba(15, 20, 16, 0.18) 45%, rgba(10, 13, 10, 0.9) 100%),
    url("../img/home-hero.png") center center / cover no-repeat,
    radial-gradient(ellipse 120% 80% at 22% 26%, rgba(0, 0, 0, 0.26), transparent 48%),
    radial-gradient(ellipse 100% 60% at 80% 60%, rgba(232, 165, 75, 0.1), transparent 45%),
    linear-gradient(165deg, #121812 0%, #0f1410 40%, #0a0d0a 100%);
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  max-width: 14ch;
}

.hero-lead {
  margin: 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.08rem;
}

/* Sections */

.section {
  padding: 3.5rem 0;
}

.intro {
  background: var(--bg-panel);
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  max-width: 65ch;
}

.intro h2 {
  font-family: var(--font-display);
}

.intro p {
  color: var(--text-muted);
}

.intro p strong {
  color: var(--text);
}

.home-facts {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-panel) 100%);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

#overview-deep-dive,
#periods-deep-dive,
#timeline-guide,
#species-evidence,
#video-guide,
#extinction-deep-dive {
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

#overview-faq,
#periods-ecosystems,
#timeline-milestones,
#extinction-faq,
.resources {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-panel) 100%);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

#species-guide,
#resources-extra,
#resources-faq {
  margin-top: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.info-card {
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.12);
  background: linear-gradient(180deg, rgba(18, 24, 18, 0.98) 0%, rgba(12, 16, 13, 0.98) 100%);
  box-shadow: var(--shadow);
}

.info-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent);
}

.info-card p {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.info-card strong {
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.12);
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--bg-panel);
}

.compare-table th,
.compare-table td {
  padding: 0.95rem 1rem;
  vertical-align: top;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-table th {
  background: rgba(232, 165, 75, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-table td {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.faq-grid {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.12);
  background: linear-gradient(180deg, rgba(18, 24, 18, 0.98) 0%, rgba(12, 16, 13, 0.98) 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.1rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--accent);
}

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

.faq-item[open] summary {
  border-bottom: 1px solid rgba(232, 165, 75, 0.1);
}

.faq-item p {
  margin: 0;
  padding: 0.95rem 1.1rem 1.05rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.table-wrap + .info-grid {
  margin-top: 2rem;
}

/* Timeline */

.timeline-section {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #121812 100%);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

.timeline-controls {
  margin-bottom: 1.25rem;
}

.scrub-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

#scrub-value {
  color: var(--accent);
}

#timeline-scrub {
  width: 100%;
  max-width: 420px;
  accent-color: var(--accent);
}

.timeline-wrap {
  position: relative;
  border: 1px solid rgba(232, 165, 75, 0.15);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.5rem;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  padding: 0 0.25rem;
}

.axis-mid {
  opacity: 0.7;
}

.period-strip {
  display: flex;
  height: 2.25rem;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.period {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.period.triassic {
  flex: calc(252 - 201);
  background: linear-gradient(180deg, #6d9088, var(--triassic));
}

.period.jurassic {
  flex: calc(201 - 145);
  background: linear-gradient(180deg, #6b8fc9, var(--jurassic));
}

.period.cretaceous {
  flex: calc(145 - 66);
  background: linear-gradient(180deg, #c97a6a, var(--cretaceous));
}

.timeline-tracks-inner {
  position: relative;
  min-height: 1px;
  transition: transform 0.35s ease;
  transform-origin: 100% 50%;
}

.timeline-track-row {
  display: grid;
  grid-template-columns: minmax(100px, 14%) 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.track-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  padding-right: 0.25rem;
  line-height: 1.25;
}

.track-bar-wrap {
  position: relative;
  height: 1.1rem;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}

.track-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  opacity: 0.92;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.track-bar.is-dimmed {
  opacity: 0.22;
  filter: grayscale(0.5);
}

.timeline-legend {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.timeline-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.timeline-note {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 70ch;
}

.timeline-note strong {
  color: var(--text);
}

/* Species */

.species-section {
  background: var(--bg-panel);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 165, 75, 0.25);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.species-card {
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.12);
  background: var(--bg-deep);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.species-card:hover {
  border-color: rgba(232, 165, 75, 0.35);
  box-shadow: var(--shadow);
}

.species-card.is-hidden {
  display: none;
}

.species-card summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.species-card summary::-webkit-details-marker {
  display: none;
}

.species-thumb {
  margin: -1.1rem -1.15rem 0.85rem;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(232, 165, 75, 0.12);
}

.species-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--track);
}

.species-thumb figcaption {
  padding: 0.35rem 0.75rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.25);
}

.species-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.species-name em {
  font-style: italic;
  font-weight: 600;
}

.group-pill {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.meta-line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.species-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.species-body p {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.species-context {
  margin-top: 0.75rem;
}

.species-facts {
  margin: 0.95rem 0 0;
  display: grid;
  grid-template-columns: minmax(92px, 120px) 1fr;
  gap: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

.species-facts dt {
  color: var(--accent);
  font-weight: 700;
}

.species-facts dd {
  margin: 0;
  color: var(--text-muted);
}

/* Videos */

.videos-section {
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
  border-top: 1px solid rgba(232, 165, 75, 0.08);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.video-card {
  border-radius: var(--radius);
  border: 1px solid rgba(232, 165, 75, 0.12);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(18, 24, 18, 0.98) 0%, rgba(12, 16, 13, 0.98) 100%);
  box-shadow: var(--shadow);
}

.video-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  background: #000;
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.video-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.video-card p {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.ext-link {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Resources */

.resources {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-panel) 100%);
}

.resources h2 {
  font-family: var(--font-display);
}

.resource-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.resource-list li {
  margin-bottom: 0.65rem;
}

/* Quiz */

.quiz-wrap {
  background: var(--bg-panel);
}

.quiz-panel {
  padding: 1.5rem 0 2rem;
}

.quiz-panel p {
  color: var(--text-muted);
}

.quiz-illus {
  margin: 0 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(232, 165, 75, 0.15);
}

.quiz-illus img {
  width: 100%;
  display: block;
  height: auto;
}

.quiz-primary {
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1208;
  cursor: pointer;
}

.quiz-primary:hover {
  filter: brightness(1.06);
}

.quiz-progress {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.quiz-question {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.3;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-option {
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 165, 75, 0.25);
  background: var(--bg-deep);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quiz-result-panel .quiz-result-visual {
  margin: 0 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(232, 165, 75, 0.2);
  background: #000;
}

.quiz-result-visual img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.quiz-result-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
}

.quiz-result-tag {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--accent);
}

.quiz-result-body {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.quiz-primary-link {
  display: inline-block;
  font-weight: 700;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1208;
  text-decoration: none;
}

.quiz-primary-link:hover {
  filter: brightness(1.06);
  text-decoration: none;
  color: #1a1208;
}

.quiz-secondary {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 165, 75, 0.35);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.quiz-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.quiz-credit {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* Footer */

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(232, 165, 75, 0.1);
  background: #0a0d0a;
}

.footer-inner p {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-meta {
  opacity: 0.75;
}

@media (max-width: 640px) {
  .header-inner {
    align-items: flex-start;
  }

  .lang-switch {
    width: 100%;
    justify-content: flex-end;
  }

  .timeline-track-row {
    grid-template-columns: 1fr;
  }

  .track-label {
    text-align: left;
    padding-right: 0;
  }
}

/* Memes */

.meme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.meme-card {
  margin: 0;
  background: var(--bg-panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.meme-card img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.meme-card figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.meme-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(6, 8, 6, 0.92);
  cursor: zoom-out;
}

.meme-lightbox.is-open {
  display: flex;
}

.meme-lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.meme-lightbox figcaption {
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  max-width: 700px;
}

/* Admin */

.admin-panel {
  max-width: 560px;
}

.admin-field {
  display: block;
  margin-bottom: 1.25rem;
}

.admin-field span {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--text);
}

.admin-field input[type="password"],
.admin-field input[type="text"],
.admin-field input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--track);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
}

.admin-btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #1a1208;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.admin-btn:hover {
  filter: brightness(1.08);
}

.admin-btn.danger {
  background: var(--cretaceous);
  color: #fff;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.admin-msg {
  margin: 0.75rem 0;
  font-size: 0.92rem;
}

.admin-msg.is-error {
  color: #e8785f;
}

.admin-msg.is-ok {
  color: #8fbf7c;
}

.admin-meme-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--track);
}

.admin-meme-row img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
}

.admin-meme-row .admin-meme-caption {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-muted);
}
