/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* color */
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #14161a;
  --muted: #6b6e76;
  --line: #e1dfd5;

  --accent: #2f3ee0; /* indigo — primary interactive accent */
  --accent-ink: #ffffff;
  --cat-product: #c9603c; /* clay */
  --cat-research: #2f3ee0; /* indigo */
  --cat-safety: #3e7a5c; /* moss */
  --cat-company: #545b70; /* slate */

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* layout */
  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1320px;
  --radius: 2px;
}

/* ============================================================
   Dark theme — toggled via data-theme="dark" on <html>
   ============================================================ */
[data-theme="dark"] {
  --paper: #14161a;
  --surface: #1d2026;
  --ink: #f1f0ec;
  --muted: #9a9ca6;
  --line: #2c2f37;

  --accent: #7c87ff;
  --accent-ink: #14161a;
  --cat-product: #e39169;
  --cat-research: #7c87ff;
  --cat-safety: #6fbf93;
  --cat-company: #a7acc0;
}

[data-theme="dark"] .site-header {
  background: rgba(20, 22, 26, 0.86);
}

[data-theme="dark"] .featured__number {
  background: rgba(246, 245, 241, 0.86);
  color: var(--paper);
}

/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
button {
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow .dot {
  color: var(--line);
}

/* category color dots reused across cards + tags */
.tag-product {
  color: var(--cat-product);
}
.tag-research {
  color: var(--cat-research);
}
.tag-safety {
  color: var(--cat-safety);
}
.tag-company {
  color: var(--cat-company);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 245, 241, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

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

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover::after,
.main-nav a.is-current::after {
  transform: scaleX(1);
}

.nav-cta {
  border: 1px solid var(--ink);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.nav-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-toggle {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
  flex-shrink: 0;
}

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

.theme-toggle .icon-moon {
  display: block;
}
.theme-toggle .icon-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

@media (max-width: 780px) {
  .main-nav {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
}

/* ============================================================
   Page intro (news section)
   ============================================================ */
.page-intro {
  padding: 56px 0 28px;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
}

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

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
  position: sticky;
  top: 68px;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

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

.filter-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.result-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   Featured post
   ============================================================ */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: 40px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.featured__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--line);
}

.featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.featured:hover .featured__media img {
  transform: scale(1.03);
}

.featured__number {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: rgba(20, 22, 26, 0.72);
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.featured__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.featured__excerpt {
  color: var(--muted);
  font-size: 16px;
  max-width: 52ch;
}

.featured__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   Post grid + cards
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
  padding: 40px 0;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.2s ease;
}

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

.post-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--line);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.post-card:hover .post-card__media img {
  transform: scale(1.045);
}

.post-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.post-card__excerpt {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ============================================================
   Load more
   ============================================================ */
.load-more {
  display: flex;
  justify-content: center;
  padding: 12px 0 72px;
}

.load-more a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  border: 1px solid var(--ink);
  padding: 12px 30px;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.load-more a:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ============================================================
   Single post
   ============================================================ */
.post-hero {
  padding: 48px 0 0;
}

.post-hero__meta {
  margin-bottom: 20px;
}

.post-hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin: 0 0 20px;
}

.post-hero__dek {
  max-width: 56ch;
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 32px;
}

.post-hero__media {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 8px;
}

.post-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 0 40px;
  font-size: 18px;
  line-height: 1.7;
}

.post-body h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-top: 2.2em;
}

.post-body p {
  margin: 0 0 1.4em;
}
.post-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.post-body blockquote {
  border-left: 2px solid var(--ink);
  margin: 2em 0;
  padding-left: 24px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
}

.post-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 0 80px;
  border-top: 1px solid var(--line);
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

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

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 10px;
}

.footer-tagline {
  color: var(--muted);
  font-size: 14px;
  max-width: 26ch;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 500;
}

.footer-col li {
  margin-bottom: 10px;
  font-size: 14px;
}
.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-social {
  display: flex;
  gap: 16px;
}
.footer-social a:hover {
  color: var(--accent);
}

/* ============================================================
   Home page (landing)
   ============================================================ */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 16ch;
  margin: 0 0 24px;
}

.hero p {
  max-width: 48ch;
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 32px;
}

.hero-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--ink);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 56px 0 8px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}

.section-heading a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.section-heading a:hover {
  color: var(--accent);
}

/* ============================================================
   Product page
   ============================================================ */
.product-list {
  padding: 24px 0 64px;
}

.product-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 32px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.product-item:last-child {
  border-bottom: 1px solid var(--line);
}

.product-item__index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  padding-top: 4px;
}

.product-item__body {
  max-width: 68ch;
}

.product-item__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
  margin: 10px 0 8px;
}

.product-item__tagline {
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 16px;
}

.product-item__description {
  color: var(--muted);
  font-size: 16px;
  margin: 0 0 20px;
}

.product-item__features {
  display: grid;
  gap: 10px;
}

.product-item__features li {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--ink);
  padding-left: 18px;
  position: relative;
}

.product-item__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

@media (max-width: 620px) {
  .product-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
