/*
 * Hitori Tech Blog — hitoritech.css
 * Design System: Design-for-AI SKILL.md (Design for Hackers by David Kadavy)
 *
 * Principles applied:
 *  - Purpose-driven: every decision serves trust + readability
 *  - Proportional type scale (3:4 ratio, base 16px), fluid via clamp()
 *  - Two font families max: Plus Jakarta Sans (headings) + Inter (body)
 *  - Palette: off-white bg, deep navy text, clean blue accent (no AI gradient clichés)
 *  - Warm/cool depth: warm navy advances, cool border recedes
 *  - Hue-shifted shadows (navy-tinted, not pure black)
 *  - Mobile-first, content-driven breakpoints
 *  - All interactive states: hover, focus-visible, active, disabled
 *  - Motion: state-driven only (150ms micro, 250ms standard, 350ms complex)
 *  - SEO: semantic HTML throughout, proper heading hierarchy
 */

/* =============================================================================
   RESET (minimal — supplements global.css)
   ============================================================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* =============================================================================
   DESIGN TOKENS
   ============================================================================= */

:root {
  /* --- Color Palette ---
   * Warm/cool relationship: navy text advances, slate muted recedes
   * Accent: clean corporate blue — not AI-cyan, not purple
   */
  --color-bg:               #F8FAFC;
  --color-surface:          #FFFFFF;
  --color-surface-2:        #F1F5F9;
  --color-border:           #E2E8F0;
  --color-border-subtle:    #F1F5F9;

  --color-text:             #0F172A;
  --color-text-secondary:   #475569;
  --color-text-muted:       #94A3B8;

  --color-accent:           #2b1392;
  --color-accent-hover:     #230f7a;
  --color-accent-active:    #1a0b61;
  --color-accent-light:     #eeebff;
  --color-accent-ring:      rgba(29, 108, 232, 0.22);

  /* Functional colors */
  --color-success:          #16A34A;
  --color-warning:          #CA8A04;
  --color-error:            #DC2626;

  /* --- Typography ---
   * Max two families: heading + body
   * Both humanist sans — compatible letter structures, clear on screen
   */
  /* Inter — humanist sans, consistent at every weight on screen */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Menlo, Courier, monospace;

  /* --- Type Scale (3:4 modular, fluid with clamp) ---
   * Steps: 12 → 14 → 16 → 18 → 21 → 28 → 37 → 50 → 67
   */
  /* Fluid type scale — spec-accurate (320px → 1920px viewport)
   * Body:  15px → 18px  |  H1: 34px → 72px
   * H2:    26px → 48px  |  H3: 20px → 32px
   * Formula: clamp(min, intercept + slope×vw, max)
   */
  --text-xs:   clamp(0.75rem,   0.7rem    + 0.125vw, 0.8125rem);  /* 12–13px — meta */
  --text-sm:   clamp(0.8125rem, 0.79rem   + 0.113vw, 0.875rem);  /* 13–14px */
  --text-base: clamp(0.9375rem, 0.884rem  + 0.268vw, 1.125rem);  /* 15–18px body */
  --text-md:   clamp(1rem,      0.95rem   + 0.25vw,  1.1875rem); /* 16–19px */
  --text-lg:   clamp(1.1875rem, 1.125rem  + 0.3125vw,1.375rem);  /* 19–22px — card titles */
  --text-xl:   clamp(1.25rem,   1.1rem    + 0.625vw, 1.625rem);  /* 20–26px */
  --text-2xl:  clamp(1.5rem,    1.25rem   + 1.25vw,  2.125rem);   /* 24–34px */
  --text-3xl:  clamp(1.625rem,  1.35rem   + 1.375vw, 3rem);       /* 26–48px — H2 */
  --text-4xl:  clamp(2.125rem,  1.65rem   + 2.375vw, 4.5rem);     /* 34–72px — H1 */
  --text-5xl:  clamp(2.75rem,   2.0rem    + 3.75vw,  5.25rem);    /* 44–84px — display */
  --text-h3:   clamp(1.25rem,   1.036rem  + 1.071vw, 2rem);       /* 20–32px — H3 */

  /* --- Spacing (proportional, golden-ratio influenced) --- */
  --space-1:   0.25rem;   /*  4px */
  --space-2:   0.5rem;    /*  8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */

  /* --- Layout — container widths per breakpoint tier --- */
  --max-width:          1120px;   /* laptop default (1024–1439px) */
  --max-width-desktop:  1440px;   /* desktop (1440–1919px) */
  --max-width-tv:       1600px;   /* TV / large (1920px+) */
  --content-width:      800px;    /* article reading column */
  --wide-width:         1040px;

  /* --- Fluid component tokens ---
   * section-gap:  48px (mobile) → 96px (desktop) → 120px (TV)
   * card-padding: 18px → 32px
   * card-gap:     20px → 40px
   * card-radius:  18px → 28px
   */
  --section-gap:  clamp(3rem,    2.1rem  + 4.5vw,   7.5rem);    /* 48–120px */
  --card-padding: clamp(1.125rem,0.875rem + 1.25vw,  2rem);      /* 18–32px  */
  --card-gap:     clamp(1.25rem, 0.893rem + 1.786vw, 2.5rem);   /* 20–40px  */
  --card-radius:  clamp(1.125rem,0.946rem + 0.893vw, 1.75rem);  /* 18–28px  */

  /* --- Border Radius --- */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* --- Shadows (hue-shifted to navy, not pure black — SKILL.md §Color) --- */
  --shadow-xs: 0 1px 2px  rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px  rgba(15, 23, 42, 0.07),  0 1px 2px  rgba(15, 23, 42, 0.04);
  --shadow:    0 4px 16px rgba(15, 23, 42, 0.09),  0 1px 4px  rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.11),  0 2px 6px  rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.13), 0 4px 10px rgba(15, 23, 42, 0.06);

  /* --- Motion (ease-out entries, ease-in exits — SKILL.md §Motion) --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.55, 0, 1, 0.45);
  --t-micro:  150ms var(--ease-out);
  --t-base:   250ms var(--ease-out);
  --t-slow:   350ms var(--ease-out);
}

/* =============================================================================
   BASE TYPOGRAPHY
   ============================================================================= */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
}

/* Heading hierarchy — size, weight, letter-spacing for dominance */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* Fluid headings: H1 34-72px, H2 26-48px, H3 20-32px */
h1 { font-size: var(--text-4xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
h3 { font-size: var(--text-h3);  font-weight: 700; line-height: 1.2; }
h4 { font-size: var(--text-xl);  font-weight: 600; }
h5 { font-size: var(--text-lg);  font-weight: 600; }
h6 { font-size: var(--text-md);  font-weight: 600; }

p {
  margin: 0 0 var(--space-5);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--t-micro);
}

a:hover { color: var(--color-accent-hover); }

/* Focus ring — clear, never hidden */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.viewport {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
}

/* Full-bleed section padding */
.outer {
  position: relative;
  padding-left:  max(4vmin, 20px);
  padding-right: max(4vmin, 20px);
}

/* Centered content container */
.inner {
  margin: 0 auto;
  max-width: var(--max-width);
  width: 100%;
}

/* Ghost content canvas (article body) */
.gh-canvas {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left:  max(4vmin, 20px);
  padding-right: max(4vmin, 20px);
}

/* =============================================================================
   READING PROGRESS BAR
   ============================================================================= */

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--color-accent);
  z-index: 9999;
  transition: width 80ms linear;
  pointer-events: none;
}

