/* Theme variables */
:root {
  --bg: #0f1115;
  --bg-elev: #151822;
  --text: #e5e7eb;
  --muted: #9aa3b2;
  --primary: #7c9cff;
  --accent: #22d3ee;
  --card: #121520;
  --border: #22283a;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
}

:root.light {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --text: #0b1220;
  --muted: #5b677a;
  --primary: #3557ff;
  --accent: #0ea5e9;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(2,6,23,0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
  padding-block: 32px;
}

ol {
  list-style-type: decimal;
  margin-top: 12px;
}
ol li {
  margin-bottom: 12px;
}
/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  margin-inline: auto;
  background: color-mix(in oklab, var(--bg), transparent 10%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.nav { display: flex; gap: 16px; }
.nav a { color: var(--text); opacity: 0.85; padding: 6px 10px; border-radius: 8px; }
.nav a.active, .nav a:hover { background: var(--bg-elev); opacity: 1; }

.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; }

.theme-toggle { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }

@media (max-width: 800px) {
  .nav { display: none; position: absolute; right: 16px; top: 56px; flex-direction: column; background: var(--bg-elev); padding: 12px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* Hero */
.hero { padding: 32px 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 8px; }
.hero .lead { color: var(--muted); margin: 0; }
/* Sections */
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 12px; }
.see-all { color: var(--muted); }

/* Grid */
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  @media (max-width: 900px){ .grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 600px){ .grid { grid-template-columns: 1fr; } }

  /* Category rows (horizontal scrollers) */
  .category-rows { display: grid; gap: 24px; }
  .cat-row { display: block; }
  .cat-row .row-header { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 10px; }
  .cat-row .row-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .cat-row .row-scroll > .card { scroll-snap-align: start; }
  .card.small { flex: 0 0 auto; min-width: 260px; max-width: 320px; }
  @media (max-width: 700px){ .card.small { min-width: 220px; } }
  .card.small .thumb { aspect-ratio: 16/9; }
  .card .content { padding: 14px; }
  .card .title { font-size: 18px; margin: 0 0 6px; }
  .card .excerpt { color: var(--muted); margin: 0 0 8px; }
  .card .meta { color: var(--muted); font-size: 13px; }

  /* Hero card (featured on homepage) */
  .hero-post .hero-card,
  .hero-card { display: grid; grid-template-columns: 1fr; }
  .hero-card .thumb {
    aspect-ratio: 21/9;
    min-height: 280px;
    background-size: cover;
    background-position: center;
  }
  @media (max-width: 700px){
    .hero-card .thumb { aspect-ratio: 16/9; min-height: 220px; }
  }

/* Prose */
.prose h1 { font-size: clamp(28px, 4.5vw, 40px); margin-top: 0; }
.prose h2 { margin-top: 28px; }
.prose p { margin: 12px 0; }
.prose blockquote { margin: 16px 0; padding: 12px 16px; background: var(--bg-elev); border-left: 3px solid var(--accent); border-radius: 8px; color: color-mix(in oklab, var(--text), white 10%); }
.prose img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }

.contact-form { display: grid; gap: 12px; margin-top: 12px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); }
.btn { background: var(--primary); color: white; border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; }

  /* Footer */
  .site-footer { padding-top: 24px; padding-bottom: 32px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .link-list { list-style: none; padding: 0; margin: 0; }
  .link-list li { margin: 6px 0; }
  .footer-meta { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }

  /* Chips */
  .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
  .chip.active { background: var(--primary); color: white; border-color: transparent; }
  .chip:hover { filter: brightness(1.05); }

  /* Searchbar */
  .searchbar { margin-bottom: 10px; }
  .searchbar input[type="search"] {
    width: min(480px, 100%);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--text);
    outline: none;
  }
  .searchbar input[type="search"]::placeholder { color: var(--muted); }

  /* Helpers */
  .muted { color: var(--muted); }