/* while.chat — Editorial Blog Stylesheet v2 */

:root {
  --espresso:    #1a1410;
  --dark-roast:  #2c2218;
  --medium-roast:#4a3728;
  --crema:       #c4a882;
  --latte:       #e8ddd0;
  --oat-milk:    #f4efe8;
  --foam:        #faf8f5;
  --white:       #fff;
  --accent:      #8b6914;
  --text:        #2c2218;
  --text-light:  #6b5b4e;
  --border:      #e0d5c8;
  --r:           6px;

  /* Animation timings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 18px; }

body {
  font-family: 'Source Serif 4', 'Georgia', serif;
  background: var(--foam);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ═══ READING PROGRESS BAR ═══ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--crema);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
}

/* ═══ NAV ═══ */
.nav {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.4s var(--ease-out-expo),
              border-color 0.4s var(--ease-out-expo),
              backdrop-filter 0.4s;
}
.nav.scrolled {
  background: rgba(250, 248, 245, 0.92);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--espresso);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: opacity 0.25s;
}
.nav-brand:hover { opacity: 0.7; }
.nav-brand span { color: var(--crema); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--espresso);
  transition: width 0.3s var(--ease-out-expo);
}
.nav-links a:hover { color: var(--espresso); }
.nav-links a:hover::after { width: 100%; }

/* ═══ HERO ═══ */
.hero {
  padding: 110px 40px 90px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--border));
}
.hero-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--crema);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s var(--ease-out-expo) forwards;
}
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--espresso);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s var(--ease-out-expo) forwards;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.85;
  opacity: 0;
  animation: fadeUp 0.8s 0.35s var(--ease-out-expo) forwards;
}

/* ═══ CATEGORY PILLS ═══ */
.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 40px 72px;
  max-width: 840px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s var(--ease-out-expo) forwards;
}
.cat-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.25s var(--ease-spring);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--espresso);
  color: var(--foam);
  border-color: var(--espresso);
  transform: translateY(-1px);
}

/* ═══ SECTION DIVIDER ═══ */
.section-label {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.section-label span {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--crema);
  white-space: nowrap;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══ ARTICLE GRID ═══ */
.articles {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px 100px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Scroll-reveal base state */
.article-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  position: relative;
  /* Scroll reveal: start hidden */
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s var(--ease-out-expo),
    transform 0.6s var(--ease-out-expo);
}
.article-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Left accent line on hover */
.article-card::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 44px;
  bottom: 44px;
  width: 2px;
  background: var(--crema);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease-out-expo);
  border-radius: 1px;
}
.article-card:hover::before { transform: scaleY(1); }

.article-card:hover { transform: translateX(6px); }
.article-card:hover.visible { transform: translateX(6px); }

.article-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--crema);
  display: flex;
  gap: 16px;
  align-items: center;
}
.article-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--crema);
  border-radius: 50%;
  flex-shrink: 0;
}
.article-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.28;
  color: var(--espresso);
  transition: color 0.25s;
}
.article-card:hover h2 { color: var(--medium-roast); }

.article-card .excerpt {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.75;
  max-width: 640px;
}

/* Read more indicator */
.article-card .read-more {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--crema);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  transition: gap 0.3s var(--ease-spring);
}
.article-card:hover .read-more { gap: 14px; }
.read-more-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}
.article-card:hover .read-more-arrow { transform: translateX(4px); }

/* ═══ ARTICLE PAGE ═══ */
.article-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 40px 48px;
  text-align: center;
}
.article-header .cat {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--crema);
  margin-bottom: 20px;
}
.article-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--espresso);
  margin-bottom: 24px;
}
.article-header .meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.article-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 40px 110px;
}
.article-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--espresso);
  margin: 52px 0 16px;
}
.article-content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--medium-roast);
  margin: 36px 0 12px;
}
.article-content h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--medium-roast);
  margin: 28px 0 8px;
}
.article-content p {
  margin-bottom: 22px;
  font-size: 1rem;
  line-height: 1.85;
}
.article-content em  { font-style: italic; }
.article-content strong { font-weight: 700; color: var(--espresso); }
.article-content ul, .article-content ol {
  margin: 16px 0 22px 24px;
}
.article-content li { margin-bottom: 9px; line-height: 1.75; }
.article-content blockquote {
  border-left: 3px solid var(--crema);
  padding: 14px 24px;
  margin: 28px 0;
  font-style: italic;
  color: var(--text-light);
  background: var(--oat-milk);
  border-radius: 0 var(--r) var(--r) 0;
}
.article-content .highlight-box {
  background: var(--oat-milk);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin: 28px 0;
}
.article-content .sources {
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}
.article-content .sources h3 { margin-top: 0; }

/* ═══ BACK LINK ═══ */
.back-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  text-decoration: none;
  padding: 44px 40px 0;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s, gap 0.3s var(--ease-spring);
}
.back-link:hover { color: var(--espresso); gap: 14px; }

/* ═══ FOOTER ═══ */
.footer {
  padding: 56px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--espresso);
  margin-bottom: 12px;
}
.footer p {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
}
.footer-links {
  margin-top: 18px;
  display: flex;
  gap: 24px;
  justify-content: center;
}
.footer-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.25s;
}
.footer-links a:hover { color: var(--espresso); }

/* ═══ KEYFRAMES ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .nav { padding: 16px 20px; }
  .nav-links { gap: 16px; }
  .hero { padding: 70px 20px 50px; }
  .categories { padding: 0 20px 48px; }
  .section-label { padding: 0 20px 24px; }
  .articles { padding: 0 20px 70px; }
  .article-card::before { display: none; }
  .article-card:hover { transform: none; }
  .article-card:hover.visible { transform: none; }
  .article-header { padding: 60px 20px 36px; }
  .article-content { padding: 36px 20px 80px; }
  .back-link { padding: 32px 20px 0; }
  .footer { padding: 44px 20px; }
}
