/* ===== Tokens ===== */
:root {
  --paper: #fbf4e8;
  --paper-2: #f3e7d3;
  --ink: #241a2e;
  --ink-soft: #5d5068;
  --rule: #e3d4bc;
  --fizz: #e2533b;      /* tangerine: the "moxie" */
  --fizz-soft: #f7c9b8;
  --plum: #6b3fa0;      /* the "whimsy" */
  --lemon: #f2c94c;     /* the "effervescence" */
  --card: #fffaf2;
  --shadow: 0 1px 0 var(--rule), 0 12px 30px -18px rgba(36, 26, 46, 0.35);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17121d;
    --paper-2: #211a29;
    --ink: #f5ecdf;
    --ink-soft: #b8abc4;
    --rule: #3a2f45;
    --fizz: #ff7a5c;
    --fizz-soft: #4a2a28;
    --plum: #b591e6;
    --lemon: #f2c94c;
    --card: #1e1826;
    --shadow: 0 1px 0 var(--rule), 0 12px 30px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fizz);
  box-shadow: 6px -6px 0 -2px var(--lemon), -4px -9px 0 -4px var(--plum);
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--fizz);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px) rotate(-1deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(56px, 11vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--fizz);
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.35;
  max-width: 30ch;
  margin: 0 0 32px;
  color: var(--ink-soft);
}

.tagline .moxie {
  color: var(--ink);
  background: linear-gradient(transparent 62%, var(--lemon) 62%);
  padding: 0 2px;
}

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

.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--plum);
  opacity: 0.35;
  animation: rise linear infinite;
}

@keyframes rise {
  from { transform: translateY(40px); opacity: 0; }
  15% { opacity: 0.35; }
  to { transform: translateY(-520px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; opacity: 0.25; }
}

/* ===== Section headings ===== */
.section { padding: 56px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 10px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.section-head .meta {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ===== Featured ===== */
.featured {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: stretch;
  text-decoration: none;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--ink);
}

.featured-art {
  background: var(--fizz);
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.featured-body {
  padding: 36px 36px 36px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fizz);
  margin-bottom: 10px;
}

.featured h3 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.featured p { margin: 0 0 18px; color: var(--ink-soft); }

.read-link {
  font-weight: 600;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--fizz);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 760px) {
  .featured { grid-template-columns: 1fr; gap: 0; }
  .featured-art { min-height: 180px; }
  .featured-body { padding: 24px; }
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.chip:hover { border-color: var(--ink); color: var(--ink); }

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ===== Post grid ===== */
.month {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  margin: 32px 0 14px;
}

.month:first-child { margin-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px) rotate(var(--tilt, -0.6deg));
  border-color: var(--ink);
}

.card h3 {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  flex: 1;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--fizz-soft);
  color: var(--ink);
}

.card .glyph {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 26px;
  height: 26px;
  opacity: 0.9;
}

/* ===== Subscribe band ===== */
.subscribe {
  margin: 40px 0 72px;
  padding: 48px;
  border-radius: 24px;
  background: var(--plum);
  color: #fff;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.subscribe h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  margin: 0 0 10px;
}

.subscribe p { margin: 0; opacity: 0.85; }

.subscribe .btn {
  justify-self: end;
  background: var(--lemon);
  color: #241a2e;
}

.subscribe .btn:hover { box-shadow: 3px 3px 0 #241a2e; }

@media (max-width: 760px) {
  .subscribe { grid-template-columns: 1fr; padding: 32px 24px; }
  .subscribe .btn { justify-self: start; }
}

/* ===== Article ===== */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 0 40px;
}

.article .back {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
}

.article .back:hover { color: var(--ink); }

.article h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 24px 0 16px;
}

.article .byline {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 36px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.prose {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.65;
}

.prose p { margin: 0 0 1.1em; }

.prose > p:first-child::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.85;
  font-weight: 800;
  padding: 6px 10px 0 0;
  color: var(--fizz);
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.prose a { text-decoration-color: var(--fizz); text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose blockquote {
  margin: 1.4em 0;
  padding-left: 20px;
  border-left: 3px solid var(--fizz);
  font-style: italic;
  color: var(--ink-soft);
}
.prose hr {
  border: 0;
  text-align: center;
  margin: 2em 0;
}
.prose hr::after { content: "· · ·"; color: var(--fizz); letter-spacing: 0.5em; }

.source {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-soft);
}

.loading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--ink-soft);
}

.loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fizz);
  animation: fizz 1s ease-in-out infinite;
}

.loading span:nth-child(2) { animation-delay: 0.15s; background: var(--lemon); }
.loading span:nth-child(3) { animation-delay: 0.3s; background: var(--plum); margin-right: 6px; }

@keyframes fizz {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 1; }
}

.read-on {
  padding: 28px;
  border: 1.5px dashed var(--rule);
  border-radius: 16px;
  text-align: center;
}

.read-on p { margin: 0 0 16px; color: var(--ink-soft); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.pager a {
  text-decoration: none;
  display: block;
}

.pager small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pager span {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.pager .next { text-align: right; }

/* ===== About ===== */
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  padding: 72px 0;
  align-items: start;
}

.about-card {
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--fizz);
  border: 1.5px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: clamp(80px, 14vw, 160px);
  font-weight: 800;
  color: var(--paper);
  letter-spacing: -0.04em;
  overflow: hidden;
}

.about h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
}

.about .prose { font-size: 19px; }

.note {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--paper-2);
  padding: 12px 16px;
  border-radius: 10px;
}

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .about-card { max-width: 260px; }
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: 14px;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a { color: var(--ink-soft); }

@media (max-width: 600px) {
  .nav { gap: 14px; }
  .nav .hide-sm { display: none; }
  .hero { padding: 56px 0 48px; }
}
