:root {
  --bg: #10161d;
  --bg-deep: #18222c;
  --paper: rgba(19, 28, 37, 0.78);
  --ink: #eef3f7;
  --muted: #b5c2cf;
  --accent: #8fc7d8;
  --accent-soft: #5f95a6;
  --line: rgba(220, 235, 248, 0.12);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(143, 199, 216, 0.14), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(77, 109, 128, 0.2), transparent 26%),
    radial-gradient(circle at 50% 120%, rgba(29, 45, 58, 0.58), transparent 35%),
    linear-gradient(180deg, #0c1117 0%, #121a22 38%, #17212b 100%);
}

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

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

.page-shell {
  min-height: 100vh;
  overflow: clip;
}

.page-shell-notes {
  overflow: visible;
}

.hero,
main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.notes-main,
.notes-hero {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 2rem;
  padding: 1.25rem 0 3rem;
  min-height: 100vh;
  align-items: center;
}

.topbar {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - 2rem));
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  z-index: 10;
}

.brand,
.section-label,
.eyebrow,
time {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand {
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-copy {
  padding-top: 3.5rem;
}

.eyebrow,
.section-label {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  line-height: 1;
  margin: 0;
}

h1 {
  margin-top: 0.9rem;
  font-size: clamp(3.3rem, 8vw, 6.8rem);
  max-width: 11ch;
}

h1 span {
  display: block;
  color: #f0d8c7;
}

.lede {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  font-size: 1.14rem;
  line-height: 1.8;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  font-weight: 800;
}

.button-primary {
  color: #fff6ef;
  background: linear-gradient(135deg, #507f93, #7eb8ca);
  box-shadow: 0 14px 40px rgba(20, 47, 63, 0.42);
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 248, 241, 0.06);
}

.inline-link {
  color: var(--accent);
  font-weight: 800;
}

.pavie-mark {
  letter-spacing: 0.02em;
}

.pavie-mark::first-letter,
.pavie-mark {
  font-variant-ligatures: none;
}

.pavie-mark {
  color: var(--ink);
}

.pavie-mark .accent-av {
  color: var(--accent);
}

.acronym-mark {
  display: inline-block;
  padding: 0.1rem 0.42rem 0.08rem;
  margin: 0 0.08rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.82em;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  vertical-align: 0.08em;
}

.hero-card,
.story-intro,
.chapter,
.gallery-text,
.technical-card,
.closing-card {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 243, 231, 0.08);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1rem;
  border-radius: 36px;
  transform: rotate(3deg);
}

.hero-card img {
  border-radius: 28px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.hero-card figcaption {
  padding: 1rem 0.3rem 0.2rem;
  color: var(--muted);
  line-height: 1.7;
}

main {
  padding-bottom: 5rem;
}

section {
  margin-top: 3rem;
}

.story-intro,
.closing-card {
  border-radius: var(--radius-xl);
  padding: clamp(1.4rem, 3vw, 2.5rem);
}

.notes-hero {
  padding: 1.25rem 0 2rem;
}

.topbar-static {
  position: static;
  width: 100%;
  transform: none;
  padding-left: 0;
  padding-right: 0;
}

.notes-header-card,
.notes-article {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 243, 231, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}

.notes-header-card {
  margin-top: 1rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.notes-main {
  padding-bottom: 5rem;
}

.notes-article {
  padding: clamp(1.4rem, 3vw, 2.5rem);
}

.notes-figure {
  margin: 1.5rem 0;
}

.notes-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.notes-figure figcaption {
  margin-top: 0.85rem;
  color: var(--muted);
  line-height: 1.75;
}

.notes-aside {
  margin: 1.2rem 0 2rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 248, 241, 0.05);
}

.notes-aside p {
  margin-top: 0;
}

.notes-article h1,
.notes-article h2,
.notes-article h3,
.notes-article h4,
.notes-header-card h1 {
  line-height: 1.08;
}

.notes-article h2,
.notes-header-card h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.notes-article h3 {
  font-size: 1.8rem;
  margin-top: 2rem;
}

.notes-article h4 {
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1.5rem;
}

.notes-lead,
.notes-article p,
.notes-list li,
.notes-table,
.notes-quote {
  color: var(--muted);
  line-height: 1.85;
}

.notes-list {
  padding-left: 1.2rem;
}

.notes-list li + li {
  margin-top: 0.3rem;
}

.notes-article pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.notes-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}

.notes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.3rem;
}

.notes-table th,
.notes-table td {
  text-align: left;
  padding: 0.9rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.notes-table th {
  color: var(--ink);
}

.notes-quote {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent-soft);
  background: rgba(255, 248, 241, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.story-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2rem;
  margin-top: 1rem;
}

.story-grid h2,
.gallery-text h2,
.timeline h2,
.closing-card h2 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.story-grid p,
.gallery-text p,
.closing-card p,
.timeline-list p {
  color: var(--muted);
  line-height: 1.85;
  font-size: 1.02rem;
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.chapter {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 18rem;
}

.chapter-number {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  color: #fff8ef;
  background: linear-gradient(135deg, #4f7589, #83b6c8);
}

.chapter h3 {
  margin-top: 1rem;
  font-size: 1.7rem;
}

.chapter p {
  color: var(--muted);
  line-height: 1.8;
}

.gallery-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.gallery-text {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  min-height: 100%;
}

.polaroid {
  background: rgba(245, 235, 226, 0.94);
  border-radius: 8px;
  padding: 0.85rem 0.85rem 1.2rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.polaroid img {
  width: 100%;
  border-radius: 2px;
}

.polaroid figcaption {
  margin-top: 0.8rem;
  color: #2a3641;
  line-height: 1.7;
}

.polaroid-wide {
  grid-column: span 2;
}

.tilt-left {
  transform: rotate(-2deg);
}

.tilt-right {
  transform: rotate(3deg);
}

.technical-card {
  grid-column: 2 / 4;
  padding: 1rem;
  border-radius: var(--radius-xl);
}

.technical-card figcaption {
  margin-top: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}

.timeline-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.timeline-list article {
  padding: 1.2rem;
  border-top: 1px solid var(--line);
}

time {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .story-grid,
  .chapter-list,
  .gallery-layout,
  .timeline-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 5rem;
  }

  .topbar {
    position: fixed;
    padding: 0.85rem 1rem;
    background: rgba(11, 17, 24, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .topbar-static {
    position: static;
    padding: 0.85rem 0;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 0;
  }

  .nav-links {
    gap: 0.8rem;
    font-size: 0.84rem;
  }

  .hero-card {
    transform: none;
  }

  .polaroid-wide,
  .technical-card {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
  }

  .hero,
  main {
    width: min(100% - 1rem, 1180px);
  }

  h1 {
    font-size: 3rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