/* =============================================================================
   BUTTONS  (all states: default, hover, focus, active — SKILL.md §Interaction)
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.375rem;
  min-height: 44px; /* touch target */
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--t-micro),
    border-color     var(--t-micro),
    color            var(--t-micro),
    box-shadow       var(--t-micro),
    transform        var(--t-micro);
  user-select: none;
}

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

.btn:active {
  transform: translateY(1px);
}

/* Primary */
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
  box-shadow: 0 4px 14px var(--color-accent-ring);
}
.btn-primary:active {
  background: var(--color-accent-active);
  border-color: var(--color-accent-active);
}

/* Ghost / secondary */
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-surface);
  border-color: var(--color-text-secondary);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* =============================================================================
   SITE HEADER
   ============================================================================= */

.gh-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 max(4vmin, 20px);
  transition: box-shadow var(--t-base), height var(--t-base);
}

.gh-head-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
  height: 64px;
}

/* Brand / logo */
.gh-head-brand { flex-shrink: 0; }

.gh-head-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
}
.gh-head-logo img {
  height: 30px;
  width: auto;
}
.gh-head-logo-text,
.gh-head-logo strong {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}
.site-footer-logo strong {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

/* Nav */
.gh-head-menu {
  flex: 1;
  display: flex;
  align-items: center;
}

/* Ghost outputs <ul class="nav"> */
.gh-head-menu .nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gh-head-menu .nav li a {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--t-micro), background-color var(--t-micro);
  text-decoration: none;
}
.gh-head-menu .nav li a:hover {
  color: var(--color-text);
  background: var(--color-border-subtle);
}
.gh-head-menu .nav-current a {
  color: var(--color-text);
  font-weight: 600;
}

/* Right side actions */
.gh-head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.gh-head-members {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.gh-head-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--t-micro);
}
.gh-head-link:hover { color: var(--color-text); }

/* Header buttons */
.gh-head-btn {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.5rem 1rem;
  min-height: 36px;
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-micro);
}
.gh-head-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.gh-head-btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.gh-head-btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}
.gh-head-btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.gh-head-btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-secondary);
}
/* "Free Email Checker" CTA in header */
.gh-head-btn-cta {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
  font-size: 0.8125rem;
}
.gh-head-btn-cta:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Search icon button */
.gh-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--t-micro), background-color var(--t-micro);
}
.gh-icon-btn:hover {
  color: var(--color-text);
  background: var(--color-border-subtle);
}
.gh-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Hamburger */
.gh-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
}
.gh-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-micro);
}
.gh-head-open .gh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.gh-head-open .gh-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.gh-head-open .gh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Scrolled state — toggled by JS when scrollY > 20 */
.gh-head-scrolled {
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.09);
}

/* Logo icon — small rounded badge before wordmark */
.gh-head-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--color-accent);
  border-radius: 7px;
  margin-right: var(--space-2);
  flex-shrink: 0;
  transition: background var(--t-micro);
}
.gh-head-logo-icon svg {
  width: 13px;
  height: 13px;
}
.gh-head-logo:hover .gh-head-logo-icon {
  background: var(--color-accent-hover);
}

/* Mobile menu CTA wrap — hidden on desktop, shown inside open menu */
.gh-head-mobile-cta-wrap { display: none; }

/* =============================================================================
   HERO SECTION
   ============================================================================= */

.hero-section {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-20) max(4vmin, 20px) var(--space-16);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-16);
  max-width: var(--max-width);
  margin: 0 auto;
}

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

.hero-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);   /* 32–54px, capped at 54px */
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.hero-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-8);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Stats panel — right side of hero */
.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.hero-stat-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.hero-stat-card:first-child {
  grid-column: span 2;
  background: var(--color-accent-light);
  border-color: var(--color-accent-ring);
}
.hero-stat-number {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero-stat-card:first-child .hero-stat-number { color: var(--color-accent); }
.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* =============================================================================
   TOPIC CARDS
   ============================================================================= */

.topics-section {
  padding: var(--space-12) max(4vmin, 20px);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  box-sizing: border-box;
  min-width: 0;
  transition:
    border-color var(--t-micro),
    box-shadow   var(--t-micro),
    transform    var(--t-micro);
}
.topic-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.topic-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.topic-card-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.topic-card-arrow {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color var(--t-micro), transform var(--t-micro);
  flex-shrink: 0;
}
.topic-card:hover .topic-card-arrow {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* =============================================================================
   FEATURED SECTION  (Editor's Picks / Start Here)
   ============================================================================= */

.featured-section {
  padding: clamp(3rem, 6vw, 6.875rem) max(4vmin, 20px);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

/* Section header */
.section-header {
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}
.section-header .section-label {
  font-size: clamp(0.75rem, 0.5rem + 0.5vw, 0.875rem);
  margin-bottom: var(--space-2);
}
.section-header .section-heading {
    font-size: clamp(2rem, 4vw, 3rem);   /* 32–48px — capped at 48 */
  letter-spacing: -0.04em;
  margin-bottom: 0;
}

/* Main grid: hero 65% left + stacked cards 35% right */
.featured-grid {
  display: grid;
  grid-template-columns: 65fr 35fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(1.125rem, 2vw, 2rem);
  max-width: clamp(1120px, 88vw, 1600px);
  margin: 0 auto;
}

/* Hero card — spans both rows on the left */
.featured-card-hero {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: clamp(1.125rem, 2vw, 2rem);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.featured-card-hero:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}
.featured-card-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: var(--color-border-subtle);
  text-decoration: none;
  flex-shrink: 0;
}
.featured-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
  display: block;
}
.featured-card-hero:hover .featured-card-image { transform: scale(1.04); }

.featured-card-content {
  display: flex;
  flex-direction: column;
  padding: clamp(1.125rem, 2vw, 2rem);
  gap: var(--space-3);
  flex: 1;
}
.featured-card-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.2vw, 2.375rem);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card-title a {
  color: inherit;
  text-decoration: none;
}
.featured-card-title a:hover { color: var(--color-accent); }
.featured-card-excerpt {
  font-size: clamp(0.9375rem, 1vw, 1.125rem);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  margin-top: auto;
  padding-top: var(--space-3);
  transition: gap var(--t-micro), color var(--t-micro);
}
.featured-card-read-more:hover { gap: 0.55rem; color: var(--color-accent-hover); }
.featured-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: clamp(0.8125rem, 0.9vw, 1rem);
  color: var(--color-text-muted);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-2);
}

/* Small cards — stack in right column */
.featured-card-small {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: clamp(1.125rem, 2vw, 2rem);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.featured-card-small:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent);
}
.featured-card-small-img-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 6;
  background: var(--color-border-subtle);
  flex-shrink: 0;
}
.featured-card-small-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
  display: block;
}
.featured-card-small:hover .featured-card-small-img { transform: scale(1.04); }

.featured-card-small-content {
  display: flex;
  flex-direction: column;
  padding: clamp(0.875rem, 1.5vw, 1.5rem);
  gap: var(--space-2);
  flex: 1;
}
.featured-card-small-title {
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1.4vw, 1.5rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card-small-title a {
  color: inherit;
  text-decoration: none;
}
.featured-card-small-title a:hover { color: var(--color-accent); }
.featured-card-small-excerpt {
  font-size: clamp(0.8125rem, 0.9vw, 0.9375rem);
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card-small-date {
  font-size: clamp(0.75rem, 0.85vw, 0.875rem);
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: var(--space-2);
}

/* =============================================================================
   AUTHOR BOX  (below article body)
   ============================================================================= */

.author-box {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
}

.author-box-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  max-width: var(--content-width);
  margin: 0 auto;
}

.author-box-avatar {
  flex-shrink: 0;
  text-decoration: none;
}
.author-box-image {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--color-border);
  display: block;
}
.author-box-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-border-subtle);
  color: var(--color-text-muted);
}

