/* ================================================================
   Story Based Hub — "Printed Matter" Design System
   ================================================================
   Concept : The Typographer's Workshop — editorial, literary studio
   Fonts   : Fraunces (quirky optical-size serif) + Outfit (geometric)
   Palette :
     --primary:   #D94A38  rust red         ← accents, CTA, chapter marks
     --secondary: #2A363B  dark charcoal    ← header icon, footer bg
     --accent:    #99B898  sage green       ← tags, badges, highlights
     --bg:        #FDFBF7  warm off-white   ← page background
     --text:      #2C2C2C  near-black       ← body text

   Unique Feature : CSS auto-counter "chapter marks" on .article-body h2
                    — every H2 shows its chapter number as a small
                      rust-red label, giving a literary book-chapter feel.
                    + blinking cursor on hero H1 (pure CSS keyframe)
                    + thin rust-red reading-progress bar on article pages
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Outfit:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #D94A38;
  --primary-dk: #b83828;
  --primary-lt: rgba(217,74,56,0.08);
  --secondary:  #2A363B;
  --secondary-lt: rgba(42,54,59,0.07);
  --accent:     #99B898;
  --accent-lt:  rgba(153,184,152,0.15);
  --bg:         #FDFBF7;
  --bg-tinted:  #F5F3EE;
  --white:      #ffffff;
  --text:       #2C2C2C;
  --text-muted: rgba(44,44,44,0.55);
  --border:     rgba(44,44,44,0.1);
  --border-light: rgba(44,44,44,0.06);
  --shadow-sm:  0 2px 10px rgba(42,54,59,0.07);
  --shadow:     0 6px 28px rgba(42,54,59,0.1);
  --shadow-card: 0 2px 16px rgba(42,54,59,0.07);
  --max-w:      1200px;
  --header-h:   64px;
  --r:          6px;
  --r-sm:       3px;
  --t:          0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── LAYOUT ── */
.wrapper {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.text-content {
  max-width: 780px;
  margin-inline: auto;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 500; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 500; }

p { margin-bottom: 1.25rem; color: var(--text); }
p:last-child { margin-bottom: 0; }

/* ── SHARED COMPONENTS ── */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background var(--t), transform var(--t);
}
.btn-primary:hover {
  background: var(--primary-dk);
  transform: translateY(-2px);
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.tag-primary { background: var(--primary-lt); color: var(--primary); }
.tag-accent  { background: var(--accent-lt);  color: #4d7a5a; }
.tag-secondary { background: var(--secondary-lt); color: var(--secondary); }

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  border-top: 3px solid var(--primary);
  box-shadow: 0 1px 0 var(--border-light);
  transition: box-shadow var(--t);
}
.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(42,54,59,0.1);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 40px; width: auto; max-width: 200px; }

.nav-desktop { margin-left: auto; }
.nav-list {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav-list a {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  transition: color var(--t);
  position: relative;
}
.nav-list a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-list a:hover,
.nav-list a.active {
  color: var(--text);
}
.nav-list a:hover::after,
.nav-list a.active::after {
  transform: scaleX(1);
}

/* ── BURGER ── */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  margin-left: auto;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none;
  background: var(--white);
  border-bottom: 2px solid var(--primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: var(--header-h);
  z-index: 99;
}
.mobile-nav.open { display: block; }
.mobile-nav ul {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav a {
  display: block;
  padding: 0.6rem 0.5rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: color var(--t);
}
.mobile-nav a:hover { color: var(--primary); }

/* ── READING PROGRESS BAR ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--primary);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ── HERO SECTION ── */
.hero-section {
  background: var(--bg);
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(2.5rem, 6vw, 5rem);
  overflow: hidden;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  max-width: 700px;
}

.hero-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-content h1 {
  font-style: italic;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  position: relative;
}

/* Blinking cursor — unique feature */
.hero-cursor {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background: var(--primary);
  margin-left: 0.15em;
  vertical-align: middle;
  border-radius: 1px;
  animation: blink-cursor 1.1s step-end infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.65;
}

/* Decorative pilcrow mark — editorial, purely visual */
.hero-deco {
  font-family: 'Fraunces', serif;
  font-size: clamp(120px, 16vw, 240px);
  color: var(--primary);
  opacity: 0.06;
  line-height: 0.9;
  user-select: none;
  flex-shrink: 0;
  padding-right: 2rem;
}
.hero-deco::after { content: '¶'; }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  background: var(--secondary);
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.015) 20px,
    rgba(255,255,255,0.015) 21px
  );
}
.page-hero h1 {
  color: var(--white);
  position: relative;
}
.page-hero-sub {
  color: rgba(255,255,255,0.6);
  margin-top: 1rem;
  font-size: 1rem;
  position: relative;
}

/* ── INTRO SECTION ── */
.intro-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--border-light);
}

.intro-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Article images inside content */
.article-img {
  width: 100%;
  max-width: 680px;
  height: auto;
  border-radius: var(--r);
  margin: 2rem auto;
  display: block;
  border: 1px solid var(--border-light);
}

/* ── ADDING SECTION (Anatomy of a Message) ── */
.adding-section-bg {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  background: var(--accent-lt);
  border-top: 1px solid rgba(153,184,152,0.3);
  border-bottom: 1px solid rgba(153,184,152,0.3);
}

.adding-section h2 {
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--secondary);
}
.adding-section > p {
  text-align: center;
  max-width: 580px;
  margin: 0 auto 3rem;
  color: var(--text-muted);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.principle-card {
  background: var(--white);
  border-radius: var(--r);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(153,184,152,0.2);
  transition: transform var(--t), box-shadow var(--t);
}
.principle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.principle-img-wrap {
  margin-bottom: 1.25rem;
}
.principle-img-wrap img,
.adding-img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--r-sm);
}

