:root {
  --paper: #f1f6f6;
  --paper-warm: #dde9ea;
  --paper-deep: #c7d8dc;
  --ink: #26323a;
  --ink-soft: #55666c;
  --olive: #6f8f92;
  --terracotta: #5f8f96;
  --mustard: #a7c3c6;
  --berry: #7087a2;
  --line: #4d6670;
  --shadow: 0 8px 0 rgba(40, 63, 70, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Lucida Grande", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 15%, rgba(95, 143, 150, 0.18), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(111, 143, 146, 0.16), transparent 35%),
    linear-gradient(145deg, #e8efef 0%, #d8e4e6 60%, #c9d8dc 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(77, 102, 112, 0.045) 0,
      rgba(77, 102, 112, 0.045) 1px,
      transparent 1px,
      transparent 24px
    );
  z-index: -1;
}

a {
  color: inherit;
}

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

.page-shell {
  width: min(1160px, calc(100% - 2.2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(245, 249, 249, 0.92);
  border-bottom: 3px dashed rgba(77, 102, 112, 0.58);
  backdrop-filter: blur(8px);
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.15rem;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--terracotta), var(--mustard));
  border: 2px solid var(--line);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav a,
.menu-toggle {
  text-decoration: none;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--ink-soft);
  border: 2px solid rgba(77, 102, 112, 0.55);
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  background: #ecf3f3;
  box-shadow: 0 3px 0 rgba(77, 102, 112, 0.2);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
  cursor: pointer;
  font-family: inherit;
}

.main-nav a:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.main-nav a:nth-child(even) {
  transform: rotate(0.8deg);
}

.main-nav a:hover,
.main-nav a.current,
.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
  color: var(--ink);
  background: #d6e7e9;
  transform: translateY(-2px) rotate(0deg);
}

.mega-menu {
  background: #f0f5f5;
  border-top: 2px solid rgba(77, 102, 112, 0.35);
  border-bottom: 3px dashed rgba(77, 102, 112, 0.5);
}

.mega-grid {
  padding: 0.95rem 0 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}

.mega-grid a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: #e3eeef;
  border: 1px dashed rgba(77, 102, 112, 0.5);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
}

.mega-grid a:hover,
.mega-grid a.current {
  color: var(--ink);
  background: #d6e7e9;
  border-style: solid;
}

main {
  padding: 2.25rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 1.2rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.hero-copy {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 24px 8px 18px 10px;
  box-shadow: var(--shadow);
  padding: 1.45rem 1.35rem 1.15rem;
  position: relative;
}

.hero-copy::before {
  content: "";
  position: absolute;
  top: -12px;
  right: 32px;
  width: 82px;
  height: 24px;
  border-radius: 3px;
  background: rgba(167, 195, 198, 0.45);
  border: 1px solid rgba(77, 102, 112, 0.35);
  transform: rotate(5deg);
}

.hero-copy::after {
  content: "";
  position: absolute;
  left: -12px;
  bottom: 22px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--olive);
  border: 2px solid var(--line);
}

.kicker {
  display: inline-block;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  color: var(--terracotta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0 0 0.72rem;
  line-height: 1.12;
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", "Georgia", serif;
}

h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
}

h3 {
  font-size: 1.22rem;
}

p {
  margin: 0 0 0.95rem;
  color: var(--ink-soft);
  line-height: 1.64;
}

.hero-media {
  background: #f5f8f8;
  border: 3px solid var(--line);
  border-radius: 8px 22px 10px 18px;
  padding: 0.7rem;
  box-shadow: var(--shadow);
  transform: rotate(1deg);
  min-height: 285px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid rgba(77, 102, 112, 0.58);
  border-radius: 8px;
}

.grid-two {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel,
.timeline,
.note,
.side-image,
.card {
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 16px 5px 16px 5px;
  box-shadow: var(--shadow);
}

.panel,
.timeline,
.note,
.side-image {
  padding: 1.06rem 1.08rem 1rem;
}

.panel:nth-child(odd),
.timeline,
.note {
  transform: rotate(-0.4deg);
}

.panel:nth-child(even),
.side-image {
  transform: rotate(0.35deg);
}

.side-image {
  overflow: hidden;
}

.side-image img {
  border: 2px solid rgba(77, 102, 112, 0.45);
  border-radius: 9px;
}

.cards {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  grid-column: span 4;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 18px;
  width: 56px;
  height: 18px;
  border-radius: 2px;
  background: rgba(167, 195, 198, 0.38);
  border: 1px solid rgba(77, 102, 112, 0.25);
}

.card:nth-child(2n) {
  transform: rotate(-0.7deg);
}

.card:nth-child(3n) {
  transform: rotate(0.8deg);
}

body[data-page="home"] .card:nth-child(5n + 1) {
  grid-column: span 6;
}

.card:hover {
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 10px 0 rgba(40, 63, 70, 0.22);
}

.card img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  border-bottom: 2px solid rgba(77, 102, 112, 0.65);
  background: #d6e4e6;
}

.card-body {
  padding: 0.92rem;
}

.card-body p {
  margin-bottom: 0.82rem;
  font-size: 0.95rem;
}

.card-link,
.next-prev a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--terracotta);
}

.card-link:hover,
.next-prev a:hover {
  color: #527f86;
}

.bullet-list {
  margin: 0;
  padding: 0 0 0 1.08rem;
  color: var(--ink-soft);
  line-height: 1.58;
}

.bullet-list li + li {
  margin-top: 0.36rem;
}

.timeline ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.timeline li + li {
  margin-top: 0.42rem;
}

.note {
  margin-top: 1.25rem;
  background: linear-gradient(180deg, #edf4f4 0%, #dfe9ea 100%);
  border-left: 10px solid var(--terracotta);
}

.next-prev {
  margin-top: 1.22rem;
  padding-top: 0.78rem;
  border-top: 2px dashed rgba(77, 102, 112, 0.5);
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.site-footer {
  border-top: 3px solid rgba(77, 102, 112, 0.58);
  background: #bfd0d4;
  padding: 1.35rem 0 1.7rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

.site-footer h3 {
  color: #26323a;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 1.25rem;
}

.site-footer p {
  color: #3f555f;
}

.footer-links {
  columns: 2;
  column-gap: 1rem;
}

.footer-links a {
  display: block;
  color: #3f555f;
  text-decoration: none;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #334a54;
}

.reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  transition: opacity 420ms ease, transform 420ms ease;
}

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

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-media {
    transform: rotate(0.5deg);
    min-height: 240px;
  }

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

  .card,
  body[data-page="home"] .card:nth-child(5n + 1) {
    grid-column: span 3;
  }
}

@media (max-width: 860px) {
  .main-nav {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .main-nav a {
    display: none;
  }

  .main-nav a.keep-mobile {
    display: inline-flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

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

  .grid-two,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .page-shell {
    width: min(1160px, calc(100% - 1.2rem));
  }

  .cards,
  .mega-grid {
    grid-template-columns: 1fr;
  }

  .card,
  body[data-page="home"] .card:nth-child(5n + 1) {
    grid-column: span 1;
    transform: rotate(0deg);
  }

  .hero-copy,
  .hero-media,
  .panel,
  .timeline,
  .note,
  .side-image {
    transform: rotate(0deg);
  }

  .next-prev {
    flex-direction: column;
  }
}