.author-box-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.author-box-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0;
}
.author-box-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 0;
}
.author-box-name a {
  color: inherit;
  text-decoration: none;
}
.author-box-name a:hover { color: var(--color-accent); }
.author-box-bio {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: var(--space-1) 0 0;
  max-width: 60ch;
}
.author-box-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.author-box-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--t-micro);
}
.author-box-link:hover { text-decoration: underline; }

/* =============================================================================
   POSTS SECTION
   ============================================================================= */

.posts-section {
  padding: var(--section-gap) max(4vmin, 20px);
}

.section-heading {
  font-size: clamp(1.75rem, 0.75rem + 5vw, 3rem);   /* 28–48px */
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* Hide old Casper cover/site-header section */
.site-header-content { display: none; }

/* Post feed grid */
.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
  gap: var(--card-gap);
  margin-bottom: var(--space-10);
}

/* =============================================================================
   POST CARD  (editorial card style — SKILL.md §Composition: foreground/background depth)
   ============================================================================= */

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition:
    border-color var(--t-base),
    box-shadow   var(--t-base),
    transform    var(--t-base);
}
.post-card:hover {
  border-color: rgba(29, 108, 232, 0.30);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Feature image */
.post-card-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-border-subtle);
  text-decoration: none;
}
.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.post-card:hover .post-card-image { transform: scale(1.04); }

/* Card body */
.post-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--card-padding);
}
.post-card-content-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.post-card-header { margin-bottom: var(--space-3); }

/* Topic tag */
.post-card-tag,
.post-card-primary-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

/* Card title */
.post-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 0;
  transition: color var(--t-micro);
}
.post-card:hover .post-card-title { color: var(--color-accent); }

/* Excerpt — clamped to 3 lines */
.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-top: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer */
.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}
.post-card-date,
.post-card-meta-date,
.post-card-read-time,
.post-card-meta-length {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Lock icon for paid/members posts */
.post-card-access {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  gap: var(--space-2);
}

/* Featured tag */
.post-card-featured {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: var(--space-2);
}

/* =============================================================================
   PAGINATION
   ============================================================================= */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) 0 0;
  font-size: var(--text-sm);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all var(--t-micro);
}
.pagination a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.pagination .page-number {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* =============================================================================
   INLINE CTA BANNER (homepage)
   ============================================================================= */

.inline-cta {
  padding: var(--space-12) max(4vmin, 20px);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.inline-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-10);
  background: linear-gradient(130deg, var(--color-accent-light) 0%, #fff 70%);
  border: 1px solid rgba(29, 108, 232, 0.14);
  border-radius: var(--radius-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}
.inline-cta-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-2);
}
.inline-cta-text {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 55ch;
  margin: 0;
}

/* =============================================================================
   SINGLE ARTICLE
   ============================================================================= */

.site-main { flex: 1; }

.article { padding-bottom: var(--space-16); }

.article-header {
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
}

.article-tag {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.post-card-primary-tag a {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-accent);
  text-decoration: none;
}
.post-card-primary-tag a:hover { color: var(--color-accent-hover); }

.article-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);   /* 32–54px, capped at 54px */
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.article-excerpt {
  font-size: clamp(1.0625rem, 0.95rem + 0.5625vw, 1.25rem);   /* 17–20px */
  color: var(--color-text-secondary);
  line-height: 1.55;
  font-weight: 400;
  margin-bottom: var(--space-6);
  max-width: 66ch;
}

/* Byline */
.article-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
}
.article-byline-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.author-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}
.author-list-item { margin-right: -8px; }
.author-avatar {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-surface);
  overflow: hidden;
  background: var(--color-border-subtle);
}
.author-profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-byline-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.author-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.byline-meta-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.byline-meta-date,
.byline-reading-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.bull { color: var(--color-border); }

/* Feature image */
.article-image {
  margin: 0 0 var(--space-10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
}
.article-image img { width: 100%; height: auto; }
.article-image figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-2) var(--space-4);
  line-height: 1.5;
}

/* =============================================================================
   ARTICLE CONTENT (long-form reading — strong readability)
   ============================================================================= */

.gh-content { padding-bottom: var(--space-12); }

.gh-content p,
.gh-content ul,
.gh-content ol {
  font-size: var(--text-md);
  line-height: 1.78;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}
.gh-content li { margin-bottom: var(--space-2); }

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

/* Article body heading sizes — tighter range than page-level headings */
.gh-content h2 {
  font-size: clamp(2rem, 1.625rem + 1.875vw, 2.375rem);   /* 32–38px */
  line-height: 1.15;
}
.gh-content h3 {
  font-size: clamp(1.5rem, 1.25rem + 1.25vw, 1.75rem);    /* 24–28px */
  line-height: 1.2;
}
.gh-content h4 {
  font-size: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);   /* 18–22px */
}

.gh-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(29, 108, 232, 0.35);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--t-micro);
}
.gh-content a:hover { text-decoration-color: var(--color-accent); }

/* Prevent gh-content link color from bleeding into injected buttons */
.gh-content .btn {
  text-decoration: none;
}
.gh-content .btn-primary,
.gh-content .btn-primary:hover {
  color: #fff;
}
.gh-content .btn-ghost,
.gh-content .btn-ghost:hover {
  color: var(--color-text);
}

.gh-content blockquote {
  border-left: 3px solid var(--color-accent);
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--color-accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text);
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.12em 0.4em;
  color: var(--color-text);
}
.gh-content pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius);
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-6) 0;
  line-height: 1.6;
}
.gh-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-10) 0;
}

.gh-content img,
.gh-content figure {
  border-radius: var(--radius);
  margin: var(--space-8) 0;
}
.gh-content figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-2);
}

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--space-6) 0;
}
.gh-content th {
  background: var(--color-border-subtle);
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}
.gh-content td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: top;
}

/* =============================================================================
   TABLE OF CONTENTS  (auto-built by buildTOC() in hitoritech.js)
   Design: accent-bordered panel, proportional hierarchy, active tracking
   ============================================================================= */

.toc {
  margin: var(--space-8) auto var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  max-width: var(--content-width);
}

.toc-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

.toc-list,
.toc-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Collapsed sublists: hidden but animatable */
.toc-sublist {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
}
.toc-sublist-collapsed {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.toc-item {
  border-top: 1px solid var(--color-border-subtle);
  position: relative;
}
.toc-item:first-child { border-top: none; }

/* Toggle chevron button for H2 items with sub-sections */
.toc-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color var(--t-micro), transform var(--t-micro);
}
.toc-toggle:hover { color: var(--color-accent); }
.toc-toggle svg { transition: transform 0.2s ease; }
.toc-toggle.toc-toggle-open svg { transform: rotate(180deg); }

/* Sub-section count badge — shown when collapsed */
.toc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: var(--space-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-muted);
  background: var(--color-border-subtle);
  border-radius: 9px;
  vertical-align: middle;
}

