/* ==========================================================================
   ColorPrint Design System v2
   Art-studio DNA elevated: dark mode, mobile-first, print UX, a11y, SEO-ready
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #faf9f7;
  --bg-card: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --muted: #737373;
  --line: #ebe8e4;
  --accent: #c45c26;
  --accent-deep: #a34a1d;
  --accent-soft: #f8efe8;
  --accent-tint: #fdf6f1;
  --success: #2f7d4f;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --header-h: 68px;
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
  --content-w: 1180px;
  --text-w: 720px;
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-soft: #1b1a19;
  --bg-card: #1e1d1c;
  --ink: #f2efec;
  --ink-soft: #c9c4bf;
  --muted: #8f8a85;
  --line: #2c2a28;
  --accent: #e08a57;
  --accent-deep: #ef9d6b;
  --accent-soft: #2e241e;
  --accent-tint: #241c17;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: var(--bg); padding: 10px 18px;
  border-radius: 999px; transition: top 0.2s; font-size: 0.9rem;
}
.skip-link:focus { top: 12px; }

.container { max-width: var(--content-w); margin: 0 auto; padding: 0 28px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 999px; text-decoration: none;
  font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em;
  transition: all 0.25s ease; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(196, 92, 38, 0.28); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(196, 92, 38, 0.36); }
.btn-ink { background: var(--ink); color: var(--bg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 18px; font-size: 0.86rem; }
.btn-lg { padding: 16px 36px; font-size: 1.02rem; }
.btn-colorbook {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(135deg, #ff8c42 0%, #e6721f 45%, #c45c26 100%);
  color: #fff; padding: 16px 34px 14px; border-radius: 999px;
  text-decoration: none; transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(196, 92, 38, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-colorbook:hover {
  transform: translateY(-2px); filter: brightness(1.07);
  box-shadow: 0 14px 34px rgba(196, 92, 38, 0.5);
}
.btn-colorbook .main { font-size: 0.98rem; font-weight: 500; }
.btn-colorbook .sub { font-size: 0.68rem; opacity: 0.85; font-weight: 400; letter-spacing: 0.04em; }

/* Etsy-styled secondary CTA */
.etsy-btn {
  background: #ffffff !important;
  border: 1px solid #e8e4df !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  color: #1a1a1a !important;
}
.etsy-btn:hover { border-color: #f1641e !important; transform: translateY(-2px); }
.etsy-name { color: #f1641e; font-weight: 600; }
[data-theme="dark"] .etsy-btn {
  background: #1e1d1c !important;
  border-color: #2c2a28 !important;
  color: #f2efec !important;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--content-w); margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: var(--header-h);
}
.logo {
  font-family: var(--font-display); font-size: 1.65rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap;
}
.logo span { color: var(--accent); font-style: italic; }
.logo svg { vertical-align: -3px; margin-right: 6px; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  font-size: 0.92rem; color: var(--ink-soft); text-decoration: none; font-weight: 400;
  transition: color 0.2s; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.header-actions { display: flex; gap: 10px; align-items: center; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink-soft);
  border: 1px solid var(--line); transition: all 0.2s; background: transparent;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Hamburger */
.hamburger { display: none; }
.hamburger .bar { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }

/* ---------- Mobile nav drawer ---------- */
.mobile-nav {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.3s;
}
.mobile-nav.open { pointer-events: auto; opacity: 1; }
.mobile-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--bg); padding: 24px; display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto; border-left: 1px solid var(--line);
}
.mobile-nav.open .mobile-panel { transform: translateX(0); }
.mobile-panel a.m-link {
  padding: 13px 10px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--ink); font-size: 1.05rem; border-bottom: 1px solid var(--line);
}
.mobile-panel a.m-link:hover { color: var(--accent); background: var(--bg-soft); }
.mobile-close { align-self: flex-end; }

/* ---------- Search ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 250; background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(8px); display: none; padding: 8vh 20px 40px; overflow-y: auto;
}
.search-overlay.open { display: block; }
.search-box { max-width: 640px; margin: 0 auto; }
.search-input {
  width: 100%; padding: 18px 24px; font-size: 1.2rem; border-radius: 999px;
  border: 2px solid var(--line); background: var(--bg-card); color: var(--ink);
  font-family: var(--font-body);
}
.search-input:focus { border-color: var(--accent); outline: none; }
.search-results { max-width: 640px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 8px; }
.search-result {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--line); text-decoration: none; transition: all 0.2s;
}
.search-result:hover { border-color: var(--accent); transform: translateX(4px); }
.search-result img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: var(--bg-soft); padding: 4px; }
.search-result .r-title { font-weight: 500; font-size: 0.98rem; }
.search-result .r-cat { font-size: 0.8rem; color: var(--muted); }
.search-close { position: fixed; top: 20px; right: 24px; }
.search-empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  max-width: var(--content-w); margin: 0 auto; padding: 18px 28px 0;
  font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero { padding: 64px 28px 44px; text-align: center; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%); }
.hero-inner { max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 500; margin-bottom: 18px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.5; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.4rem, 5.5vw, 3.7rem);
  font-weight: 600; line-height: 1.14; letter-spacing: -0.03em; margin-bottom: 20px;
}
.hero-lead { font-size: 1.13rem; color: var(--ink-soft); max-width: 580px; margin: 0 auto 30px; font-weight: 300; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.hero-stat .lbl { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* Home hero specific */
.hero-home { padding: 88px 28px 60px; }
.hero-home h1 { font-size: clamp(2.8rem, 6.5vw, 4.4rem); }

