:root {
  /* Palette */
  --brick:        #A3443B;
  --rust:         #C4614D;
  --sand:         #D4A86A;
  --sand-light:   #EDD9B0;
  --sky:          #6AAFC8;
  --sky-dark:     #3D8BAA;

  /* Surfaces */
  --bg:           #FDFAF5;   /* warm off-white, like paper */
  --bg2:          #F5EFE3;   /* warm cream */
  --bg3:          #EDE4D3;   /* deeper cream */
  --border:       #DDD3BE;
  --border-light: #E8E0CE;

  /* Text */
  --text:         #231A14;   /* warm near-black */
  --text2:        #4A3728;
  --text3:        #8C7A68;

  /* Functional */
  --accent:       var(--sky-dark);
  --accent-hover: var(--sky);
  --accent-light: #E8F4F9;
  --green:        #4A7C59;
  --orange:       var(--rust);
  --red:          var(--brick);

  /* Shape */
  --radius:       8px;
  --radius-lg:    14px;
  --shadow:       0 2px 8px rgba(35,26,20,.07), 0 1px 2px rgba(35,26,20,.05);
  --shadow-hover: 0 6px 20px rgba(35,26,20,.12), 0 2px 6px rgba(35,26,20,.07);
  --max-width:    1160px;
  --transition:   0.16s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── READING PROGRESS BAR (NEW FEATURE #1) ── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--brick);
  z-index: 9999;
  transition: width 0.1s linear;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Sans-serif for UI elements */
nav, button, input, .badge, .card-footer, .tag, .filter-btn,
.sidebar-box-header, .needs-box h3, .steps-section h2,
.hero-stat .label, .toc-num, .footer-bottom {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* ── LAYOUT ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ── NAV ── */
nav {
  background: var(--brick);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 20px;
}

.logo {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo span {
  font-style: normal;
  font-weight: 900;
  color: var(--sand-light);
}

.nav-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: 0 12px;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.nav-search:focus-within {
  border-color: var(--sand-light);
  background: rgba(0,0,0,.3);
}

.nav-search svg { color: rgba(255,255,255,.5); flex-shrink: 0; }

.nav-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: white;
  width: 100%;
  height: 36px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.nav-search input::placeholder { color: rgba(255,255,255,.45); }

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
  color: rgba(255,255,255,.8);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 5px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-links a:hover {
  background: rgba(0,0,0,.2);
  color: white;
}

/* ── HERO ── */
.hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 68px 24px 72px;
  text-align: center;
  position: relative;
}

/* Subtle top stripe */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brick), var(--rust), var(--sand), var(--sky));
}

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
  color: var(--brick);
  border-bottom: 3px solid var(--sand);
  padding-bottom: 2px;
  background: linear-gradient(135deg, var(--brick), var(--rust));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text2);
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-search {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(35,26,20,.12);
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 20px;
  font-size: 1rem;
  color: var(--text);
  height: 52px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: transparent;
}

.hero-search button {
  background: var(--brick);
  border: none;
  padding: 0 26px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero-search button:hover { background: var(--rust); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }

.hero-stat .num {
  font-family: Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--brick);
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-top: 4px;
}

/* ── SECTIONS ── */
.section { padding: 56px 0; }
.section-alt { background: var(--bg2); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 14px;
}

.section-header h2 {
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
}

.section-header a {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text3);
  text-decoration: none;
  letter-spacing: .01em;
}

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

/* ── CATEGORIES ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.category-card:hover {
  border-color: var(--rust);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.category-card .icon { font-size: 1.7rem; line-height: 1; }

.category-card .name {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  line-height: 1.3;
}

.category-card .count {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  color: var(--text3);
  font-weight: 500;
}

/* ── CATEGORY ABBR ── */
.cat-abbr {
  width: 44px;
  height: 44px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--text3);
  text-transform: uppercase;
}

.category-card:hover .cat-abbr {
  background: var(--rust);
  border-color: var(--rust);
  color: white;
}

/* ── TUTORIAL CARDS ── */
.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.tutorial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.tutorial-card:hover {
  box-shadow: 0 8px 28px rgba(35,26,20,.15), 0 3px 8px rgba(35,26,20,.09);
  transform: translateY(-4px);
  border-color: var(--sand);
  text-decoration: none;
}

/* Card image */
.card-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg3);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.tutorial-card:hover .card-img img {
  transform: scale(1.04);
}

/* Tutorial hero image */
.tutorial-hero-img {
  width: 100%;
  height: 340px;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 28px;
  background: var(--bg3);
}

.tutorial-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-cat-bar {
  height: 3px;
  background: var(--rust);
}