.toc-link {
  display: block;
  padding: var(--space-2) 28px var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.45;
  transition: color var(--t-micro), padding-left var(--t-micro);
}
.toc-link:hover {
  color: var(--color-accent);
  padding-left: var(--space-2);
}
.toc-link-active {
  color: var(--color-accent);
  font-weight: 600;
}

/* H3 sub-items — indented, slightly smaller */
.toc-item-h3 .toc-link {
  padding-left: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.toc-item-h3 .toc-link:hover {
  padding-left: calc(var(--space-4) + var(--space-1));
  color: var(--color-accent);
}
.toc-item-h3 .toc-link-active {
  color: var(--color-accent);
  font-weight: 600;
}

.toc-sublist .toc-item {
  border-top: none;
}

/* =============================================================================
   POST CTA (inline in article body)
   ============================================================================= */

.post-cta {
  margin: var(--space-10) auto var(--space-4);
  width: 100%;
  max-width: var(--content-width);
  padding-left: max(4vmin, 20px);
  padding-right: max(4vmin, 20px);
  box-sizing: border-box;
}
.post-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-8) var(--space-8);
  background: var(--color-accent-light);
  border: 1px solid rgba(29, 108, 232, 0.18);
  border-radius: var(--radius-lg);
  width: 100%;
  box-sizing: border-box;
}
.post-cta-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.post-cta-text strong {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
}
.post-cta-text span {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* =============================================================================
   NEWSLETTER / GHOST MEMBERS CTA
   ============================================================================= */

.footer-cta {
  padding: var(--space-16) max(4vmin, 20px);
  background: #0F172A;
}
.footer-cta-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.footer-cta-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
}
.footer-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow var(--t-micro);
}
.footer-cta-button:hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.footer-cta-input {
  padding: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: var(--color-surface);
  min-width: 200px;
}
.footer-cta-button > span {
  display: inline-flex;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

/* =============================================================================
   NEWSLETTER SECTION (homepage + homepage variants)
   ============================================================================= */

.newsletter-section {
  padding: var(--section-gap) max(4vmin, 20px);
  background: #0F172A;
}

.newsletter-inner {
  display: grid;
  grid-template-columns: 3fr 2fr;
  align-items: center;
  gap: var(--space-12);
  max-width: var(--max-width);
  margin: 0 auto;
}

.newsletter-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #ffffff;
  margin-bottom: var(--space-3);
}

.newsletter-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.newsletter-text {
  font-size: var(--text-base);
  color: #94A3B8;
  line-height: 1.65;
  max-width: 50ch;
  margin: 0;
}

.newsletter-form-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.newsletter-cta-btn {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow var(--t-micro);
}
.newsletter-cta-btn:hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.newsletter-input-fake {
  flex: 1;
  padding: 0.75rem 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.newsletter-submit {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

.newsletter-note {
  font-size: var(--text-xs);
  color: #64748B;
  margin: 0;
}

.newsletter-btn-standalone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* =============================================================================
   RELATED POSTS / READ MORE
   ============================================================================= */

.read-more-wrap {
  padding: var(--space-12) max(4vmin, 20px) var(--space-8);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}
.read-more-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}
.read-more.post-feed { margin-bottom: 0; }

/* =============================================================================
   TAG ARCHIVE
   ============================================================================= */

.tag-header {
  padding: var(--space-12) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-10);
}
.tag-header-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.tag-header-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
}
.tag-header-description {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}

/* =============================================================================
   AUTHOR PROFILE
   ============================================================================= */

.author-header {
  padding: var(--space-12) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-10);
}
.author-header-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}
.author-header-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.author-header-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border-subtle);
  color: var(--color-text-muted);
}
.author-header-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.03em;
}
.author-header-bio {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-4);
  max-width: 55ch;
}
.author-header-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.author-header-location {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.author-header-social {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  gap: var(--space-1);
  transition: color var(--t-micro);
}
.author-header-social:hover { color: var(--color-accent); }
.author-header-social svg { width: 16px; height: 16px; }

/* =============================================================================
   STATIC PAGE
   ============================================================================= */

.article-page .article-header { padding-bottom: var(--space-6); }
.article-page .article-title  { margin-bottom: var(--space-4); }

/* =============================================================================
   ARTICLE COMMENTS
   ============================================================================= */

.article-comments {
  padding-top: var(--space-10);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-8);
}

/* =============================================================================
   SITE FOOTER
   ============================================================================= */

.site-footer {
  background: #0F172A;
  color: #CBD5E1;
  margin-top: auto;
}
.site-footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) max(4vmin, 20px) var(--space-10);
}
.site-footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.site-footer-logo {
  display: inline-flex;
  text-decoration: none;
}
.site-footer-logo img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}
.site-footer-logo span {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}
.site-footer-tagline {
  font-size: var(--text-sm);
  color: #64748B;
  line-height: 1.6;
  max-width: 28ch;
  margin: 0;
}
.site-footer-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748B;
  margin-bottom: var(--space-4);
}
.site-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.site-footer-col ul li a {
  font-size: var(--text-sm);
  color: #94A3B8;
  text-decoration: none;
  transition: color var(--t-micro);
}
.site-footer-col ul li a:hover { color: #fff; }

.site-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-5) max(4vmin, 20px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.site-footer-copyright {
  font-size: var(--text-xs);
  color: #475569;
  margin: 0;
}
.site-footer-copyright a { color: #64748B; }
.site-footer-copyright a:hover { color: #fff; }

.site-footer-nav-secondary .nav {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer-nav-secondary .nav li a {
  font-size: var(--text-xs);
  color: #475569;
  text-decoration: none;
  transition: color var(--t-micro);
}
.site-footer-nav-secondary .nav li a:hover { color: #94A3B8; }

/* =============================================================================
   GHOST EDITOR / KG CARDS SUPPORT
   ============================================================================= */

.kg-width-wide {
  max-width: var(--wide-width);
  margin-left: auto;
  margin-right: auto;
}
.kg-width-full {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.kg-image-card img,
.kg-gallery-card img { width: 100%; height: auto; }

.kg-gallery-container { display: flex; flex-direction: column; gap: var(--space-2); }
.kg-gallery-row { display: flex; gap: var(--space-2); }
.kg-gallery-image img { object-fit: cover; width: 100%; height: 100%; }

.kg-bookmark-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-6) 0;
}
.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}
.kg-bookmark-content { padding: var(--space-4); flex: 1; }
.kg-bookmark-title { font-weight: 600; color: var(--color-text); font-size: var(--text-sm); margin-bottom: var(--space-1); }
.kg-bookmark-description { font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.5; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-author,
.kg-bookmark-publisher { font-size: var(--text-xs); color: var(--color-text-muted); }
.kg-bookmark-thumbnail img { width: 140px; height: 100%; object-fit: cover; }

.kg-callout-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-accent-light);
  border: 1px solid rgba(29, 108, 232, 0.14);
  border-radius: var(--radius);
  margin: var(--space-6) 0;
}
.kg-callout-emoji { font-size: 1.25rem; flex-shrink: 0; }

.kg-video-card { position: relative; border-radius: var(--radius); overflow: hidden; margin: var(--space-6) 0; }
.kg-audio-card { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; padding: var(--space-4); margin: var(--space-6) 0; }
.kg-file-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); margin: var(--space-4) 0; }
.kg-file-card a { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); }

/* =============================================================================
   ERROR PAGES — Generic (error.hbs)
   ============================================================================= */

