/* Pleo Dinosaur Heritage Archive — "soft-robotics heritage journal"
   Unique theme: indigo + Pleo-blue-eye cyan + amber + sage on warm cream.
   Content is NEVER gated on JS. All reveal animations end in the visible state. */

:root {
  --indigo: #4b3fa0;
  --indigo-dark: #332b73;
  --indigo-light: #6b5fc7;
  --cyan: #2ea6cf;
  --cyan-dark: #1f7fa1;
  --amber: #e8a13c;
  --sage: #86bd6a;
  --sage-dark: #5f9247;
  --cream: #f8f5ee;
  --cream-alt: #efe8db;
  --paper: #fffdf8;
  --ink: #2a2531;
  --ink-soft: #5b5566;
  --line: #e2d9c8;
  --shadow-sm: 0 2px 8px rgba(51, 43, 115, 0.07);
  --shadow-md: 0 10px 30px rgba(51, 43, 115, 0.12);
  --shadow-lg: 0 20px 50px rgba(51, 43, 115, 0.16);
  --radius: 18px;
  --radius-lg: 28px;
  --maxw: 1120px;
  --prose: 760px;
}

/* Safeguard: content is never hidden waiting on JS (belt-and-suspenders vs AOS-style libs). */
[data-aos] { opacity: 1 !important; transform: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 12% -5%, rgba(46, 166, 207, 0.10), transparent 40%),
    radial-gradient(circle at 92% 0%, rgba(232, 161, 60, 0.10), transparent 38%);
  background-attachment: fixed;
  line-height: 1.7;
  font-size: 1.06rem;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan-dark); text-decoration: none; }
a:hover { color: var(--indigo); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: "Fredoka", "Nunito Sans", sans-serif; font-weight: 600; line-height: 1.18; color: var(--indigo-dark); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--indigo); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(248, 245, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--indigo-dark); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; filter: drop-shadow(0 3px 6px rgba(51,43,115,.22)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.28rem; color: var(--indigo-dark); }
.brand-sub { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan-dark); font-weight: 700; }

.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.15rem; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: 0.5rem 0.7rem; border-radius: 999px;
  color: var(--ink); font-weight: 600; font-size: 0.92rem;
  transition: background .15s ease, color .15s ease;
}
.primary-nav a:hover { background: var(--cream-alt); color: var(--indigo); text-decoration: none; }
.primary-nav a[aria-current="page"] { background: var(--indigo); color: #fff; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span { width: 22px; height: 2.5px; background: var(--indigo-dark); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 940px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .primary-nav.open { max-height: 78vh; overflow: auto; }
  .primary-nav ul { flex-direction: column; padding: 0.6rem clamp(1rem,4vw,2rem) 1rem; gap: 0.1rem; }
  .primary-nav a { padding: 0.7rem 0.6rem; font-size: 1rem; border-radius: 12px; }
}

/* ---------- Page / prose ---------- */
.page { padding: clamp(1.6rem, 4vw, 3rem) 0 1rem; }
.prose { max-width: var(--prose); margin: 0 auto; }
.prose h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.9rem); font-weight: 700; margin: 0.2rem 0 0.8rem;
  letter-spacing: -0.01em;
}
.prose h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.7rem); margin: 2.2rem 0 0.7rem;
  padding-top: 0.4rem; position: relative;
}
.prose h2::before {
  content: ""; display: block; width: 46px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--amber)); margin-bottom: 0.7rem;
}
.prose h3 { font-size: 1.18rem; margin: 1.5rem 0 0.5rem; color: var(--indigo); }
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.prose li { margin: 0.4rem 0; }
.prose ul li::marker { color: var(--sage-dark); }
.prose strong { color: var(--indigo-dark); }
.prose a { font-weight: 600; }

.prose > p:first-of-type,
.prose > .page-badge + p {
  font-size: 1.16rem; color: var(--ink); line-height: 1.65;
}

.archive-note {
  background: linear-gradient(180deg, var(--cream-alt), var(--paper));
  border: 1px solid var(--line); border-left: 5px solid var(--cyan);
  border-radius: 14px; padding: 0.85rem 1.1rem; font-size: 0.98rem !important; color: var(--ink-soft);
}

.page-badge { margin: 0 0 0.6rem; }
.chip {
  display: inline-block; font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.28rem 0.72rem; border-radius: 999px;
}
.chip-archive { background: var(--sage); color: #17330a; }

/* Hero figure */
.hero-figure {
  margin: 0.4rem 0 1.6rem; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid var(--line);
  background: var(--cream-alt);
}
.hero-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Buttons */
.btn {
  display: inline-block; background: var(--indigo); color: #fff !important;
  padding: 0.7rem 1.4rem; border-radius: 999px; font-weight: 700;
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: var(--indigo-dark); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff !important; }

/* Homepage lists get a little card polish on the top-level UL right after an H2 */
.prose h2 + ul {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem 1rem 2.4rem; box-shadow: var(--shadow-sm);
}

/* 404 */
.error-page { text-align: center; padding: 2rem 0 3rem; }
.error-code {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(4rem, 16vw, 9rem);
  line-height: 1; color: var(--cyan); margin: 0; text-shadow: 4px 4px 0 var(--cream-alt);
}
.error-page ul { display: inline-block; text-align: left; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  background: linear-gradient(160deg, var(--indigo-dark), #241f4d 70%, #1c1840);
  color: #d9d4ef;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1fr; gap: 2rem;
  padding: 2.8rem 0 1.6rem;
}
.footer-about { max-width: 34ch; }
.footer-blurb { color: #cfc9e8; font-size: 0.96rem; margin: 0.6rem 0 0; }
.footer-about strong { color: #fff; }
.brand-mark.small { filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.footer-col h3 {
  color: #fff; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  margin: 0 0 0.8rem; font-family: "Fredoka", sans-serif;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0.35rem 0; }
.footer-col a { color: #cfc9e8; font-size: 0.96rem; }
.footer-col a:hover { color: var(--amber); text-decoration: none; }
.footer-base { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.1rem 0 2rem; }
.footer-base p { margin: 0; font-size: 0.82rem; color: #a49dc4; }

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
  .footer-about { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- CSS-only reveal (ends visible; safe if JS never runs) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fadeUp .6s ease both; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
