:root {
  --mai-ink: #5d524b;
  --mai-ink-muted: rgba(93, 82, 75, 0.68);
  --mai-ink-soft: rgba(93, 82, 75, 0.46);
  --mai-paper: #fef9ed;
  --mai-paper-2: #fbf4e5;
  --mai-cream: #f7ecd9;
  --mai-cream-2: #f2ead9;
  --mai-peach: #fbd3be;
  --mai-yellow-wash: #f7f1e3;
  --mai-dark-brown: #2a1816;
  --mai-link-warm: #a67c52;
  --mai-green-wash: #d7e6d6;
  --mai-blue-wash: #d9e4e9;
  --mai-shell-ink: #2f4858;
  --mai-shell-sage: #58857c;
  --mai-shell-sand: #f2d3ad;
  --font-shell: 'Google Sans Flex', system-ui, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'Red Hat Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--mai-ink);
  background: var(--mai-paper);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% 8%, rgba(251, 211, 190, 0.62), transparent 30%),
    radial-gradient(circle at 85% 22%, rgba(215, 230, 214, 0.66), transparent 27%),
    radial-gradient(circle at 52% 105%, rgba(217, 228, 233, 0.56), transparent 36%),
    linear-gradient(180deg, var(--mai-paper) 0%, var(--mai-yellow-wash) 42%, var(--mai-paper-2) 100%);
}

body::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  color: var(--mai-paper);
  background: var(--mai-ink);
}

.mai-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1152px) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(242, 211, 173, 0.82);
  box-shadow: 0 4px 20px rgba(47, 72, 88, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(18px);
}

.button,
.mono,
.eyebrow,
.metadata,
.tiny-label,
.archive-date,
.source-badge {
  font-family: var(--font-mono);
}

.brand,
.nav-links,
.nav-cta {
  font-family: var(--font-shell);
}

.brand {
  text-decoration: none;
  color: var(--mai-shell-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand span { color: var(--mai-shell-sage); }

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 38px);
  justify-content: center;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-links a,
.nav-cta,
.button,
.archive-card,
.footer a {
  text-decoration: none;
}

.nav-links a {
  color: var(--mai-ink-muted);
  transition: color 180ms ease;
}

.nav-links a:hover { color: var(--mai-ink); }

.nav-links a[aria-current='page'] {
  color: var(--mai-shell-ink);
  box-shadow: inset 0 -2px 0 var(--mai-shell-sage);
}

.nav-cta {
  justify-self: end;
  min-height: 38px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(47, 72, 88, 0.15);
  background: rgba(255, 255, 255, 0.45);
  color: var(--mai-shell-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: background 180ms ease, color 180ms ease;
}

.nav-cta:hover,
.button:hover {
  background: var(--mai-ink);
  color: var(--mai-paper);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--mai-shell-sage);
  outline-offset: 3px;
  border-radius: 4px;
}

.hero {
  padding: clamp(116px, 11vw, 148px) 24px clamp(44px, 5vw, 72px);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, var(--mai-peach), rgba(251, 211, 190, 0.36) 72%, transparent);
}

.hero--post {
  padding-bottom: clamp(40px, 5vw, 72px);
}

.hero::before,
.hero::after,
.watercolor-orb::before,
.watercolor-orb::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.78;
  transform: rotate(-12deg);
}