.error-template {
  padding: var(--space-24) max(4vmin, 20px);
  text-align: center;
}
.error-code {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 15vw, 9rem);
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-bottom: var(--space-4);
}
.error-title { font-size: var(--text-2xl); color: var(--color-text); margin-bottom: var(--space-4); }
.error-description { font-size: var(--text-md); color: var(--color-text-secondary); margin-bottom: var(--space-8); }

/* =============================================================================
   404 PAGE — Custom design
   ============================================================================= */

.error-404-section {
  position: relative;
  overflow: hidden;
  padding: var(--space-24) max(4vmin, 20px) var(--space-16);
  text-align: center;
  background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-color: var(--color-bg);
}

.error-404-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.error-404-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(29, 108, 232, 0.07) 0%, transparent 70%);
  border-radius: 50%;
}

.error-404-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  animation: error-404-rise 0.5s var(--ease-out) both;
}

@keyframes error-404-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.error-404-number {
  font-family: var(--font-heading);
  font-size: clamp(6rem, 4rem + 10vw, 12rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: transparent;
  background: linear-gradient(135deg, var(--color-accent) 0%, #4B93F5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  margin-bottom: var(--space-6);
  user-select: none;
}

.error-404-heading {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.error-404-body {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.error-404-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.error-404-topics-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.error-404-topic-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.error-404-topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background var(--t-micro), border-color var(--t-micro), color var(--t-micro), box-shadow var(--t-micro);
}
.error-404-topic-pill:hover {
  background: var(--color-accent-light);
  border-color: rgba(29, 108, 232, 0.35);
  color: var(--color-accent);
  box-shadow: var(--shadow-xs);
}
.error-404-topic-pill:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.error-404-posts {
  padding-top: var(--space-12);
  padding-bottom: var(--space-16);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.error-404-feed {
  margin-top: var(--space-8);
}

@media (max-width: 600px) {
  .error-404-section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-10);
  }
  .error-404-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .error-404-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================================================
   LIGHTBOX (PhotoSwipe — keep functional)
   ============================================================================= */

/* Base state: hidden until activated by JS */
.pswp {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 3999999;
  overflow: hidden;
  backface-visibility: hidden;
  outline: none;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
}
.pswp--open { display: block; }

.pswp__bg { background: rgba(15, 23, 42, 0.95); }
.pswp__top-bar { background: transparent; }
.pswp__counter { color: #E2E8F0; }
.pswp__button--close,
.pswp__button--zoom,
.pswp__button--arrow--left,
.pswp__button--arrow--right { filter: invert(1); }

/* =============================================================================
   RESPONSIVE SYSTEM
   Breakpoints (content-driven, not device-name-driven):
   xs  — ≤ 480px   : phone portrait
   sm  — ≤ 640px   : phone landscape / small tablet
   md  — ≤ 768px   : tablet portrait
   lg  — ≤ 1024px  : tablet landscape / small laptop
   xl  — ≤ 1280px  : laptop
   2xl — ≥ 1440px  : desktop
   3xl — ≥ 1920px  : large desktop / TV
   4k  — ≥ 2560px  : 4K / ultra-wide
   Base styles target ~1200px (standard laptop/desktop).
   ============================================================================= */

/* -----------------------------------------------------------------------------
   GLOBAL SAFEGUARDS (applied at every size)
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Post content: code blocks and tables scroll internally */
.gh-content pre,
.gh-content table {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.gh-content pre { white-space: pre; }
.gh-content table { display: block; width: 100%; }
.gh-content iframe,
.gh-content embed,
.gh-content object,
.gh-content video { max-width: 100%; }
.gh-content img { max-width: 100%; height: auto; }

/* -----------------------------------------------------------------------------
   lg — ≤ 1024px  (tablet landscape / small laptop)
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Header: hide CTA pill — not enough room */
  .gh-head-btn-cta { display: none; }

  /* Hero: drop visual column, 1-col text layout */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-10);
    padding-top: var(--space-16);
  }
  .hero-visual { display: none; }
  .hero-content { max-width: 640px; }

  /* Featured: hero spans full width, small cards side-by-side below */
  .featured-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .featured-card-hero {
    grid-column: span 2;
    grid-row: auto;
  }
  .featured-card-small {
    flex-direction: row;
    align-items: flex-start;
    padding: var(--space-4);
    gap: var(--space-3);
  }
  .featured-card-small-img-wrap {
    width: 80px;
    height: 80px;
    aspect-ratio: unset;
    border-radius: var(--radius);
    flex-shrink: 0;
  }
  .featured-card-small-content { padding: 0; }

  /* Post feed: 2-col */
  .post-feed { grid-template-columns: repeat(2, 1fr); }

  /* Footer: 2-col */
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .site-footer-brand { grid-column: span 2; }
}

/* -----------------------------------------------------------------------------
   md — ≤ 768px  (tablet portrait / large phone)
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {

  /* --- Header: compact, pure white, mobile hamburger --- */
  .gh-head {
    background: #ffffff;
    border-bottom: none;
    box-shadow: 0 1px 0 var(--color-border), 0 2px 10px rgba(15, 23, 42, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0 20px;
  }
  .gh-head-scrolled {
    box-shadow: 0 1px 0 var(--color-border), 0 4px 18px rgba(15, 23, 42, 0.10);
  }

  /* Full-width inner: logo far left, actions group far right */
  .gh-head-inner {
    height: 56px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    box-sizing: border-box;
  }

  /* Logo stays left, never shrinks */
  .gh-head-brand { flex-shrink: 0; }

  /* Actions group: search + burger pinned right */
  .gh-head-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
  }

  .gh-head-btn-cta { display: none; }

  /* Hamburger — always visible, proper 44×44 touch target */
  .gh-burger {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
  }
  .gh-burger span { width: 20px; height: 2px; }

  /* Hide desktop nav + members by default */
  .gh-head-menu,
  .gh-head-actions .gh-head-members { display: none; }

  /* Mobile nav overlay */
  .gh-head-open .gh-head-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    padding: var(--space-2) max(4vmin, 20px) var(--space-10);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 40px rgba(15, 23, 42, 0.12);
    z-index: 99;
  }
  .gh-head-open .gh-head-menu .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .gh-head-open .gh-head-menu .nav li {
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateX(-10px);
    animation: mobileNavItemIn 200ms var(--ease-out) forwards;
  }
  .gh-head-open .gh-head-menu .nav li:nth-child(1) { animation-delay:  30ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(2) { animation-delay:  70ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(3) { animation-delay: 110ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(4) { animation-delay: 150ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(5) { animation-delay: 190ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(6) { animation-delay: 230ms; }
  .gh-head-open .gh-head-menu .nav li:nth-child(7) { animation-delay: 270ms; }
  .gh-head-open .gh-head-menu .nav li a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 var(--space-2);
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--color-text);
    border-radius: 0;
    background: transparent;
  }
  .gh-head-open .gh-head-menu .nav li a:hover,
  .gh-head-open .gh-head-menu .nav-current a {
    color: var(--color-accent);
    background: transparent;
  }
  .gh-head-mobile-cta-wrap {
    display: block;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
    opacity: 0;
    animation: mobileNavItemIn 200ms var(--ease-out) 310ms forwards;
  }
  .gh-head-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    background: var(--color-accent);
    color: #fff;
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: background var(--t-micro);
  }
  .gh-head-mobile-cta:hover { background: var(--color-accent-hover); color: #fff; }

  /* Hero */
  .hero-section {
    padding: var(--space-12) max(4vmin, 16px) var(--space-10);
  }
  .hero-title { font-size: var(--text-3xl); }
  .hero-subtitle { font-size: var(--text-base); }

  /* Featured: tablet — hero full width top, 2 small cards side-by-side below */
  .featured-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .featured-card-hero {
    grid-column: 1 / span 2;
    grid-row: 1;
  }
  .featured-card-image-link { aspect-ratio: 16 / 10; }

  /* Post feed: single column */
  .post-feed { grid-template-columns: 1fr; }

  /* Article */
  .article-title { font-size: var(--text-3xl); }
  .article-byline {
    flex-direction: column;
    align-items: flex-start;
  }
  .gh-canvas {
    padding-left: max(4vmin, 16px);
    padding-right: max(4vmin, 16px);
  }

  /* Section padding */
  .featured-section,
  .posts-section,
  .topics-section,
  .newsletter-section {
    padding-left: max(4vmin, 16px);
    padding-right: max(4vmin, 16px);
  }

  /* CTAs */
  .cta-inject {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .cta-inject-btn { width: 100%; justify-content: center; }
  .inline-cta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
    padding: var(--space-6);
  }
  .post-cta-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Newsletter: stack */
  .newsletter-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .newsletter-form-wrap { gap: var(--space-3); }
  .newsletter-input-fake { display: none; }
  .newsletter-cta-btn {
    border-radius: var(--radius-lg);
    width: 100%;
  }
  .newsletter-submit {
    flex: 1;
    justify-content: center;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  }

  /* footer-cta pill (blog post page): go full-width, stack */
  .footer-cta-button {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
  }
  .footer-cta-input {
    flex: 1;
    min-width: unset;
    text-align: center;
  }
  .footer-cta-button > span {
    flex-shrink: 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  }

  /* Footer: 2-col */
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .site-footer-brand { grid-column: span 2; }
  .site-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  /* Author box */
  .author-box-inner { flex-direction: column; }

  /* Topics */
  .topics-grid { grid-template-columns: repeat(3, 1fr); }
}

@keyframes mobileNavItemIn {
  to { opacity: 1; transform: translateX(0); }
}

/* -----------------------------------------------------------------------------
   sm — ≤ 640px  (phone landscape / small tablet)
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .featured-card-hero { grid-column: 1; grid-row: auto; }
  .featured-card-image-link { aspect-ratio: 16 / 10; }
  .featured-card-small-img-wrap { aspect-ratio: 16 / 9; }
  .featured-card-excerpt { -webkit-line-clamp: 3; line-clamp: 3; }

  /* Topics: 2-col grid on phones */
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
    overflow: visible;
    gap: var(--space-2);
  }
  .topics-section {
    padding-left: max(3vmin, 12px);
    padding-right: max(3vmin, 12px);
  }
  .topic-card {
    flex: unset;
    min-width: unset;
    scroll-snap-align: unset;
    padding: var(--space-3) var(--space-3);
    gap: var(--space-2);
  }
}

/* -----------------------------------------------------------------------------
   xs — ≤ 480px  (phone portrait)
   ----------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Header */
  /* Header stays same flex layout, just shorter */
  .gh-head-inner { height: 52px; }
  .gh-head { padding: 0 16px; }

  /* Hero */
  .hero-title { font-size: var(--text-2xl); }
  .hero-subtitle { font-size: var(--text-sm); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* Article */
  .article-title { font-size: var(--text-2xl); }
  .article-excerpt { font-size: var(--text-base); }

  /* TOC */
  .toc { padding: var(--space-4); }

  /* Newsletter */
  .newsletter-title { font-size: var(--text-2xl); }

  /* Footer: single column */
  .site-footer-inner { grid-template-columns: 1fr; }
  .site-footer-brand { grid-column: span 1; }

  /* Tighter outer padding */
  .outer {
    padding-left: max(3vmin, 14px);
    padding-right: max(3vmin, 14px);
  }
}

/* -----------------------------------------------------------------------------
   2xl — ≥ 1440px  (desktop / large laptop)
   ----------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  :root {
    --max-width:     1440px;   /* desktop tier */
    --content-width: 860px;
    --wide-width:    1200px;
  }

  .gh-head-inner { height: 72px; }

  .hero-section {
    padding: var(--space-24) max(4vmin, 40px) var(--space-20);
  }
  .hero-title { font-size: 3.375rem; }   /* 54px — hold the cap */
  .article-title { font-size: 3.375rem; }

  .post-feed {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .featured-section,
  .posts-section,
  .topics-section,
  .newsletter-section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

/* -----------------------------------------------------------------------------
   3xl — ≥ 1920px  (large desktop / TV)
   ----------------------------------------------------------------------------- */
@media (min-width: 1920px) {
  :root {
    --max-width:     1600px;   /* TV tier */
    --content-width: 900px;
    --wide-width:    1360px;
  }

  .gh-head-inner { height: 76px; }
  .gh-head-logo-text { font-size: 1.375rem; }

  .hero-title { font-size: 3.375rem; }   /* hold 54px cap even on TV */
  .article-title { font-size: 3.375rem; }
  .hero-section {
    padding: var(--space-24) max(5vmin, 60px) var(--space-24);
  }

  .post-feed {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: var(--space-8);
  }

  .featured-grid {
    gap: var(--space-8);
  }

  .featured-section,
  .posts-section,
  .topics-section,
  .newsletter-section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  .newsletter-title { font-size: clamp(2rem, 2.5vw, 3rem); }
}

/* -----------------------------------------------------------------------------
   4k — ≥ 2560px  (4K / ultra-wide)
   ----------------------------------------------------------------------------- */
@media (min-width: 2560px) {
  :root {
    --max-width:     2000px;
    --content-width: 960px;
    --wide-width:    1600px;
    --text-base:     1.0625rem;
    --text-md:       1.1875rem;
    --text-lg:       1.375rem;
    --text-xl:       1.625rem;
    --text-2xl:      2rem;
    --text-3xl:      2.625rem;
    --text-4xl:      3.5rem;
  }

  .gh-head-inner { height: 80px; }
  .gh-head-logo-text { font-size: 1.5rem; }
  .gh-head-logo-icon { width: 32px; height: 32px; }

  .hero-title { font-size: 3.375rem; }
  .article-title { font-size: 3.375rem; }
  .hero-section {
    padding: 6rem max(6vmin, 80px);
  }

  .post-feed {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: var(--space-10);
  }

  .featured-grid { gap: var(--space-10); }

  .featured-section,
  .posts-section,
  .topics-section,
  .newsletter-section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }

  .site-footer-inner {
    grid-template-columns: 2.5fr 1fr 1fr 1fr;
    gap: var(--space-16);
  }
}