.card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 9px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-cat { background: var(--bg3); color: var(--text2); }
.badge-easy { background: #dff2e9; color: var(--green); }
.badge-medium { background: #fdeede; color: var(--rust); }
.badge-hard { background: #fce8e6; color: var(--brick); }

.card-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text3);
  margin-left: auto;
}

.card-title {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding: 9px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text3);
  background: var(--bg2);
}

.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.tag {
  font-size: 0.68rem;
  background: var(--bg3);
  color: var(--text3);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

/* ── TUTORIAL PAGE ── */
.tutorial-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 40px;
  align-items: start;
  padding: 44px 0 80px;
}

.tutorial-header { margin-bottom: 32px; }

.tutorial-header .breadcrumb {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  color: var(--text3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-header .breadcrumb a { color: var(--text3); text-decoration: none; }
.tutorial-header .breadcrumb a:hover { color: var(--accent); }

.tutorial-header h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.015em;
}

.tutorial-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tutorial-intro {
  font-size: 1.05rem;
  color: var(--text2);
  line-height: 1.75;
  padding: 20px 22px;
  background: var(--bg2);
  border-left: 4px solid var(--rust);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 32px;
  font-style: italic;
}

.needs-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.needs-box h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
  font-weight: 700;
  margin-bottom: 14px;
}

.needs-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.needs-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text2);
}

.needs-list li::before {
  content: "✓";
  color: var(--sky-dark);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.amazon-link {
  color: var(--text2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px dashed var(--sand);
  transition: color 0.15s, border-color 0.15s;
}
.amazon-link:hover {
  color: var(--brick);
  border-color: var(--brick);
}

.amazon-note {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text3);
  font-style: italic;
}

.steps-section h2 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.step {
  display: flex;
  gap: 18px;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
}

.step:last-child { border-bottom: none; }

.step-num {
  width: 40px;
  height: 40px;
  background: var(--brick);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 2px 8px rgba(163, 68, 59, 0.35);
}

.step-content { flex: 1; }

.step-content h3 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.step-content p {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.72;
}

.warnings-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px;
  margin-top: 32px;
}

.warnings-box h3 {
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warnings-box ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.warnings-box ul li {
  font-size: 0.9rem;
  color: #78350f;
  display: flex;
  gap: 8px;
  line-height: 1.55;
}

.warnings-box ul li::before { content: "⚠"; flex-shrink: 0; color: #d97706; }

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 76px; }

.sidebar-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}

.sidebar-box-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text3);
  background: var(--bg2);
}

.toc-list { list-style: none; padding: 6px 0; }

.toc-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text2);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.toc-list a:hover { background: var(--bg2); color: var(--text); text-decoration: none; }

.toc-num {
  width: 19px;
  height: 19px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
}

.related-list { list-style: none; padding: 2px 0; }

.related-list a {
  display: block;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  font-family: Georgia, serif;
  text-decoration: none;
}

.related-list a:last-child { border-bottom: none; }
.related-list a:hover { background: var(--bg2); text-decoration: none; }

/* ── SEARCH PAGE ── */
.search-header { padding: 36px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }

.search-header h1 {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 6px;
}

.search-header p { color: var(--text3); font-size: 0.875rem; font-family: -apple-system, sans-serif; }

.search-bar-lg {
  display: flex;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  transition: border-color var(--transition);
}

.search-bar-lg:focus-within { border-color: var(--rust); }