/* ---------- Gallery ---------- */
.gallery-section { max-width: var(--content-w); margin: 0 auto; padding: 24px 28px 56px; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 600;
  margin-bottom: 6px; letter-spacing: -0.02em;
}
.section-head .section-sub { color: var(--muted); font-size: 0.95rem; }
.section-head.left { text-align: left; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.print-card {
  position: relative; background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s, border-color 0.3s;
}
.print-card:hover, .print-card:focus-within {
  transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent;
}
.print-card .card-media { position: relative; }
.print-card img {
  width: 100%; aspect-ratio: 1 / 1.12; object-fit: contain;
  background: var(--bg-soft); padding: 18px; transition: transform 0.5s ease;
}
.print-card:hover img { transform: scale(1.03); }
.difficulty-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  backdrop-filter: blur(6px); color: var(--ink-soft); border: 1px solid var(--line);
}
.difficulty-tag.easy { color: var(--success); }
.difficulty-tag.detailed { color: var(--accent); }
.card-overlay {
  position: absolute; inset: 0; z-index: 3;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.7) 0%, transparent 55%);
  opacity: 0; display: flex; align-items: flex-end; justify-content: center; gap: 10px;
  padding-bottom: 24px; transition: opacity 0.3s ease;
}
.print-card:hover .card-overlay, .print-card:focus-within .card-overlay,
.card-overlay.sticky-touch { opacity: 1; }
.card-action {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 20px;
  border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.85rem;
  font-weight: 500; text-decoration: none; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(10px); transition: all 0.3s ease; border: none; cursor: pointer;
}
.print-card:hover .card-action, .print-card:focus-within .card-action { transform: translateY(0); }
.card-action:hover { background: var(--accent); color: #fff; }
.card-action.print { background: var(--ink); color: #fff; }
.card-action.print:hover { background: var(--accent-deep); }
.card-caption {
  padding: 13px 16px 15px; text-align: center; font-size: 0.86rem;
  color: var(--muted); border-top: 1px solid var(--line); background: var(--bg-card);
}
.card-caption strong { color: var(--ink); font-weight: 500; display: block; font-size: 0.94rem; margin-bottom: 2px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(10, 10, 10, 0.88); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-inner { position: relative; max-width: min(720px, 92vw); width: 100%; }
.lightbox-inner img {
  width: 100%; max-height: 74vh; object-fit: contain; border-radius: var(--radius);
  background: #fff; padding: 20px;
}
.lightbox-caption { color: #fff; text-align: center; margin-top: 14px; font-size: 0.95rem; }
.lightbox-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.lb-btn {
  display: inline-flex; gap: 8px; align-items: center; padding: 12px 24px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 0.9rem; font-weight: 500; text-decoration: none;
}
.lb-btn:hover { background: var(--accent); color: #fff; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.lb-nav:hover { background: var(--accent); }
.lb-nav.prev { left: -58px; }
.lb-nav.next { right: -58px; }
.lb-close { position: absolute; top: -46px; right: 0; color: #fff; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.14); }

/* ---------- Content typography ---------- */
.content-wrap { max-width: var(--text-w); margin: 0 auto; padding: 18px 28px 70px; }
.content-wrap h2 {
  font-family: var(--font-display); font-size: 2rem; font-weight: 600;
  margin: 46px 0 18px; letter-spacing: -0.02em; line-height: 1.25; scroll-margin-top: calc(var(--header-h) + 20px);
}
.content-wrap h3 {
  font-family: var(--font-display); font-size: 1.42rem; font-weight: 500;
  margin: 34px 0 14px; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 20px);
}
.content-wrap p { margin-bottom: 1.25em; color: var(--ink-soft); font-size: 1.04rem; font-weight: 300; }
.content-wrap strong { color: var(--ink); font-weight: 500; }
.content-wrap ul, .content-wrap ol { margin: 0 0 1.4em 1.3em; color: var(--ink-soft); }
.content-wrap li { margin-bottom: 0.55em; font-weight: 300; }
.content-wrap li::marker { color: var(--accent); }

/* Table of contents */
.toc {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin: 34px 0;
}
.toc summary { cursor: pointer; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; list-style: none; }
.toc summary::after { content: "▾"; float: right; color: var(--accent); }
.toc[open] summary::after { content: "▴"; }
.toc ul { margin: 14px 0 0 18px; }
.toc a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { color: var(--accent); }

/* Callout */
.art-note {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 22px 26px; margin: 36px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.02rem; color: var(--ink-soft);
}
.art-note strong { color: var(--accent-deep); }

/* Mid CTA */
.mid-cta {
  text-align: center; padding: 48px 28px; margin: 50px 0;
  background: var(--bg-soft); border-radius: var(--radius-lg); border: 1px solid var(--line);
}
.mid-cta-standalone { max-width: var(--content-w); margin: 0 auto 40px; }
.mid-cta h3 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 10px; }
.mid-cta p { color: var(--ink-soft); margin-bottom: 22px; font-size: 1.02rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 10px; }
.faq-list details {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px; transition: border-color 0.2s;
}
.faq-list details[open] { border-color: var(--accent); }
.faq-list summary {
  cursor: pointer; padding: 14px 0; font-weight: 500; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); font-weight: 400; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { padding: 0 0 16px; color: var(--ink-soft); font-weight: 300; }

/* Share */
.share-row { display: flex; gap: 10px; align-items: center; margin: 30px 0; flex-wrap: wrap; }
.share-row span { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Related rail ---------- */
.related { max-width: var(--content-w); margin: 0 auto 70px; padding: 0 28px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.related-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; text-decoration: none; transition: all 0.25s;
}
.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: transparent; }
.related-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg-soft); padding: 12px; }
.related-card .rc-body { padding: 12px; text-align: center; }
.related-card .rc-body strong { display: block; font-size: 0.92rem; font-weight: 500; }
.related-card .rc-body span { font-size: 0.78rem; color: var(--muted); }

/* ---------- Category & group grids ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin: 30px 0 50px; }
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden; text-decoration: none;
  border: 1px solid var(--line); background: var(--bg-card); transition: all 0.3s;
  display: flex; flex-direction: column;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.cat-card .cat-media { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 0; }
.cat-card .cat-media img { aspect-ratio: 1; object-fit: contain; background: var(--bg-soft); border-radius: 10px; width: 100%; }
.cat-card .cat-body { padding: 18px 20px 20px; }
.cat-card h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; margin-bottom: 4px; }
.cat-card p { font-size: 0.88rem; color: var(--muted); }
.cat-card .cat-count {
  position: absolute; top: 18px; right: 18px; background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--line); font-size: 0.72rem; font-weight: 500;
  padding: 4px 12px; border-radius: 999px; color: var(--ink-soft);
}

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 26px 0; }
.group-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--line); text-decoration: none;
  font-size: 0.9rem; transition: all 0.2s;
}
.group-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.group-pill img { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; background: var(--bg-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 52px 28px 36px; background: var(--bg-soft); margin-top: 20px; }
.footer-inner { max-width: var(--content-w); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-brand { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.footer-brand span { color: var(--accent); font-style: italic; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.footer-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; padding: 3px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-note {
  width: 100%; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--muted); text-align: center; line-height: 1.8;
}

/* ---------- Sticky mobile bar ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 10px 16px;
  display: none; gap: 10px; justify-content: center;
}
.mobile-bar .btn { flex: 1; max-width: 220px; padding: 12px 18px; }

/* Back to top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 80; width: 46px; height: 46px;
  border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none;
  transition: all 0.3s;
}
.to-top.visible { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--accent); transform: translateY(-3px); }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 110px 28px 90px; }
.error-page .code { font-family: var(--font-display); font-size: 7rem; font-weight: 600; color: var(--accent); line-height: 1; }
.error-page h1 { font-family: var(--font-display); font-size: 2.2rem; margin: 14px 0 14px; }
.error-page p { color: var(--muted); max-width: 420px; margin: 0 auto 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lb-nav.prev { left: 0; }
  .lb-nav.next { right: 0; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .hamburger { display: inline-flex; }
  .mobile-bar { display: flex; }
  .to-top { bottom: 76px; }
  .footer-cols { gap: 36px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .related-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-grid { grid-template-columns: 1fr; }
  .card-overlay { opacity: 1; background: linear-gradient(to top, rgba(26,26,26,0.45) 0%, transparent 40%); padding-bottom: 14px; }
  .card-action { transform: translateY(0); padding: 9px 14px; font-size: 0.78rem; }
  .hero { padding: 44px 20px 36px; }
  .content-wrap h2 { font-size: 1.7rem; }
  .lb-close { top: 8px; right: 8px; background: rgba(0,0,0,0.4); }
}
@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .print-card img { padding: 10px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 22px; }
  .group-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .mobile-bar, .to-top, .related, .breadcrumbs,
  .mid-cta, .share-row, .toc, .search-overlay, .mobile-nav, .lightbox,
  .btn, .hero-ctas, .eyebrow { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .hero { padding: 10px 0; background: #fff !important; text-align: left; }
  .hero h1 { font-size: 1.8rem; color: #000 !important; }
  .content-wrap, .gallery-section { max-width: 100%; padding: 0; }
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .print-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .print-card img { padding: 6px; }
  .card-caption { border-top: 1px solid #ddd; font-size: 0.7rem; padding: 6px; }
  .difficulty-tag, .card-overlay { display: none !important; }
  .content-wrap p, .content-wrap li { color: #000 !important; }
  @page { margin: 12mm; }
}

/* ---------- Motion & theme ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
/* Theme flash prevention */
html:not([data-theme]) body { transition: none; }
