/* ---------- FONTS ---------- */
@font-face {
  font-family: 'Peaches';
  src: url('assets/fonts/Peaches.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Peaches';
  src: url('assets/fonts/Peaches-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Peaches Script';
  src: url('assets/fonts/Peaches-Script.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- TOKENS ---------- */
:root {
  --pearl:      #F0EDE8;
  --blue:       #5272D4;
  --chartreuse: #C8B800;
  --tomato:     #E8451A;
  --ink:        #1A1814;
  --ink-soft:   #3a362f;
  --ink-muted:  #6b655a;
  --rule:       #1A1814;

  --font-display: 'Peaches', Georgia, serif;
  --font-script:  'Peaches Script', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-pill: 999px;
  --radius-sm: 6px;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--pearl);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- LAYOUT ---------- */
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }

/* ---------- SECTION COLORS ---------- */
.bg-pearl      { background: var(--pearl); color: var(--ink); }
.bg-blue       { background: var(--blue); color: var(--pearl); }
.bg-chartreuse { background: var(--chartreuse); color: var(--ink); }
.bg-tomato     { background: var(--tomato); color: var(--pearl); }
.bg-ink        { background: var(--ink); color: var(--pearl); }

/* ---------- TYPE ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(64px, 12vw, 188px);
  line-height: 0.86;
  letter-spacing: -0.015em;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(52px, 8vw, 128px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.display-md {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.005em;
}
.display-sm {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1;
}
.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 0.95;
}
.overline {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.lead {
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.4;
  font-weight: 400;
  max-width: 42ch;
}

/* ---------- PILLS / TAGS ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.pill-solid-tomato    { background: var(--tomato); color: var(--pearl); border-color: var(--tomato); }
.pill-solid-chart     { background: var(--chartreuse); color: var(--ink); border-color: var(--chartreuse); }
.pill-solid-blue      { background: var(--blue); color: var(--pearl); border-color: var(--blue); }
.pill-solid-ink       { background: var(--ink); color: var(--pearl); border-color: var(--ink); }
.pill-outline-ink     { color: var(--ink); border-color: var(--ink); background: transparent; }
.pill-outline-pearl   { color: var(--pearl); border-color: var(--pearl); background: transparent; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  border: 1.5px solid var(--ink);
  transition: transform .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--pearl); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-blue { background: var(--blue); color: var(--pearl); border-color: var(--blue); }
.btn-tomato { background: var(--tomato); color: var(--pearl); border-color: var(--tomato); }
.btn-chart { background: var(--chartreuse); color: var(--ink); border-color: var(--chartreuse); }
.btn-ghost { background: transparent; }
.btn-ghost-pearl { background: transparent; color: var(--pearl); border-color: var(--pearl); }
.btn-ghost-pearl:hover { background: var(--pearl); color: var(--ink); }

.btn .arrow {
  width: 18px; height: 18px;
  transition: transform .2s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- RULE LINES ---------- */
.rule {
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border: 0;
  margin: 0;
}
.rule-thick { height: 8px; }
.rule-chart { background: var(--chartreuse); }
.rule-blue { background: var(--blue); }
.rule-ink { background: var(--ink); }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--pearl);
  border-bottom: 1.5px solid var(--ink);
}
.site-header.on-dark {
  background: var(--ink);
  color: var(--pearl);
  border-bottom-color: var(--pearl);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-block: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 44px; height: 44px;
  background: var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark img {
  width: 30px; height: 30px;
}
.on-dark .brand-mark { background: var(--chartreuse); }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding-block: 4px;
}
.nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 3px;
  background: var(--chartreuse);
}
.nav a:hover { color: var(--blue); }
.on-dark .nav a:hover { color: var(--chartreuse); }

.header-cta {
  display: flex; align-items: center; gap: 12px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--ink);
  color: var(--pearl);
  padding: 80px 0 32px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1.5px solid rgba(240,237,232,0.2);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  margin: 0 0 16px;
  color: var(--chartreuse);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-col a { font-size: 15px; }
.footer-col a:hover { color: var(--chartreuse); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(240,237,232,0.6);
  letter-spacing: 0.04em;
}
.footer-wordmark {
  font-family: var(--font-display);
  font-size: 120px;
  line-height: 0.9;
  color: var(--pearl);
  margin: 40px 0 24px;
}
.footer-wordmark em {
  font-family: var(--font-script);
  font-style: normal;
  color: var(--chartreuse);
}