/* =============================================================================
   BUTTON LARGE VARIANT
   ============================================================================= */

.btn-lg {
  font-size: var(--text-md);
  padding: 0.875rem 1.75rem;
  min-height: 52px;
}

/* =============================================================================
   ARTICLES CHANNEL PAGE  (/articles/)
   ============================================================================= */

.articles-header {
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}
.articles-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.articles-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}

/* Filter navigation */
.articles-filters {
  padding-top: var(--space-4);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: var(--max-width);
  margin: 0 auto;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color var(--t-micro), color var(--t-micro), background var(--t-micro), box-shadow var(--t-micro);
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-xs);
}
.filter-btn--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.filter-btn--active:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
}

.articles-feed-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-16);
}

/* =============================================================================
   ENHANCED TAG PAGE
   ============================================================================= */

.tag-header {
  padding: var(--space-16) 0 var(--space-8);
}
.tag-header-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tag-header-back {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--t-micro);
}
.tag-header-back:hover { color: var(--color-accent); }
.tag-header-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.tag-header-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
}
.tag-header-description {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}
.tag-header-count {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.tag-related-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}
.tag-related-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.tag-related-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color var(--t-micro), color var(--t-micro), background var(--t-micro);
}
.tag-pill:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

/* =============================================================================
   ENHANCED AUTHOR PAGE
   ============================================================================= */

