/* ─── Theme tokens (light only) ────────────────────────────────────────── */
:root {
  --bg: #faf5ee;
  --bg-warm: #f3ebe0;
  --surface: #fffdf9;
  --surface-alt: #f6efe4;
  --border: #e6dccd;
  --border-soft: #efe7da;
  --text: #34302a;
  --heading: #2a2620;
  --muted: #8c8275;
  --accent: #c2674a;
  --accent-dark: #a84e30;
  --accent-soft: #f0d9cd;
  --shadow: 0 1px 2px rgba(74, 58, 40, 0.05),
            0 12px 28px rgba(74, 58, 40, 0.08);
  --shadow-soft: 0 8px 24px rgba(74, 58, 40, 0.07);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-hand:  "Caveat", "Fraunces", cursive;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, Helvetica, Arial, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --max-w: 1120px;
}

html { color-scheme: light; }

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

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(194, 103, 74, 0.07), transparent 60%),
    radial-gradient(90% 60% at 0% 0%, rgba(180, 160, 120, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ─── Layout ───────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header / Hero ────────────────────────────────────────────────────── */
.site-header {
  padding: 30px 0 8px;
}

.site-header .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--heading);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand:hover { opacity: 0.8; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(168, 78, 48, 0.28);
  transition: transform 0.4s ease;
}

.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }

.brand-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 15px;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--accent-dark); }
.nav-links a:hover::after { width: 100%; }

/* ─── Hamburger toggle (hidden on desktop) ─────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  padding: 60px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.hero-text { max-width: 580px; }

.hero .eyebrow {
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0 0 22px;
}

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

.hero p {
  font-size: 17px;
  color: var(--muted);
  max-width: 54ch;
  margin: 0;
}

/* ─── Hero card (handwritten note) ─────────────────────────────────────── */
.hero-card {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
  animation: heroFloat 0.8s ease both;
}

.note {
  position: relative;
  background:
    repeating-linear-gradient(
      transparent,
      transparent 37px,
      rgba(194, 103, 74, 0.10) 38px
    ),
    var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 40px 34px 34px;
  box-shadow: var(--shadow);
  transform: rotate(-1.6deg);
}

.note::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(194, 103, 74, 0.22);
}

.note-line {
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 38px;
  color: #534a3f;
  margin: 0 0 0 6px;
}

.note-line + .note-line { margin-top: 0; }

.note-sign {
  text-align: right;
  color: var(--accent-dark);
  margin-top: 6px;
}

.tape {
  position: absolute;
  width: 90px;
  height: 26px;
  background: rgba(216, 196, 150, 0.55);
  border: 1px solid rgba(216, 196, 150, 0.35);
  box-shadow: 0 2px 6px rgba(74, 58, 40, 0.08);
}

.tape-1 { top: -12px; left: 30px; transform: rotate(-8deg); }
.tape-2 { bottom: -12px; right: 36px; transform: rotate(6deg); }

@keyframes heroFloat {
  from { opacity: 0; transform: translateY(14px) rotate(-1.6deg); }
  to   { opacity: 1; transform: rotate(-1.6deg); }
}

/* ─── Section heading ──────────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-head-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.section-head .count {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

/* ─── Topic pills ──────────────────────────────────────────────────────── */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 30px;
}

.pill {
  padding: 7px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.pill:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Article grid ─────────────────────────────────────────────────────── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 44px 32px;
  padding-bottom: 24px;
}

.card { transition: transform 0.25s ease; }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.card:hover .thumb {
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: 0 14px 32px rgba(74, 58, 40, 0.16);
}

.card:hover .thumb img { transform: scale(1.05); }

.thumb-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(4px);
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 0.01em;
  font-weight: 600;
  color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(74, 58, 40, 0.1);
}

.card-body { padding: 18px 6px 0; }

.card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--heading);
  margin: 0 0 10px;
  transition: color 0.2s ease;
}

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

.card-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ─── Modal ────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(52, 42, 30, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade 0.25s ease;
}

.modal.open { display: flex; }

.modal-inner {
  width: min(720px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(52, 42, 30, 0.3);
  animation: rise 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  z-index: 2;
  transition: background 0.2s ease;
}

.modal-close:hover { background: var(--accent-soft); }
.modal-close svg { width: 16px; height: 16px; stroke: var(--text); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ─── About modal ──────────────────────────────────────────────────────── */
.about-inner {
  position: relative;
  max-width: 720px;
  padding: 44px 46px;
  background: var(--surface);
}

.about-layout {
  display: flex;
  gap: 34px;
  align-items: flex-start;
}

.about-image {
  flex: 0 0 auto;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(-2deg);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--accent-soft);
  pointer-events: none;
}

.about-body { flex: 1; min-width: 0; }

.about-eyebrow {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.about-body h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--heading);
  margin: 0 0 6px;
}

.about-role {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
  font-style: italic;
}

.about-body p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.about-body p strong {
  font-weight: 600;
  color: var(--accent-dark);
}

@media (max-width: 620px) {
  .about-inner { padding: 34px 26px; }
  .about-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
  }
  .about-image { width: 140px; height: 140px; }
  .about-body h2 { font-size: 28px; }
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0 48px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer a {
  color: var(--accent-dark);
  text-decoration: none;
  margin-left: 18px;
}

.site-footer a:first-child { margin-left: 0; }
.site-footer a:hover { text-decoration: underline; }

/* ─── Reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 44px 0 48px;
  }
  .hero-card { order: -1; width: min(100%, 360px); }
}

@media (max-width: 540px) {
  .hero { padding: 36px 0 40px; gap: 32px; }
  .nav-links { gap: 18px; font-size: 14px; }
  .article-grid { gap: 34px 18px; }
  .site-footer { justify-content: center; text-align: center; }
}

/* ─── Mobile header & single-column layout ─────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 18px; }

  .site-header .top {
    flex-wrap: wrap;
    gap: 14px;
  }

  /* Show the hamburger; collapse the nav into a dropdown */
  .nav-toggle { display: inline-flex; }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 6px 2px 4px;
  }
  .nav-links.open { display: flex; }

  /* Let the section heading wrap instead of squeezing */
  .section-head {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* One column — avoids the 300px min-track overflow on narrow phones */
  .article-grid { grid-template-columns: 1fr; }
}

/* ─── View toggle (grid / list) ────────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.view-btn:hover { color: var(--accent-dark); }

.view-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.view-btn svg { width: 15px; height: 15px; }

/* ─── List view layout ─────────────────────────────────────────────────── */
.article-grid.is-list {
  grid-template-columns: 1fr;
  gap: 16px;
}

.article-grid.is-list .card-link {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.article-grid.is-list .card-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(74, 58, 40, 0.12);
}

.article-grid.is-list .card-link:hover .card-title {
  color: var(--accent-dark);
}

.article-grid.is-list .thumb {
  aspect-ratio: 4 / 3;
  box-shadow: none;
}

.article-grid.is-list .card:hover .thumb {
  transform: none;
  box-shadow: none;
}

.article-grid.is-list .card-body { padding: 0; }
.article-grid.is-list .card-title { margin-bottom: 8px; }

@media (max-width: 540px) {
  .article-grid.is-list .card-link {
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding: 12px;
  }
  .article-grid.is-list .card-desc { -webkit-line-clamp: 3; }
}