/* ---------- ARTICLE CARDS ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.card {
  position: relative;
  padding: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 340px;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 0 var(--ink);
}
.card-media {
  aspect-ratio: 4 / 3;
  background: var(--pearl);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.card-media.placeholder {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(26,24,20,0.08) 0 8px,
    transparent 8px 16px
  );
  display: grid; place-items: center;
}
.card-media.placeholder span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--pearl);
  padding: 4px 10px;
  border-radius: 4px;
}
.card-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1;
  margin: 0;
  text-wrap: pretty;
}
.card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1.5px solid currentColor;
  opacity: 0.85;
}
.card-meta .dot { width: 3px; height: 3px; background: currentColor; border-radius: 50%; }

.card.bg-blue, .card.bg-tomato, .card.bg-ink { border-color: transparent; }
.card.bg-blue .card-media,
.card.bg-tomato .card-media,
.card.bg-ink .card-media { border-color: var(--pearl); }

/* ---------- DECORATIVE SHAPES ---------- */
.shape {
  position: absolute;
  pointer-events: none;
}
.asterisk {
  display: inline-block;
  font-family: var(--font-display);
  line-height: 0;
}

/* ---------- UTILITIES ---------- */
.stack-sm > * + * { margin-top: 12px; }
.stack-md > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }
.flex { display: flex; }
.gap-sm { gap: 12px; }
.gap-md { gap: 20px; }
.gap-lg { gap: 32px; }
.center { text-align: center; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ========================================
   MOBILE NAV & RESPONSIVE FIXES
   ======================================== */

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

/* Mobile drawer overlay */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(26, 24, 20, 0.5);
  backdrop-filter: blur(2px);
}

.mobile-drawer-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--pearl);
  border-left: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  padding: 80px 32px 48px;
}

.mobile-drawer-inner nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-drawer-inner nav a {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  padding: 16px 0;
  border-bottom: 1.5px solid rgba(26, 24, 20, 0.15);
  color: var(--ink);
}

.mobile-drawer-inner nav a:hover,
.mobile-drawer-inner nav a.mobile-nav-current {
  color: var(--blue);
}

.mobile-nav-subscribe {
  margin-top: 32px !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  font-weight: 600;
  background: var(--chartreuse);
  color: var(--ink) !important;
  padding: 16px 24px !important;
  border-radius: 999px;
  border: none !important;
  text-align: center;
}

/* ========================================
   RESPONSIVE LAYOUT FIXES
   ======================================== */

@media (max-width: 900px) {
  /* Show hamburger, hide desktop nav + subscribe pill */
  .hamburger { display: flex; }
  .nav-desktop { display: none !important; }
  .nav-desktop-only { display: none !important; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-wordmark { font-size: 72px; }

  /* Card grid: 2 columns */
  .card-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .card-grid .card { grid-column: span 1 !important; }

  /* Two-col sections → single col */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="gridTemplateColumns: '1fr 1fr'"],
  [style*="gridTemplateColumns: \"1fr 1fr\""] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 2fr 1fr"],
  [style*="gridTemplateColumns: '2fr 1fr'"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1.4fr"],
  [style*="gridTemplateColumns: '1fr 1.4fr'"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="gridTemplateColumns: '1fr 1.2fr'"] {
    grid-template-columns: 1fr !important;
  }

  [style*="gridTemplateColumns: '1.2fr 1fr'"] {
    grid-template-columns: 1fr !important;
  }

  /* Stat grid (about page) */
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Shop masthead two-col → single */
  .bg-blue [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Bundle callout */
  .bg-tomato [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    text-align: left !important;
  }
  .bg-tomato [style*="textAlign: 'right'"] {
    text-align: left !important;
  }

  /* Featured article card: force column layout */
  .card[style*="flex-direction: row"] {
    flex-direction: column !important;
  }
}

@media (max-width: 640px) {
  /* Card grid: single column */
  .card-grid { grid-template-columns: 1fr !important; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
  .footer-wordmark { font-size: 52px; }

  /* Stat grid: single col */
  [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Hero meta bar: hide middle item on tiny screens */
  .hero-meta-middle { display: none; }

  /* Filter bars: scrollable */
  .filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }

  /* Article prose: tighter */
  .prose { font-size: 17px; }

  /* Buttons: full width in stacked layouts */
  .btn-stack-mobile {
    width: 100%;
    justify-content: center;
  }
}

/* About page portrait grid */
.about-portrait-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

/* On mobile: single column, no sticky behaviour */
@media (max-width: 900px) {
  .about-portrait-grid {
    grid-template-columns: 1fr;
    align-items: unset;
  }
  .about-portrait-col {
    position: static;
  }
}
