:root {
  --bg: #f6f1e6;
  --bg-strong: #e7dcc6;
  --card: rgba(255, 252, 246, 0.86);
  --card-strong: rgba(255, 248, 239, 0.96);
  --ink: #151515;
  --muted: #5f564d;
  --line: rgba(21, 21, 21, 0.12);
  --accent: #c65932;
  --accent-dark: #9b4020;
  --accent-soft: rgba(198, 89, 50, 0.1);
  --support: #0f766e;
  --shadow: 0 24px 70px rgba(62, 44, 24, 0.16);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --page-width: 1200px;
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
    serif;
  --sans: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(198, 89, 50, 0.18), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf6ef 0%, var(--bg) 46%, #efe4cf 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: auto;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
  animation: drift 16s ease-in-out infinite;
}

body::before {
  width: 18rem;
  height: 18rem;
  top: 8%;
  right: -5rem;
  background: rgba(198, 89, 50, 0.12);
}

body::after {
  width: 14rem;
  height: 14rem;
  bottom: 8%;
  left: -4rem;
  background: rgba(15, 118, 110, 0.13);
  animation-delay: -8s;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 1rem;
}

.site-frame {
  width: min(calc(100% - 2rem), var(--page-width));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.site-header,
.site-footer,
.section,
.signal-strip,
.post-layout,
.page-hero,
.not-found {
  backdrop-filter: blur(16px);
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 14px 35px rgba(77, 57, 30, 0.08);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.nav-label {
  display: inline;
}

.nav-icon {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.site-nav a,
.nav-cta {
  text-decoration: none;
}

.site-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(21, 21, 21, 0.08);
  color: var(--ink);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  flex-shrink: 0;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.nav-cta,
.button-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 24px rgba(21, 21, 21, 0.18);
}

.nav-cta-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(21, 21, 21, 0.08);
  border: 1px solid var(--line);
}

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

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.hero,
.page-hero {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    145deg,
    rgba(255, 250, 242, 0.84),
    rgba(238, 226, 203, 0.74)
  );
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
  align-items: start;
  gap: 2rem;
  padding: 2.2rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  letter-spacing: -0.05em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  letter-spacing: -0.04em;
}

h3 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

p,
li {
  font-size: 1.02rem;
}

.hero-lede,
.page-lede {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.6rem 0 1rem;
}

.hero-note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-style: italic;
}

.hero-visual {
  position: relative;
  display: grid;
  align-content: start;
  gap: 1rem;
}

.portrait-card {
  position: relative;
  width: min(100%, 34rem);
  margin-inline: auto;
  padding: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: calc(var(--radius-lg) + 0.5rem);
  background: rgba(255, 250, 244, 0.84);
  transform: rotate(-2deg);
  box-shadow: var(--shadow);
  overflow: visible;
}

.portrait-frame {
  width: 100%;
  display: block;
  overflow: visible;
}

.portrait-card img {
  display: block;
  width: 100%;
  height: auto;
}

.portrait-meta {
  position: absolute;
  z-index: 3;
  max-width: 15rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: rgba(21, 21, 21, 0.86);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(21, 21, 21, 0.18);
}

.portrait-meta-top {
  top: 1.25rem;
  left: -1.25rem;
}

.portrait-meta-bottom {
  right: -0.75rem;
  bottom: 1.5rem;
  max-width: 22rem;
  width: max-content;
  background: rgba(15, 118, 110, 0.9);
}

.stat-card,
.feature-card,
.info-card,
.post-card,
.page-hero,
.not-found {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 16px 32px rgba(80, 57, 28, 0.08);
}

.stat-card {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
}

.stat-label,
.post-meta {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section,
.page-hero,
.not-found {
  margin-top: 1.5rem;
  padding: 1.8rem;
}

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  background: rgba(255, 249, 240, 0.68);
}

.hero-tags {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
  margin-top: 0.25rem;
}