.author-header {
  padding: var(--space-16) 0 var(--space-10);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-12);
}
.author-header-inner {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
}
.author-header-avatar-wrap { flex-shrink: 0; }
.author-header-image {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-md);
}
.author-header-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.author-header-role {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}
.author-header-name {
  font-size: clamp(1.75rem, 1rem + 3.75vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
}
.author-header-bio {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 var(--space-4);
}
.author-header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.author-header-location {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.author-header-social {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  text-decoration: none;
  transition: border-color var(--t-micro), color var(--t-micro);
}
.author-header-social svg { width: 14px; height: 14px; }
.author-header-social:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.author-header-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
}
.author-stat { text-align: left; }
.author-stat-number {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.author-stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.author-posts-section { margin-top: var(--space-4); }

/* =============================================================================
   START HERE PAGE  (/start-here/)
   ============================================================================= */

.start-here-hero {
  padding: var(--space-16) max(4vmin, 20px) var(--space-12);
  background: linear-gradient(160deg, var(--color-accent-light) 0%, var(--color-bg) 55%);
  border-bottom: 1px solid var(--color-border);
}
.start-here-hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-10);
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}
.start-here-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(29, 108, 232, 0.1);
  border: 1px solid rgba(29, 108, 232, 0.2);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  margin-bottom: var(--space-4);
}
.start-here-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.start-here-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 52ch;
  margin-bottom: var(--space-8);
}
.start-here-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Hero stat cards */
.start-here-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
}
.start-here-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 130px;
}
.start-here-stat-number {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.start-here-stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Sections */
.start-here-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.start-here-section--tinted { background: var(--color-surface-2); }
.start-here-section-inner { max-width: var(--max-width); margin: 0 auto; }
.start-here-section-title {
  font-size: clamp(1.75rem, 0.75rem + 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.start-here-section-lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin-bottom: var(--space-10);
}

/* Two-column intro layout */
.start-here-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}
.start-here-list {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.start-here-list li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.55;
}
.start-here-list li strong { color: var(--color-text); }

/* Process flow visual */
.start-here-flow-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.flow-step-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.flow-step--check .flow-step-icon {
  background: var(--color-accent-light);
  border-color: rgba(29, 108, 232, 0.2);
}
.flow-step--out .flow-step-icon {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.2);
}
.flow-step-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}
.flow-arrow {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Metrics cards */
.start-here-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}
.start-here-metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
}
.metric-number {
  display: block;
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-2);
}
.metric-name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.metric-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Steps */
.start-here-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.start-here-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-xs);
}
.step-num {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
  flex-shrink: 0;
}
.step-body { min-width: 0; }
.step-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.step-body p {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Feature grid */
.start-here-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.start-here-feature {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  transition: box-shadow var(--t-base);
}
.start-here-feature:hover { box-shadow: var(--shadow-sm); }
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--color-accent-light);
  border: 1px solid rgba(29, 108, 232, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
}
.feature-icon svg { width: 18px; height: 18px; }
.feature-name {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}
.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* CTA section */
.start-here-cta {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
.start-here-cta-card {
  max-width: var(--max-width);
  margin: 0 auto;
  background: linear-gradient(135deg, #0F172A 0%, #1a2d4a 100%);
  border-radius: var(--card-radius);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.start-here-cta-title {
  font-size: clamp(1.75rem, 0.75rem + 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.start-here-cta-body {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.72);
  margin-bottom: var(--space-8);
}
.start-here-cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.start-here-cta-actions .btn-ghost {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.3);
}
.start-here-cta-actions .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.start-here-related { padding-top: var(--space-16); padding-bottom: var(--space-16); }

/* =============================================================================
   GUIDES PAGE  (/guides/)
   ============================================================================= */

.guides-header {
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}
.guides-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.guides-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}
.guides-grid-section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}
.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}
.guide-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), border-color var(--t-base);
  text-decoration: none;
  color: inherit;
}
.guide-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(29, 108, 232, 0.2);
}
.guide-card-img-link { display: block; overflow: hidden; }
.guide-card-img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow);
}
.guide-card:hover .guide-card-img { transform: scale(1.02); }
.guide-card-icon {
  font-size: 2.5rem;
  padding: var(--space-6) var(--card-padding) 0;
  display: block;
  line-height: 1;
}
.guide-card-body {
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.guide-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.guide-card-title a {
  color: inherit;
  text-decoration: none;
}
.guide-card-title a:hover { color: var(--color-accent); }
.guide-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-card-cta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  text-decoration: none;
}
.guide-card-cta:hover { color: var(--color-accent-hover); }
.guide-card-meta {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* =============================================================================
   TOOLS PAGE  (/tools/)
   ============================================================================= */

.tools-header {
  padding-top: var(--space-16);
  padding-bottom: var(--space-10);
}
.tools-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.tools-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}
.tools-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.tools-section--tinted { background: var(--color-surface-2); }
.tools-tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
}
.tools-tool-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid rgba(29, 108, 232, 0.2);
}
.tools-tool-badge--indigo {
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.2);
}
.tools-tool-badge--dark {
  background: #0F172A;
  color: #fff;
  border-color: transparent;
}
.tools-tool-title {
  font-size: clamp(1.625rem, 1rem + 3.125vw, 2.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.tools-tool-desc {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-width: 52ch;
  margin-bottom: var(--space-6);
}
.tools-tool-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tools-tool-features li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.tools-tool-features li::before {
  content: '✓';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mock preview card */
.tools-tool-preview {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.tool-preview-card {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tool-preview-input {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.preview-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.preview-value {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text);
  font-family: var(--font-mono);
}
.preview-check-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-surface);
  background: var(--color-accent);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  flex-shrink: 0;
}
.tool-preview-result {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.result-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.result-icon {
  font-size: 0.9rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-row--pass .result-icon { background: rgba(22,163,74,0.1); color: var(--color-success); }
.result-row--warn .result-icon { background: rgba(202,138,4,0.1); color: var(--color-warning); }
.result-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}
.score-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.score-value { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.01em; }
.score-value--medium { color: var(--color-warning); }

/* Ordered steps */
.tools-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.tools-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-4);
  align-items: start;
}
.tools-step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tools-steps li > div { min-width: 0; }
.tools-steps li strong {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.tools-steps li p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Bulk stats */
.tools-bulk-stats-wrap { padding: var(--space-4) 0; }
.tools-bulk-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.bulk-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  text-align: center;
}
.bulk-stat-val {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.bulk-stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* API snippet */
.tools-api-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-12);
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
}
.tools-api-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.tools-api-snippet {
  background: #0F172A;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.api-snippet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.api-snippet-lang {
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
}
.api-snippet-title {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  font-family: var(--font-mono);
}
.api-snippet-code {
  margin: 0;
  padding: var(--space-5);
  overflow-x: auto;
}
.api-snippet-code code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* =============================================================================
   CASE STUDIES PAGE  (/case-studies/)
   ============================================================================= */

.case-studies-header {
  padding-top: var(--space-16);
  padding-bottom: var(--space-10);
}
.case-studies-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.case-studies-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 62ch;
  margin-bottom: var(--space-8);
}
.case-studies-proof-bar {
  display: flex;
  gap: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}