.search-bar-lg input {
  flex: 1;
  border: none;
  outline: none;
  padding: 13px 18px;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.search-bar-lg button {
  background: var(--brick);
  border: none;
  padding: 0 26px;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.search-bar-lg button:hover { background: var(--rust); }

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.filter-btn:hover { border-color: var(--rust); color: var(--brick); background: #FDF0EE; }

.filter-btn.active {
  background: var(--brick);
  border-color: var(--brick);
  color: white;
}

.results-info {
  font-size: 0.85rem;
  color: var(--text3);
  margin-bottom: 20px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.results-info strong { color: var(--text); }

.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text3);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.no-results h3 { font-family: Georgia, serif; font-size: 1.25rem; color: var(--text2); margin-bottom: 8px; font-style: italic; }

/* ── HELPFUL BOX ── */
.helpful-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 36px;
  text-align: center;
}
.helpful-box p { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.helpful-count { font-size: 0.82rem; color: var(--text3); margin-bottom: 14px; font-family: -apple-system, sans-serif; }
.helpful-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.helpful-btns button {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 6px;
  padding: 9px 22px; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; color: var(--text2);
}
.helpful-btns button:first-child:hover { background: #DCFCE7; border-color: #16a34a; color: #166534; }
.helpful-btns button:last-child:hover  { background: #FFE4E6; border-color: #dc2626; color: #991b1b; }
.helpful-thanks { font-weight: 600; color: var(--sky-dark); font-size: 0.95rem; }

/* ── COMMENTS ── */
.comments-section {
  margin-top: 40px;
  border-top: 2px solid var(--border);
  padding-top: 32px;
}
.comments-title {
  font-size: 1.15rem; font-weight: 700; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.comments-count {
  background: var(--brick); color: white; border-radius: 12px;
  padding: 2px 9px; font-size: 0.75rem; font-family: -apple-system, sans-serif;
}
.comment {
  padding: 16px 0; border-bottom: 1px solid var(--border-light);
}
.comment:last-of-type { border-bottom: none; }
.comment-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-family: -apple-system, sans-serif; font-size: 0.85rem;
}
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brick), var(--sky-dark));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.comment-meta strong { color: var(--text); font-size: 0.9rem; }
.comment-date { color: var(--text3); margin-left: auto; font-size: 0.78rem; }
.comment p { font-size: 0.9rem; color: var(--text2); line-height: 1.65; }

.comment-form {
  margin-top: 28px; background: var(--bg2); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border);
}
.comment-form h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 14px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; font-family: -apple-system, sans-serif; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 0.9rem; box-sizing: border-box;
  margin-bottom: 10px; transition: border-color 0.15s;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--rust); }
