/* ========== Reset & base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Backgrounds */
  --bg: #08090a;
  --surface: #0f1011;
  --surface-elevated: #191a1b;
  --surface-secondary: #28282c;

  /* Text */
  --text: #f7f8f8;
  --text-secondary: #d0d6e0;
  --text-muted: #8a8f98;
  --text-subtle: #62666d;

  /* Brand */
  --accent: #5e6ad2;
  --accent-bright: #7170ff;
  --accent-hover: #828fff;

  /* Borders */
  --border: rgba(255,255,255,0.08);
  --border-subtle: rgba(255,255,255,0.05);
  --border-solid: #23252a;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --font-features: "cv01", "ss03";

  /* Radius */
  --radius: 6px;
  --card-radius: 8px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-feature-settings: var(--font-features);
  background: var(--bg);
  color: var(--text-secondary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
img { display: block; max-width: 100%; height: auto; }

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 0 1.5rem;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-weight: 510;
  font-size: 0.9375rem;
  letter-spacing: -0.165px;
  color: var(--text);
}
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a {
  font-size: 0.8125rem;
  font-weight: 510;
  color: var(--text-secondary);
  letter-spacing: -0.13px;
}
.site-nav a:hover { color: var(--text); }

/* ========== Filter bar ========== */
.filter-bar {
  position: sticky;
  top: 56px;
  background: var(--bg);
  z-index: 90;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid var(--border-solid);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 510;
  font-family: var(--font);
  font-feature-settings: var(--font-features);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.filter-chip:hover { color: var(--text); border-color: rgba(255,255,255,0.14); }
.filter-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ========== Product feed grid ========== */
.feed-page { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }

.product-feed {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) { .product-feed { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .product-feed { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } }
@media (max-width: 480px)  { .product-feed { grid-template-columns: 1fr; } }

/* ========== Product card ========== */
.product-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.product-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}

.card-image {
  aspect-ratio: 4/3;
  background: var(--surface-elevated);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-size: 0.6875rem;
  font-weight: 510;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product-card:hover .card-image img { transform: scale(1.03); }

.card-body {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-category {
  font-size: 0.6875rem;
  font-weight: 510;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 590;
  line-height: 1.3;
  letter-spacing: -0.165px;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.card-price {
  font-size: 0.8125rem;
  font-weight: 510;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.card-hook {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  letter-spacing: -0.165px;
  flex: 1;
}
.card-footer {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.card-link-editorial {
  font-size: 0.75rem;
  font-weight: 510;
  color: var(--accent-bright);
}
.card-link-editorial:hover { color: var(--accent-hover); }

/* ========== Loading indicator ========== */
.feed-sentinel { height: 1px; }
.feed-loading {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem;
}
.loading-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-subtle);
  animation: blink 1.2s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }

/* ========== Single page (article / product detail) ========== */
.single-page {
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 2rem;
  font-weight: 510;
  line-height: 1.13;
  letter-spacing: -0.704px;
  color: var(--text);
}
.category-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 510;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}
.price-range { font-size: 1rem; font-weight: 510; color: var(--text-muted); margin-top: 0.5rem; }
.page-header time { font-size: 0.875rem; color: var(--text-subtle); display: block; margin-top: 0.5rem; }
.hook-line {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.60;
  letter-spacing: -0.165px;
}
.product-image {
  margin-bottom: 2rem;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: rgba(0,0,0,0.4) 0px 2px 4px;
}
.page-content { color: var(--text-secondary); }
.page-content h2 {
  font-size: 1.25rem;
  font-weight: 510;
  letter-spacing: -0.288px;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}
.page-content h3 {
  font-size: 1.0625rem;
  font-weight: 590;
  letter-spacing: -0.24px;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.page-content p { margin-bottom: 1.25rem; line-height: 1.65; }
.page-content ul, .page-content ol { margin: 0 0 1.25rem 1.5rem; }
.page-content li { margin-bottom: 0.35rem; }
.page-content a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(113,112,255,0.35);
}
.page-content a:hover { color: var(--accent-hover); text-decoration-color: var(--accent-hover); }
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--text);
}
.page-content pre {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.page-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}
.page-content blockquote {
  border-left: 2px solid var(--accent);
  margin: 0 0 1.25rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}
.page-content th {
  text-align: left;
  font-weight: 510;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  letter-spacing: -0.13px;
}
.page-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.page-content tr:last-child td { border-bottom: none; }

.buy-section {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
}
.btn-buy {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 510;
  letter-spacing: -0.165px;
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}
.btn-buy:hover { background: var(--accent-hover); color: #ffffff; }
.disclosure-inline { font-size: 0.75rem; color: var(--text-subtle); }
.editorial-link { margin-top: 2rem; }
.editorial-link a { font-size: 0.9375rem; font-weight: 510; color: var(--accent-bright); }
.editorial-link a:hover { color: var(--accent-hover); }

/* ========== Newsletter section ========== */
.newsletter-section {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 1.5rem;
}
.newsletter-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}
.newsletter-copy { flex: 1; min-width: 200px; }
.newsletter-copy h3 {
  font-size: 1.0625rem;
  font-weight: 590;
  color: var(--text);
  letter-spacing: -0.24px;
  margin-bottom: 0.35rem;
}
.newsletter-copy p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.55; }
.newsletter-form { flex: 2; min-width: 260px; }
.newsletter-fields { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.newsletter-fields input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: var(--font);
  font-feature-settings: var(--font-features);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  outline: none;
}
.newsletter-fields input[type="email"]::placeholder { color: var(--text-subtle); }
.newsletter-fields input[type="email"]:focus { border-color: rgba(255,255,255,0.16); }
.newsletter-fields button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 510;
  font-family: var(--font);
  font-feature-settings: var(--font-features);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.newsletter-fields button:hover { background: var(--accent-hover); }
.newsletter-note { font-size: 0.75rem; color: var(--text-subtle); }

/* ========== Footer ========== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  background: var(--surface);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.affiliate-disclosure {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.footer-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}
.footer-links a { color: var(--text-muted); font-weight: 510; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 0.75rem; color: var(--text-subtle); }

/* ========== List page ========== */
.list-page { max-width: 720px; margin: 3rem auto; padding: 0 1.5rem; }
.list-page h1 {
  font-size: 2rem;
  font-weight: 510;
  letter-spacing: -0.704px;
  color: var(--text);
  margin-bottom: 2rem;
}
.page-list { list-style: none; }
.page-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
}
.page-list a { font-size: 0.9375rem; font-weight: 510; color: var(--text-secondary); }
.page-list a:hover { color: var(--text); }
.page-list time { font-size: 0.8125rem; color: var(--text-subtle); white-space: nowrap; }

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .site-header { padding: 0 1rem; }
  .filter-bar { padding: 0.625rem 1rem; }
  .feed-page { padding: 1rem; }
  .single-page { margin: 2rem auto; padding: 0 1rem; }
  .list-page { margin: 2rem auto; padding: 0 1rem; }
  .newsletter-inner { gap: 1.5rem; }
  .newsletter-section { padding: 2rem 1rem; }
  .site-footer { padding: 1.5rem 1rem; }
}