.signal-strip span {
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(21, 21, 21, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.section-intro {
  max-width: 46rem;
  margin-bottom: 1.5rem;
}

.card-grid,
.info-grid {
  display: grid;
  gap: 1rem;
}

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

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

.feature-card,
.info-card,
.post-card {
  padding: 1.4rem;
}

.feature-card {
  min-height: 14rem;
}

.feature-card-accent {
  background:
    linear-gradient(180deg, rgba(198, 89, 50, 0.08), rgba(255, 255, 255, 0.72)),
    var(--card);
}

.info-card ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.info-card li + li {
  margin-top: 0.45rem;
}

.info-card a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.info-card a:hover {
  color: var(--accent);
}

.writing-preview .post-card,
.post-card-large {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-feed {
  display: grid;
  gap: 1rem;
}

.post-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-card-copy {
  display: grid;
  gap: 0.55rem;
}

.post-card-copy p {
  margin: 0;
}

.post-card-copy a:not(.post-card-link) {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.post-card-copy a:not(.post-card-link):hover {
  color: var(--accent);
}

.post-card-link {
  text-decoration: none;
}

.post-card-link:hover {
  color: var(--accent-dark);
}

.loading-copy,
.section-linkout {
  margin: 0;
}

.section-linkout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.empty-state {
  display: grid;
  gap: 0.75rem;
}

.empty-state p,
.empty-state h2,
.empty-state h3 {
  margin: 0;
}

.page-hero {
  margin-top: 1.5rem;
}

.post-layout {
  display: grid;
  gap: 1.5rem;
}

.post-header {
  margin-top: 1.5rem;
  padding: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 250, 242, 0.88), rgba(231, 220, 198, 0.76));
  box-shadow: var(--shadow);
}

.post-body {
  background: var(--card-strong);
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body > :last-child {
  margin-bottom: 0;
}

.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  margin-top: 1.5rem;
  line-height: 1.05;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre,
.post-body hr {
  margin: 1rem 0 0;
}

.post-body a {
  color: var(--accent-dark);
}

.post-body code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(21, 21, 21, 0.08);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.post-body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #1c1a17;
  color: #f7f1e7;
}

.post-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.post-body blockquote {
  padding-left: 1rem;
  border-left: 3px solid rgba(198, 89, 50, 0.45);
  color: var(--muted);
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.post-archive-note {
  color: var(--muted);
}

.post-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-md);
  background: rgba(255, 249, 240, 0.72);
  color: var(--muted);
}

.not-found {
  display: grid;
  place-items: center;
  min-height: 70vh;
  text-align: center;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(1.4rem);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 1.2rem, 0) scale(1.04);
  }
}

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

  .hero {
    min-height: auto;
  }

  .hero-visual {
    order: -1;
  }

  .stat-stack {
    margin-left: 0;
  }

  .writing-preview .post-card,
  .post-feed .post-card,
  .post-card-large,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .site-frame {
    width: min(calc(100% - 1rem), var(--page-width));
    padding-top: 0.5rem;
  }

  .site-header,
  .section,
  .page-hero,
  .post-header,
  .site-footer,
  .not-found {
    padding: 1.2rem;
  }

  .hero {
    padding: 1.2rem;
  }

  .site-header {
    position: static;
    flex-wrap: nowrap;
    gap: 0.85rem;
    border-radius: var(--radius-lg);
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-header::-webkit-scrollbar {
    display: none;
  }

  .brand {
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }

  .site-nav {
    width: auto;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: flex-start;
    min-width: 0;
  }

  .header-actions {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: flex-start;
  }

  .site-nav a,
  .nav-cta {
    padding: 0.6rem 0.72rem;
    white-space: nowrap;
  }

  .nav-cta {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
  }

  .nav-label {
    display: none;
  }

  .nav-icon {
    display: inline-flex;
  }

  .post-card,
  .post-card-large {
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.6rem);
  }

  h2 {
    font-size: clamp(1.8rem, 10vw, 2.7rem);
  }

  .portrait-meta {
    position: static;
    margin-bottom: 0.75rem;
    max-width: none;
  }

  .portrait-meta-bottom {
    margin-top: 0.75rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