.hero::before {
  width: 210px;
  height: 84px;
  right: 11%;
  top: 26%;
  background: radial-gradient(circle at 22% 55%, #f2dddb 0 22%, transparent 24%),
    radial-gradient(circle at 43% 40%, #f7ecd9 0 21%, transparent 23%),
    radial-gradient(circle at 63% 56%, #d7e6d6 0 22%, transparent 24%),
    radial-gradient(circle at 82% 42%, #d9e4e9 0 20%, transparent 22%);
}

.hero::after {
  width: 168px;
  height: 112px;
  left: 8%;
  bottom: 18%;
  background: radial-gradient(circle at 22% 72%, #e9d3a7 0 24%, transparent 26%),
    radial-gradient(circle at 42% 35%, #d7e6d6 0 20%, transparent 22%),
    radial-gradient(circle at 68% 62%, #f2dddb 0 25%, transparent 27%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
}

.eyebrow {
  margin: 0 0 26px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(47, 72, 88, 0.72);
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

.hero-title {
  margin: 0;
  font-size: clamp(54px, 7vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  font-weight: 450;
  color: var(--mai-shell-ink);
}

.hero-title em {
  display: block;
  font-style: italic;
  font-weight: 450;
  color: var(--mai-ink);
}

.post-hero-title {
  max-width: 980px;
  margin-inline: auto;
  font-size: clamp(40px, 5.4vw, 80px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 450;
  color: var(--mai-shell-ink);
}

.hero-subtitle {
  width: min(100%, 720px);
  margin: 26px auto 0;
  font-size: clamp(19px, 1.7vw, 25px);
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--mai-ink);
}

.hero-stats {
  margin: 38px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.stat-pill,
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(254, 249, 237, 0.58);
  color: var(--mai-shell-ink);
  border: 1px solid rgba(47, 72, 88, 0.12);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.02em;
}

.section {
  padding: clamp(64px, 8vw, 120px) 24px;
}

.hero + .section { padding-top: clamp(40px, 5vw, 64px); }

.container {
  width: min(100%, 1220px);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 450;
}

.lead {
  font-size: clamp(19px, 1.7vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--mai-ink-muted);
}

.feature-story {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: end;
}

.portrait-panel {
  min-height: 460px;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(93, 82, 75, 0.04), rgba(93, 82, 75, 0.16)),
    var(--mai-cream);
  box-shadow: 0 34px 80px rgba(93, 82, 75, 0.14);
}

.portrait-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: saturate(0.92) sepia(0.08);
  opacity: 0.82;
}

.portrait-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 15%, rgba(254, 249, 237, 0.5), transparent 28%),
    linear-gradient(180deg, transparent 38%, rgba(42, 24, 22, 0.42));
}

.story-card {
  position: relative;
  margin-left: clamp(-180px, -10vw, -80px);
  margin-bottom: 54px;
  padding: clamp(28px, 4vw, 46px);
  border-radius: 4px;
  background: rgba(254, 249, 237, 0.94);
  box-shadow: 0 28px 64px rgba(93, 82, 75, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.story-card h2 {
  max-width: 680px;
  margin-bottom: 28px;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 450;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  align-items: center;
  color: var(--mai-ink-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.arrow-dot {
  margin-left: auto;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 2px;
  background: var(--mai-cream);
  color: var(--mai-link-warm);
}

.archive-section {
  background: linear-gradient(180deg, transparent, rgba(251, 244, 229, 0.82));
}

.section-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 0.64fr);
  gap: clamp(28px, 8vw, 118px);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 52px;
}

.filter-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(254, 249, 237, 0.7);
  color: var(--mai-ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(93, 82, 75, 0.07);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.filter-pill:hover { color: var(--mai-ink); background: var(--mai-cream); }

.filter-pill[aria-pressed='true'] {
  background: var(--mai-ink);
  color: var(--mai-paper);
}

.archive-list {
  display: grid;
  gap: 0;
  border-bottom: 1px solid rgba(93, 82, 75, 0.14);
}

.archive-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 44px;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  padding: 26px 0;
  border-top: 1px solid rgba(93, 82, 75, 0.14);
  color: var(--mai-ink);
}

.archive-card[hidden] { display: none; }

.archive-date {
  color: var(--mai-ink-soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.archive-date span { display: block; }

.archive-card h3 {
  margin: 0 0 8px;
  font-size: clamp(26px, 2.4vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 450;
}

.archive-card p {
  max-width: 760px;
  margin: 0;
  color: var(--mai-ink-muted);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-arrow {
  justify-self: end;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: var(--mai-cream);
  color: var(--mai-link-warm);
  font-family: var(--font-mono);
  transition: background 180ms ease, color 180ms ease;
}

.archive-card:hover .archive-arrow {
  background: var(--mai-ink);
  color: var(--mai-paper);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 40px);
}

.note-card {
  display: grid;
  align-content: start;
  gap: 20px;
  color: var(--mai-ink);
  text-decoration: none;
}

.note-card--lead {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 52px);
  align-items: center;
}

.note-thumb {
  margin: 0;
  aspect-ratio: 1200 / 630;
  overflow: hidden;
  border-radius: 6px;
  background: var(--mai-cream);
  box-shadow: 0 18px 44px rgba(93, 82, 75, 0.14);
}

.note-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.note-card:hover .note-thumb img { transform: scale(1.025); }

.note-meta {
  margin: 0 0 10px;
  color: var(--mai-ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.note-card h3 {
  margin: 0 0 10px;
  font-size: clamp(28px, 2.5vw, 38px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 450;
  transition: color 180ms ease;
}

.note-card--lead h3 { font-size: clamp(34px, 3.6vw, 54px); }
.note-card:hover h3 { color: var(--mai-shell-ink); }

.note-card .note-excerpt {
  margin: 0;
  color: var(--mai-ink-muted);
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.manifesto {
  min-height: 78vh;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--mai-yellow-wash);
}

.manifesto .section-title {
  width: min(100%, 990px);
  margin-inline: auto;
}

.manifesto .lead {
  width: min(100%, 760px);
  margin: 34px auto 0;
}

.post-shell {
  background: linear-gradient(180deg, var(--mai-yellow-wash), var(--mai-paper) 24%);
}

.post-layout {
  --measure: 700px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) 24px clamp(72px, 9vw, 112px);
}

.post-meta-card {
  max-width: var(--measure);
  margin: 0 auto 44px;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  border-top: 1px solid rgba(93, 82, 75, 0.14);
  border-bottom: 1px solid rgba(93, 82, 75, 0.14);
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-actions .button { min-height: 36px; padding: 0 16px; }
.post-actions .button-square { display: none; }

.button {
  min-height: 44px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--mai-cream);
  color: var(--mai-ink);
  border: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.button-square {
  width: 44px;
  padding: 0;
  border-radius: 3px;
  color: var(--mai-link-warm);
}

.post-body {
  font-size: clamp(19px, 1.45vw, 22px);
  line-height: 1.6;
  letter-spacing: -0.008em;
  color: var(--mai-ink);
}

.post-body > *:first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.15em; }
.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 1.8em 0 0.5em;
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 450;
}
.post-body h2 { font-size: clamp(28px, 2.6vw, 40px); }
.post-body h3 { font-size: clamp(23px, 2vw, 30px); }
.post-body h4 { font-size: clamp(20px, 1.6vw, 24px); }
.post-body a { color: var(--mai-link-warm); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.post-body ul,
.post-body ol { margin: 0 0 1.3em; padding-left: 1.15em; }
.post-body li { margin-bottom: 0.44em; }
.post-body blockquote {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid rgba(166, 124, 82, 0.42);
  color: var(--mai-ink-muted);
  font-style: italic;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 18px 48px rgba(93, 82, 75, 0.14);
}
.post-body figure { margin: 1.8em 0; }
.post-body figcaption,
.post-body .wp-caption-text {
  margin-top: 0.8em;
  color: var(--mai-ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}
.post-body pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 4px;
  background: rgba(42, 24, 22, 0.92);
  color: var(--mai-paper);
  font-family: var(--font-mono);
  font-size: 14px;
}
.post-body code { font-family: var(--font-mono); }
.post-body iframe,
.post-body embed,
.post-body video {
  max-width: 100%;
  border: 0;
}
.post-body .embed-youtube,
.post-body .wp-block-embed__wrapper {
  position: relative;
  max-width: 100%;
}
.post-body table { width: 100%; border-collapse: collapse; font-size: 18px; }
.post-body > :is(p, h2, h3, h4, ul, ol, blockquote, dl, hr) {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
.post-body video { display: block; margin-left: auto; margin-right: auto; }
.post-body figcaption,
.post-body .wp-caption-text {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
.post-body th,
.post-body td { padding: 0.65em; border: 1px solid rgba(93,82,75,0.16); }

.post-nav {
  max-width: var(--measure);
  margin: 72px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.post-nav a {
  padding: 24px;
  border-radius: 4px;
  background: rgba(254,249,237,0.78);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(93,82,75,0.08);
}

.post-nav span {
  display: block;
  margin-bottom: 10px;
  color: var(--mai-ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.post-nav strong {
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 450;
}

.footer {
  padding: 72px 24px;
  background: var(--mai-ink);
  color: var(--mai-paper);
}

.footer-inner {
  width: min(100%, 1220px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: center;
}

.footer a { color: rgba(254, 249, 237, 0.82); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 900px) {
  .mai-nav { grid-template-columns: auto 1fr auto; }
  .nav-links { justify-content: flex-start; overflow-x: auto; }
  .feature-story,
  .section-heading-row { grid-template-columns: 1fr; }
  .section-heading-row { gap: 14px; }
  .portrait-panel { min-height: 420px; }
  .story-card { margin: -90px 20px 0; }
  .archive-card { grid-template-columns: 1fr; gap: 10px; padding: 22px 0; }
  .archive-arrow { display: none; }
  .archive-date span { display: inline; }
  .archive-date span + span::before { content: ' · '; }
  .note-grid,
  .note-card--lead { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .mai-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 60px;
    padding: 0 16px;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }
  .nav-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    overflow: visible;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .nav-links li:nth-child(2),
  .nav-links li:nth-child(4) { display: none; }
  .nav-cta { padding: 0 13px; }
  .hero { padding: 108px 18px 48px; }
  .section { padding: 64px 18px; }
  .hero + .section { padding-top: 36px; }
  .story-card { margin-inline: 0; }
  .metadata { display: grid; gap: 10px; }
  .arrow-dot { margin-left: 0; }
  .archive-card h3 { font-size: clamp(26px, 8vw, 34px); }
  .note-card h3 { font-size: clamp(28px, 8.4vw, 36px); }
  .post-meta-card { justify-content: flex-start; }
  .post-layout { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
