:root {
  --bg: #f5efe4;
  --surface: rgba(255, 250, 240, 0.86);
  --surface-strong: #13231a;
  --text: #1c2118;
  --muted: #50604f;
  --line: rgba(28, 33, 24, 0.12);
  --shadow: 0 24px 70px rgba(43, 33, 12, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --accent: #bb5a2a;
  --focus-ring: rgba(187, 90, 42, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 197, 124, 0.55), transparent 28%),
    radial-gradient(circle at top right, rgba(187, 90, 42, 0.18), transparent 30%),
    linear-gradient(180deg, #f5efe4 0%, #faf7ef 42%, #f0e7d8 100%);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

/* ─── Focus Styles ─── */

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

.button:focus-visible {
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* ─── Layout ─── */

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 40px 44px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 245, 228, 0.92)),
    linear-gradient(120deg, rgba(187, 90, 42, 0.12), rgba(19, 35, 26, 0.04));
  animation: fade-up 600ms ease-out both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(242, 197, 124, 0.12) 40%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(242, 197, 124, 0.12) 60%,
    transparent 80%
  );
  background-size: 200% 100%;
  animation: hero-shimmer 8s ease-in-out infinite;
  pointer-events: none;
}

.hero::after,
.panel::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(187, 90, 42, 0.2), transparent 72%);
  pointer-events: none;
}

/* ─── Navigation ─── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}

.brand {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 200ms ease;
}

.nav-toggle.active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.topnav a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 2px;
  transition: color 200ms ease;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 250ms ease;
}

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

.topnav a:hover::after {
  width: 100%;
}

/* ─── Typography ─── */

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

h1,
h2,
h3 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  line-height: 0.96;
}

h1 {
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 5.9rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 14px;
}

h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.lede,
.card p,
.callout,
dd {
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--muted);
}

.lede {
  max-width: 760px;
  margin: 22px 0 0;
}

/* ─── Buttons ─── */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
  transition-duration: 60ms;
}

.button-solid {
  background: var(--surface-strong);
  color: #fff7eb;
}

.button-solid:hover {
  background: #1a3524;
  box-shadow: 0 6px 20px rgba(19, 35, 26, 0.28);
}

.button-ghost {
  border: 1px solid rgba(19, 35, 26, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.button-ghost:hover {
  border-color: rgba(19, 35, 26, 0.34);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(43, 33, 12, 0.08);
}

/* ─── Panels & Cards ─── */

.panel {
  padding: 28px;
  margin-bottom: 24px;
  animation: fade-up 680ms ease-out both;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.card {
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.54);
  transition:
    transform 280ms ease,
    box-shadow 280ms ease,
    border-color 280ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(43, 33, 12, 0.1);
  border-color: rgba(28, 33, 24, 0.2);
}

.accent-card {
  background:
    linear-gradient(180deg, rgba(19, 35, 26, 0.97), rgba(29, 104, 66, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  border-color: rgba(255, 255, 255, 0.06);
}

.accent-card:hover {
  box-shadow: 0 12px 36px rgba(19, 35, 26, 0.3);
  border-color: rgba(255, 255, 255, 0.14);
}

.accent-card .section-label,
.accent-card h2,
.accent-card a,
.accent-card dt {
  color: #fff5e6;
}

.accent-card p,
.accent-card dd {
  color: rgba(255, 245, 230, 0.84);
}

.feature-list {
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--text);
  line-height: 1.8;
}

.feature-list li {
  position: relative;
  padding-left: 22px;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.7;
}

.stats {
  margin: 24px 0 0;
  display: grid;
  gap: 16px;
}

.stats div {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

dt {
  margin-bottom: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

dd {
  margin: 0;
}

.section-header {
  margin-bottom: 20px;
}

/* ─── Text Links ─── */

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--surface-strong);
  font-weight: 700;
  text-decoration: none;
  transition: color 200ms ease, gap 250ms ease;
}

.text-link:hover {
  color: var(--accent);
  gap: 10px;
}

.arrow {
  display: inline-block;
  transition: transform 250ms ease;
}

.text-link:hover .arrow,
.link-stack a:hover .arrow {
  transform: translateX(3px);
}

/* ─── Callout ─── */

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(242, 197, 124, 0.28), rgba(255, 255, 255, 0.78)),
    repeating-linear-gradient(
      -45deg,
      rgba(19, 35, 26, 0.02),
      rgba(19, 35, 26, 0.02) 10px,
      rgba(255, 255, 255, 0.02) 10px,
      rgba(255, 255, 255, 0.02) 20px
    );
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: min(100%, 380px);
}

.link-stack a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease;
}

.link-stack a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(28, 33, 24, 0.22);
  box-shadow: 0 4px 14px rgba(43, 33, 12, 0.08);
}

/* ─── Footer ─── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 6px 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  text-decoration: none;
  transition: color 200ms ease;
}

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

/* ─── 404 ─── */

.error-panel {
  padding: 48px 40px;
  text-align: center;
  animation: fade-up 600ms ease-out both;
}

.error-panel .eyebrow {
  font-size: 5rem;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.25;
  margin-bottom: 8px;
}

.error-panel h1 {
  margin: 0 auto;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.error-panel .lede {
  margin: 18px auto 0;
  text-align: center;
}

.error-panel .hero-actions {
  justify-content: center;
}

/* ─── Scroll Reveal ─── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

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

/* Stagger children inside revealed panels */
.reveal.visible .card {
  animation: card-stagger 500ms ease-out both;
}

.reveal.visible .card:nth-child(1) { animation-delay: 80ms; }
.reveal.visible .card:nth-child(2) { animation-delay: 160ms; }
.reveal.visible .card:nth-child(3) { animation-delay: 240ms; }

/* ─── Animations ─── */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-stagger {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-shimmer {
  0%, 100% { background-position: -50% 0; }
  50% { background-position: 150% 0; }
}

/* ─── Responsive ─── */

@media (max-width: 900px) {
  .two-up,
  .three-up,
  .callout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
  }

  .topnav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .topnav.open {
    display: flex;
  }

  .topnav a {
    padding: 8px 0;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1120px);
    padding-top: 12px;
  }

  .hero,
  .panel {
    border-radius: 22px;
  }

  .hero {
    padding: 22px 22px 28px;
  }

  .panel,
  .card,
  .error-panel {
    padding: 20px;
  }

  h1 {
    line-height: 1;
  }

  .button,
  .link-stack {
    width: 100%;
  }

  .callout > div:first-child h2 {
    font-size: 1.6rem;
    line-height: 1.15;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero::before {
    animation: none;
  }
}