.principle-body h3 {
  font-size: 1.05rem;
  color: var(--secondary);
  margin-bottom: 0.6rem;
}
.principle-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── SLIDER SECTION ── */
.slider-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

.slider-section-wrap h2 {
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--secondary);
}

.slider-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

.slider-container {
  overflow: hidden;
  border-radius: var(--r);
  border: 1px solid var(--border-light);
  background: var(--bg-tinted);
  position: relative;
}

.slider-track {
  display: flex;
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.55, 1);
  will-change: transform;
}

.slider-img {
  width: 400px;
  height: 300px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 1rem;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1.25rem;
}
.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--t), transform var(--t);
  cursor: default;
}
.slider-dot.active {
  background: var(--primary);
  transform: scale(1.4);
}

/* ── FAQ SECTION ── */
.faq-section-bg {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-tinted);
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--secondary);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.faq-item {
  background: var(--white);
  border-radius: var(--r);
  padding: 1.75rem;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-card);
  transition: transform var(--t);
}
.faq-item:hover {
  transform: translateY(-3px);
}

.faq-item h3 {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.faq-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── ARTICLES PREVIEW / ARTICLES PAGE ── */
.articles-preview-section {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  border-top: 1px solid var(--border-light);
}

.articles-main-section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-header h2 { color: var(--secondary); }

.see-all-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--primary);
  transition: gap var(--t);
  white-space: nowrap;
}
.see-all-link:hover { text-decoration: underline; }

.article-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.article-cards-full {
  grid-template-columns: repeat(3, 1fr);
}

.article-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  transition: transform var(--t), box-shadow var(--t);
  border: 1px solid var(--border-light);
}

/* Left border fill — unique hover effect */
.article-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 0;
  background: var(--primary);
  transition: height 0.35s ease;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.article-card:hover::before { height: 100%; }

.article-card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.article-card-meta {
  margin-bottom: 0.75rem;
}
.read-time {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent-lt);
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
}

.article-card-title {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
.article-card-title a {
  color: var(--secondary);
  transition: color var(--t);
}
.article-card-title a:hover { color: var(--primary); }

.article-card-excerpt {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.read-more-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  transition: color var(--t), gap var(--t);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.read-more-link:hover { color: var(--primary-dk); gap: 0.5rem; }

/* ── ARTICLE PAGE ── */
.article-page { padding: 2rem 0 4rem; }

.article-back-link {
  margin-bottom: 2rem;
}
.article-back-link a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  transition: color var(--t);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.article-back-link a:hover { color: var(--primary-dk); }

.article-badge {
  display: inline-block;
  background: var(--accent-lt);
  color: #4d7a5a;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.8rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-light);
}
.article-header h1 {
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--secondary);
}
.article-meta-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.read-time-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--secondary-lt);
  padding: 0.3rem 0.85rem;
  border-radius: 2rem;
}

/* Article body with chapter counter — main unique feature */
.article-body {
  counter-reset: chapter;
}
.article-body h2 {
  counter-increment: chapter;
  margin-top: 2.75rem;
  margin-bottom: 1.1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  color: var(--secondary);
  position: relative;
}
.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.article-body h2::before {
  content: counter(chapter, decimal-leading-zero);
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  opacity: 0.75;
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--text);
  margin-bottom: 1.3rem;
}

.article-body .article-img {
  margin: 2.5rem auto;
}

/* ── ABOUT PAGE ── */
.about-stats-section {
  background: var(--primary);
  padding: 2.5rem 0;
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  color: var(--white);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  text-align: center;
}

.about-text-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.about-content p {
  font-size: 1.05rem;
  line-height: 1.82;
  margin-bottom: 1.75rem;
}
.about-content p:first-of-type::first-letter {
  font-family: 'Fraunces', serif;
  font-size: 3.5em;
  font-style: italic;
  color: var(--primary);
  float: left;
  line-height: 0.75;
  margin-right: 0.1em;
  margin-top: 0.08em;
}

.about-values-section {
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
  background: var(--bg-tinted);
  border-top: 1px solid var(--border-light);
}
.section-title {
  text-align: center;
  color: var(--secondary);
  margin-bottom: 2.5rem;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.value-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--r);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--t), transform var(--t);
}
.value-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}
.value-icon {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1;
}
.value-card h3 {
  color: var(--secondary);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.value-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--secondary);
  padding: 3rem 0 2rem;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: start;
}

.footer-brand {}
.footer-logo-link { display: inline-block; margin-bottom: 0.75rem; }
.footer-logo-img {
  height: 38px;
  width: auto;
  max-width: 180px;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}
.footer-tagline {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin-bottom: 0;
  max-width: 220px;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}
.footer-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: color var(--t);
  padding: 0.2rem 0;
}
.footer-nav a:hover { color: var(--accent); }

.footer-copy {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-copy p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .article-cards-grid,
  .article-cards-full {
    grid-template-columns: repeat(2, 1fr);
  }
  .principles-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-deco { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .burger { display: flex; }

  .article-cards-grid,
  .article-cards-full {
    grid-template-columns: 1fr;
  }

  .principles-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .about-stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  .footer-copy { grid-column: 1; }
  .footer-nav ul { align-items: center; }
  .footer-tagline { margin: 0 auto; }

  .slider-img { width: 280px; height: 210px; }

  .article-body h2 { margin-top: 2rem; padding-top: 1.5rem; }

  .about-content p:first-of-type::first-letter { font-size: 2.8em; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  .page-hero { padding: 2rem 0; }
  .slider-img { width: 240px; height: 180px; }
}