.cs-proof-stat { text-align: left; }
.cs-proof-number {
  display: block;
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  line-height: 1;
}
.cs-proof-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.case-studies-grid-section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}

/* Case study placeholder cards */
.case-study-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--card-gap);
}
.case-study-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.case-study-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(29, 108, 232, 0.2);
}
.cs-card-header { display: flex; flex-direction: column; gap: var(--space-3); }
.cs-card-type {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.cs-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  color: var(--color-text);
}
.cs-card-summary {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin: 0;
}
.cs-card-metrics {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}
.cs-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}
.cs-metric-before {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.cs-metric-arrow {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 700;
}
.cs-metric-after {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-success);
  letter-spacing: -0.02em;
}
.cs-metric-name {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.cs-card-cta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  margin-top: auto;
}
.cs-card-cta:hover { color: var(--color-accent-hover); }

/* =============================================================================
   GLOSSARY PAGE  (/glossary/)
   ============================================================================= */

.glossary-header {
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}
.glossary-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.glossary-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin: 0;
}
.glossary-layout {
  padding-top: var(--space-8);
  padding-bottom: var(--space-16);
}
.glossary-body { max-width: var(--max-width); margin: 0 auto; }

/* A-Z navigation */
.glossary-az-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-4) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-10);
}
.az-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: background var(--t-micro), color var(--t-micro), border-color var(--t-micro);
}
.az-link:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: rgba(29, 108, 232, 0.3);
}
.az-link--disabled {
  color: var(--color-text-muted);
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

.glossary-content { max-width: 72ch; }
.glossary-letter-anchor {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.03em;
  margin: var(--space-12) 0 var(--space-6);
  padding-top: var(--space-4);
}
.glossary-letter-anchor:first-child { margin-top: 0; }
.glossary-term {
  margin-bottom: var(--space-8);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  scroll-margin-top: 100px;
}
.glossary-term-name {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.glossary-term-def {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}
.glossary-term-example {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--space-3);
}
.glossary-term-related {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}
.glossary-term-related a { color: var(--color-accent); }
.glossary-divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: var(--space-4) 0;
}
.glossary-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
}

/* =============================================================================
   COMPARE PAGE  (/compare- pages)
   ============================================================================= */

.compare-header {
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.compare-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.compare-breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}
.compare-breadcrumb a:hover { color: var(--color-accent); }
.compare-breadcrumb span[aria-hidden] { color: var(--color-text-muted); }
.compare-title {
  font-size: clamp(2rem, 1rem + 5vw, 3.375rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--space-4);
}
.compare-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 62ch;
  margin-bottom: var(--space-4);
}
.compare-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.compare-meta .bull { color: var(--color-text-muted); }

/* Verdict bar */
.compare-layout {
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}
.compare-content-wrap { max-width: var(--content-width); margin: 0 auto; }
.compare-verdict-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-10);
}
.verdict-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.verdict-side--hitoritech { align-items: flex-start; }
.verdict-side--other { align-items: flex-end; text-align: right; }
.verdict-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.verdict-product {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
}
.verdict-side--hitoritech .verdict-product { color: var(--color-accent); }
.verdict-use-case {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.verdict-vs {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text-muted);
  text-align: center;
  padding: 0 var(--space-4);
}
.compare-content { max-width: 72ch; }

/* Compare CTA */
.compare-cta { padding-top: var(--space-12); padding-bottom: var(--space-16); }
.compare-cta-card {
  max-width: var(--max-width);
  margin: 0 auto;
  background: linear-gradient(135deg, #0F172A 0%, #1a2d4a 100%);
  border-radius: var(--card-radius);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.compare-cta-title {
  font-size: clamp(1.75rem, 0.75rem + 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.compare-cta-body {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.72);
  margin-bottom: var(--space-8);
}
.compare-cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.compare-cta-actions .btn-ghost {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.3);
}
.compare-cta-actions .btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.compare-related { padding-top: var(--space-8); padding-bottom: var(--space-16); }

/* =============================================================================
   COMPARE PAGE — content table styles (in .compare-content / .gh-content)
   ============================================================================= */

.compare-content table,
.gh-content .compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-content th,
.compare-content td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
}
.compare-content th {
  background: var(--color-surface-2);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.compare-content tr:last-child td { border-bottom: none; }
.compare-content tr:hover td { background: var(--color-surface-2); }

/* =============================================================================
   RESPONSIVE — new pages
   ============================================================================= */

@media (max-width: 1024px) {
  .start-here-hero-inner { grid-template-columns: 1fr; }
  .start-here-stats { flex-direction: row; justify-content: flex-start; }
  .start-here-features { grid-template-columns: repeat(2, 1fr); }
  .guides-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-tool-layout,
  .tools-api-layout { grid-template-columns: 1fr; }
  .tools-bulk-stats-wrap { order: -1; }
  .compare-verdict-bar { grid-template-columns: 1fr; text-align: left; }
  .verdict-side--other { align-items: flex-start; text-align: left; }
  .verdict-vs { display: none; }
}

@media (max-width: 768px) {
  .start-here-two-col { grid-template-columns: 1fr; }
  .start-here-metrics { grid-template-columns: 1fr; }
  .start-here-features { grid-template-columns: 1fr; }
  .start-here-stats { flex-wrap: wrap; gap: var(--space-2); }
  .start-here-stat { min-width: calc(50% - var(--space-2)); flex: 1; }
  .start-here-hero-actions { flex-direction: column; }
  .start-here-hero-actions .btn { width: 100%; justify-content: center; }
  .author-header-inner { flex-direction: column; gap: var(--space-4); }
  .case-studies-proof-bar { flex-direction: column; gap: var(--space-4); }
}

@media (max-width: 640px) {
  .guides-grid { grid-template-columns: 1fr; }
  .filter-nav { gap: var(--space-2); }
  .filter-btn { font-size: var(--text-xs); padding: 0.4rem 0.75rem; }
  .start-here-cta-card,
  .compare-cta-card { padding: var(--space-8) var(--space-5); }
  .start-here-step { grid-template-columns: 40px 1fr; gap: var(--space-3); }
  .tools-bulk-stats { grid-template-columns: repeat(2, 1fr); }
  .cs-card-metrics { gap: var(--space-4); }
  .compare-verdict-bar { padding: var(--space-4); }
  .tag-related-nav { flex-direction: column; align-items: flex-start; }
  .glossary-az-nav { gap: var(--space-1); }
  .az-link { width: 32px; height: 32px; font-size: var(--text-xs); }
}

/* ============================================================
   Tags Index Page (/tag/)
   ============================================================ */
.tags-index-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}
.tags-index-header {
  text-align: center;
  margin-bottom: var(--space-12);
}
.tags-index-title {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3);
}
.tags-index-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}
.tags-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.tags-index-card {
  display: block;
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tags-index-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 20px rgba(43,19,146,0.10);
  transform: translateY(-2px);
}
.tags-index-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.tags-index-card-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.tags-index-card-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (max-width: 900px) {
  .tags-index-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tags-index-grid { grid-template-columns: 1fr; }
  .tags-index-title { font-size: var(--text-2xl); }
}