.comment-form textarea { resize: vertical; }
.comment-form button {
  background: var(--brick); color: white; border: none; padding: 10px 24px;
  border-radius: 6px; font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.comment-form button:hover { background: var(--rust); }

/* ── AD PLACEHOLDER ── */
.ad-slot {
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.ad-slot-banner { height: 90px; margin: 28px 0; }
.ad-slot-square { height: 250px; }
.ad-slot-sidebar { height: 200px; }

/* ── FOOTER ── */
footer {
  background: var(--text);
  color: rgba(255,255,255,.6);
  padding: 52px 0 0;
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

footer .logo {
  color: white;
  font-size: 1.15rem;
  margin-bottom: 14px;
  display: block;
}

footer p { font-size: 0.875rem; line-height: 1.65; max-width: 280px; }

footer h4 {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: rgba(255,255,255,.9);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }

footer ul li a {
  color: rgba(255,255,255,.5);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  transition: color var(--transition);
  text-decoration: none;
}

footer ul li a:hover { color: var(--sand-light); }

.footer-bottom {
  padding: 20px;
  font-size: 0.78rem;
  text-align: center;
  color: rgba(255,255,255,.28);
}

/* ── NAV HAMBURGER (NEW FEATURE #6) ── */
.nav-hamburger {
  display: none;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.2);
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.nav-hamburger:hover { background: rgba(0,0,0,.35); }

/* ── NAV ACTIVE STATE (CHANGE #10) ── */
.nav-links a.active {
  color: white;
  border-bottom: 2px solid var(--sand-light);
  padding-bottom: 4px;
}

/* ── SEARCH CHIPS (NEW FEATURE #7) ── */
.search-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.search-chips span {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  color: var(--text3);
  font-weight: 600;
}

.search-chips a {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  text-decoration: none;
  transition: all var(--transition);
  font-weight: 500;
}

.search-chips a:hover {
  background: var(--brick);
  border-color: var(--brick);
  color: white;
  text-decoration: none;
}

/* ── JUMP TO STEPS BUTTON (NEW FEATURE #3) ── */
.jump-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--brick);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin-bottom: 24px;
  transition: all var(--transition);
}

.jump-btn:hover {
  background: var(--brick);
  border-color: var(--brick);
  color: white;
  text-decoration: none;
}

/* ── HELPFUL WIDGET (NEW FEATURE #4) ── */
.helpful-box {
  text-align: center;
  padding: 32px 20px;
  margin-top: 32px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.helpful-box p {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  color: var(--text2);
  margin-bottom: 16px;
  font-weight: 600;
}

.helpful-btns { display: flex; gap: 12px; justify-content: center; }

.helpful-btns button {
  padding: 10px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.helpful-btns button:hover {
  background: var(--brick);
  border-color: var(--brick);
  color: white;
}

.helpful-thanks {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  color: var(--green);
  font-weight: 600;
}

/* ── PRINT BUTTON (NEW FEATURE #9) ── */
.print-btn {
  margin-left: auto;
  padding: 5px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.print-btn:hover {
  background: var(--bg3);
  border-color: var(--rust);
  color: var(--brick);
}

/* ── BACK TO TOP BUTTON (NEW FEATURE #8) ── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--brick);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(163,68,59,.4);
  z-index: 500;
  transition: all var(--transition);
}

#back-to-top:hover { background: var(--rust); transform: translateY(-2px); }
#back-to-top.visible { display: flex; }

/* ── SEARCH CLEAR BUTTON (CHANGE #6) ── */
.search-clear-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text3) !important;
  font-size: 1.1rem;
  padding: 0 12px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.search-clear-btn:hover { color: var(--brick) !important; background: transparent !important; }

/* ── ESTIMATED READ TIME ON CARD ── */
.card-read-time {
  margin-left: 0 !important;
}

/* ── FOOTER BACK TO TOP (CHANGE #9) ── */
.footer-back-top {
  color: rgba(255,255,255,.4);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-back-top:hover { color: var(--sand-light); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--brick);
    border-top: 1px solid rgba(255,255,255,.15);
    padding: 8px 0;
    z-index: 99;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 12px 20px;
    border-radius: 0;
    font-size: 0.95rem;
  }
  nav { position: relative; }
  .hero { padding: 48px 20px 56px; }
  .hero-stats { gap: 28px; }
  .tutorial-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 480px) {
  .hero-search { flex-direction: column; border-radius: var(--radius-lg); }
  .hero-search input { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .hero-search button { border-radius: 0 0 var(--radius-lg) var(--radius-lg); height: 46px; justify-content: center; }
  .tutorials-grid { grid-template-columns: 1fr; }
}

/* ── STEP IMAGES ── */
.step-img {
  margin-top: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.step-img img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

/* ── COMMENTS EMPTY STATE ── */
.comments-empty {
  color: var(--text3);
  font-size: 0.9rem;
  font-style: italic;
  padding: 20px 0 8px;
  font-family: -apple-system, sans-serif;
}

/* ── YOUTUBE-STYLE COMMENTS ── */
.yt-comment {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.yt-comment:last-of-type { border-bottom: none; }

.yt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  font-family: -apple-system, sans-serif;
}
.yt-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.yt-comment-body {
  flex: 1;
  min-width: 0;
}

.yt-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.yt-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.yt-date {
  font-size: 0.75rem;
  color: var(--text3);
}

.yt-comment-text {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.6;
  margin: 0 0 8px;
}

.yt-comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: -apple-system, sans-serif;
}

.yt-like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  font-family: -apple-system, sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}
.yt-like-btn:hover { background: var(--bg2); color: var(--text2); }
.yt-like-btn.liked { color: var(--brick); }
.yt-like-btn.liked svg { fill: var(--brick); stroke: var(--brick); }

.yt-reply-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: -apple-system, sans-serif;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  transition: background var(--transition), color var(--transition);
}
.yt-reply-btn:hover { background: var(--bg2); color: var(--text2); }

.yt-reply-form {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.yt-reply-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
  min-width: 0;
}
.yt-reply-input:focus { outline: none; border-color: var(--rust); }
.yt-reply-form button {
  background: var(--brick);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: -apple-system, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.yt-reply-form button:hover { background: var(--rust); }

.yt-replies {
  margin-top: 12px;
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.yt-reply {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
}

/* ── SUGGESTION MODAL ── */
#suggestion-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35,26,20,.45);
  animation: backdropFadeIn 0.2s ease;
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-sheet {
  position: relative;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 36px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 -8px 40px rgba(35,26,20,.15);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(.22,1,.36,1);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.modal-sheet-open { transform: translateY(0) !important; }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-sheet h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-family: Georgia, serif;
}
.modal-sub {
  font-size: 0.88rem;
  color: var(--text3);
  margin-bottom: 18px;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.modal-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text2);
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.modal-options label:hover { background: var(--bg2); border-color: var(--rust); }
.modal-options input[type="radio"] { accent-color: var(--brick); cursor: pointer; }

#suggestion-detail {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  margin-bottom: 18px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
#suggestion-detail:focus { outline: none; border-color: var(--rust); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-cancel {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text2);
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.modal-cancel:hover { background: var(--bg2); border-color: var(--text3); }
.modal-submit {
  background: var(--brick);
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, sans-serif;
  transition: background 0.15s;
}
.modal-submit:hover { background: var(--rust); }

/* ── PRINT STYLES (NEW FEATURE #9) ── */
@media print {
  nav, .sidebar, .ad-slot, .jump-btn, .helpful-box, .print-btn, #back-to-top, footer { display: none !important; }
  .tutorial-layout { grid-template-columns: 1fr !important; }
  body { background: white; color: black; }
  .tutorial-main { max-width: 100%; }
  a { color: inherit; text-decoration: none; }
}
