:root {
  --bg: #2c3531;
  --bg-deep: #232a27;
  --text: #d1e8e2;
  --accent: #ffcb9a;
  --secondary: #d9b08c;
  --muted: rgba(209, 232, 226, 0.72);
  --border: rgba(209, 232, 226, 0.18);
  --card: rgba(209, 232, 226, 0.06);
  --max: 42rem;
  --wide: 56rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  position: relative;
  isolation: isolate;
}

/* Atmosphere: soft washes + fine grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 203, 154, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 45% at 95% 15%, rgba(217, 176, 140, 0.12), transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(209, 232, 226, 0.08), transparent 55%),
    linear-gradient(165deg, var(--bg-deep) 0%, var(--bg) 45%, #31403b 100%);
  animation: wash-drift 28s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(209, 232, 226, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(209, 232, 226, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

@keyframes wash-drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.05) translate(-1.5%, 1%);
  }
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(44, 53, 49, 0.78);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  animation: header-in 0.6s var(--ease) both;
}

@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header__inner,
.site-footer__inner,
.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  border-radius: 0.45rem;
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.wordmark:hover {
  opacity: 0.88;
  transform: scale(1.04);
}

.wordmark__logo {
  display: block;
  width: 512px;
  max-width: min(512px, calc(100vw - 6rem));
  height: auto;
  aspect-ratio: 512 / 192;
  object-fit: contain;
  border-radius: 0.4rem;
  opacity: 1;
  transition: opacity 0.22s ease;
}

.wordmark__logo.is-fading {
  opacity: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 0.15rem;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

main {
  flex: 1;
  padding: 2.5rem 0 3.5rem;
}

.wrap--narrow {
  width: min(100% - 2rem, var(--max));
}

.hero {
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.hero::after {
  content: "";
  display: block;
  width: min(8rem, 40%);
  height: 3px;
  margin-top: 1.4rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--secondary), transparent);
  animation: line-grow 0.9s var(--ease) 0.35s both;
}

@keyframes line-grow {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
  font-weight: 700;
  animation: rise-in 0.8s var(--ease) both;
}

.hero p,
.lede {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0;
  max-width: 38rem;
  animation: rise-in 0.8s var(--ease) 0.12s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prose > * + * {
  margin-top: 1rem;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.prose h1 {
  margin-top: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  animation: rise-in 0.7s var(--ease) both;
}

.prose h2 {
  font-size: 1.35rem;
  color: var(--accent);
}

.prose h3 {
  font-size: 1.1rem;
  color: var(--secondary);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose code,
.prose pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.prose code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

.prose pre {
  background: #232a27;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
}

.section {
  margin-top: 2.5rem;
  padding-left: 1rem;
  border-left: 2px solid transparent;
  border-image: linear-gradient(180deg, var(--accent), transparent) 1;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--accent);
}

.section p {
  margin: 0;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 1.1rem 1.15rem;
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    transform 0.3s var(--ease),
    background 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--secondary));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}

a.card:hover {
  border-color: rgba(255, 203, 154, 0.55);
  background: rgba(209, 232, 226, 0.09);
  transform: translateY(-4px);
  color: inherit;
}

a.card:hover::before {
  transform: scaleY(1);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--accent);
  transition: color 0.2s ease;
}

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

.meta {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.25rem;
  margin: 1rem 0 0;
}

.meta dt {
  color: var(--secondary);
  font-weight: 600;
}

.meta dd {
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  background: rgba(35, 42, 39, 0.45);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

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

.cards .reveal:nth-child(2) {
  transition-delay: 0.08s;
}

.cards .reveal:nth-child(3) {
  transition-delay: 0.16s;
}

.cards .reveal:nth-child(4) {
  transition-delay: 0.24s;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.15rem;
    padding-bottom: 0.5rem;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .site-nav.is-open {
    display: flex;
    animation: nav-open 0.3s var(--ease);
  }

  @keyframes nav-open {
    from {
      opacity: 0;
      transform: translateY(-0.4rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .site-nav a {
    padding: 0.45rem 0;
  }

  .site-nav a::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before,
  .site-header,
  .hero h1,
  .hero p,
  .hero::after,
  .prose h1,
  .reveal,
  .cards .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

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