/* ============================================================================
   Kyrza build-journal engine: shared by every journal outside Rosewood.
   Forked from woodworking/rosewood-table/assets/css/styles.css (Rosewood itself
   stays frozen on its own copy). Every color is a token; a craft theme file
   (theme-blades.css, theme-leather.css) only overrides :root variables.
   Defaults below = the Rosewood palette.
   ========================================================================= */

/* ----- Design tokens ----- */
:root {
  --tone-900: #2b1712;   /* deepest tone: headings, dark panels */
  --tone-700: #4a271c;
  --tone-500: #7a4a34;   /* primary tone */
  --tone-300: #b07a58;   /* warm accent / borders */
  --tone-100: #e6d2c2;   /* pale tint */
  --cream:        #f6efe7;   /* page background */
  --cream-card:   #fffaf4;   /* card surfaces */
  --ink:          #1a1714;
  --ink-soft:     #443e38;
  --steel:        #14130f;
  --line:         #e2d5c6;
  --accent:       #c8853f;   /* CTA / highlight */
  --accent-hover: #b3712f;
  --shadow:       0 8px 30px rgba(43, 23, 18, 0.10);
  --shadow-sm:    0 2px 10px rgba(43, 23, 18, 0.08);

  --header-bg:    rgba(43, 23, 18, 0.92);
  --hero-ph-a:    #3a2018;
  --hero-ph-b:    #46271c;
  --hero-shade-top:    rgba(20, 10, 7, 0.35);
  --hero-shade-bottom: rgba(20, 10, 7, 0.72);
  --backdrop:     rgba(20, 10, 7, 0.5);
  --lightbox-bg:  rgba(15, 8, 5, 0.93);
  --on-dark:      #f3ece2;   /* text on near-black */
  --ph-a:         #efe2d2;   /* placeholder stripes */
  --ph-b:         #e9dac7;
  --toc-end:      #efe3d4;   /* TOC section gradient end */
  --track:        #e5d6c4;   /* progress track */

  /* Status colors: the same in every theme */
  --ok:           #5e9c4e;
  --ok-deep:      #2f5a23;
  --ok-tint:      #f0f7ee;
  --ok-line:      #cfe3c8;
  --ok-light:     #b9e0ae;
  --warn:         #c4602f;
  --warn-deep:    #9c4216;
  --warn-tint:    #fdf1ec;
  --warn-line:    #f0cbbb;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--tone-700); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; color: var(--tone-900); font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.eyebrow {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--tone-500);
  margin: 0 0 0.6rem;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.98rem;
  padding: 0.85rem 1.5rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); }
.btn-outline { background: transparent; color: var(--tone-700); border-color: var(--tone-300); }
.btn-outline:hover { background: var(--tone-100); }

/* ----- Image placeholders (drop real photos in later, zero layout shift) ----- */
.ph {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, var(--ph-a) 0 14px, var(--ph-b) 14px 28px);
  color: var(--tone-700);
  border: 1px dashed var(--tone-300);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ph::before {
  content: "📷";
  position: absolute; top: 10px; left: 12px;
  font-size: 1rem; opacity: 0.5;
}
.ph span {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.02em; padding: 0.5rem 1rem; max-width: 90%;
}
.ph-16x9 { aspect-ratio: 16 / 9; }
.ph-4x3  { aspect-ratio: 4 / 3; }
.ph-1x1  { aspect-ratio: 1 / 1; }
.ph-hero { aspect-ratio: 16 / 8; width: 100%; }

/* Real images dropped into slots */
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.toc-card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-grid img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-sm); display: block;
}
.gallery-slideshow .hero-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Captioned, clickable gallery items */
.gallery-item { margin: 0; cursor: zoom-in; display: flex; flex-direction: column; }
.gallery-item img { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.gallery-item:hover img { box-shadow: var(--shadow); transform: translateY(-2px); }
.gallery-item figcaption {
  font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4;
  padding: 0.5rem 0.15rem 0;
}
.hero-slide img { cursor: zoom-in; }

/* Fullscreen lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--lightbox-bg);
  opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-figure { margin: 0; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 60px rgba(0,0,0,0.55); }
.lightbox-caption { color: var(--on-dark); font-size: 0.98rem; margin-top: 1rem; text-align: center; max-width: 72ch; min-height: 1.2em; padding: 0 1rem; }
.lightbox-close, .lightbox-nav {
  position: fixed; background: rgba(0,0,0,0.42); color: #fff; border: none; cursor: pointer;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(0,0,0,0.72); }
.lightbox-close { top: 18px; right: 18px; width: 46px; height: 46px; font-size: 1.7rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 2rem; }
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }
.lightbox-counter { position: fixed; top: 22px; left: 22px; color: var(--on-dark); font-size: 0.85rem; opacity: 0.8; }
@media (max-width: 560px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox-img { max-height: 72vh; }
}

/* ============================================================================
   HEADER (shared)
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.35rem; text-decoration: none; }
.brand-kyrza { display: inline-flex; align-items: center; text-decoration: none; }
/* Mark fills the 64px header bar, leaving 4px above and below (centered). */
.brand-mark {
  height: 56px; width: auto; display: block;
  transition: opacity 0.15s ease;
}
.brand-kyrza:hover .brand-mark { opacity: 0.78; }
.brand-home { display: inline-flex; align-items: center; text-decoration: none; }
.brand-home::before {
  content: ""; display: inline-block;
  width: 1px; height: 18px; background: rgba(255,255,255,0.28);
  margin: 0 0.6rem 0 0.35rem;
}
.brand-text { font-family: var(--serif); color: var(--cream); font-size: 1.05rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 1.25rem; }
.header-actions a { color: var(--tone-100); text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.header-actions a:hover { color: #fff; }
/* Header CTA (Start / Home): a little slimmer than a body .btn so it doesn't crowd the 64px bar. */
.header-actions .btn { padding: 0.6rem 1.2rem; font-size: 0.92rem; }

/* ============================================================================
   HERO
   ========================================================================= */
.hero { position: relative; background: var(--tone-900); color: #fff; overflow: hidden; }
.hero-slideshow { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide .ph { width: 100%; height: 100%; border: none; border-radius: 0;
  background: repeating-linear-gradient(45deg, var(--hero-ph-a) 0 18px, var(--hero-ph-b) 18px 36px); color: var(--tone-100); }
.hero-slide .ph span { font-size: 0.95rem; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--hero-shade-top) 0%, var(--hero-shade-bottom) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  min-height: clamp(460px, 72vh, 680px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 4rem 0;
}
.hero h1 { color: #fff; max-width: 16ch; }
.hero .subhead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--tone-100); max-width: 60ch; margin: 1.2rem 0 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* slideshow controls */
.slideshow-dots { position: absolute; z-index: 3; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.slideshow-dots button {
  width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.7);
  background: transparent; cursor: pointer; padding: 0; transition: background 0.2s;
}
.slideshow-dots button.is-active { background: #fff; }
.slideshow-arrow {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff; font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.slideshow-arrow:hover { background: rgba(0,0,0,0.6); }
.slideshow-arrow.prev { left: 18px; }
.slideshow-arrow.next { right: 18px; }
.hero-gallery-btn {
  position: absolute; z-index: 3; bottom: 14px; right: 18px;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.95rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.55); background: rgba(0,0,0,0.4);
  color: #fff; font: inherit; font-size: 0.85rem; font-weight: 600;
  backdrop-filter: blur(2px); transition: background 0.2s, border-color 0.2s;
}
.hero-gallery-btn:hover { background: rgba(0,0,0,0.65); border-color: #fff; }
.hero-gallery-btn span { font-size: 1.05em; line-height: 1; }

/* ============================================================================
   PROJECT SNAPSHOT
   ========================================================================= */
.snapshot { background: var(--cream); }
.snapshot-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: start; }
.specs-card {
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.75rem 2rem; box-shadow: var(--shadow-sm);
}
.specs-card h3 { margin-top: 0; }
.specs-list { list-style: none; margin: 0; padding: 0; }
.specs-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-size: 0.96rem;
}
.specs-list li:last-child { border-bottom: none; }
.specs-list .k { color: var(--ink-soft); font-weight: 500; }
.specs-list .v { color: var(--tone-900); font-weight: 600; text-align: right; }
.snapshot-note {
  background: var(--tone-900); color: var(--tone-100);
  border-radius: var(--radius); padding: 1.75rem 2rem; align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
}
.snapshot-note h3 { color: #fff; margin-top: 0; }
.snapshot-note p { margin-bottom: 1.1rem; }
.snapshot-note p:last-child { margin-bottom: 0; }

/* ============================================================================
   TABLE OF CONTENTS
   ========================================================================= */
.toc { background: linear-gradient(180deg, var(--cream) 0%, var(--toc-end) 100%); }
.toc-head { text-align: center; max-width: 60ch; margin: 0 auto 2.75rem; }
.toc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}
.toc-card {
  display: flex; flex-direction: column;
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none;
  color: inherit; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.toc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--tone-300); }
.toc-card .ph { border-radius: 0; border-left: none; border-right: none; border-top: none; }
.toc-card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.toc-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: flex-start;
  font-family: var(--sans); font-weight: 700; font-size: 0.78rem;
  color: #fff; background: var(--tone-700);
  border-radius: 999px; padding: 0.2rem 0.7rem; letter-spacing: 0.03em;
}
.toc-card h3 { margin: 0; font-size: 1.18rem; }
.toc-card p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); flex: 1; }
.toc-time {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600; color: var(--tone-500);
  margin-top: 0.3rem;
}

/* ============================================================================
   FOOTER (shared)
   ========================================================================= */
.site-footer {
  background: var(--ink); color: var(--tone-100);
  padding: 3rem 0 2.5rem; margin-top: 0;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: center; }
.site-footer h4 { color: #fff; margin: 0 0 0.4rem; font-family: var(--serif); }
.site-footer p { margin: 0; font-size: 0.9rem; opacity: 0.8; }
.site-footer a { color: var(--tone-300); }

/* ============================================================================
   STEP PAGES (sidebar + content) — used in Phase 2
   ========================================================================= */
.step-page { padding-top: 2.5rem; padding-bottom: 3.5rem; }
.step-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }
/* Pin the sidebar as the page scrolls. Sticky lives on the <aside> (not the
   inner nav) so its containing block is the full-height grid, giving it room
   to travel. top equals the aside's natural resting offset (65px header +
   2.5rem .step-page padding) so it locks immediately without drifting upward. */
.step-layout aside { position: sticky; top: calc(65px + 2.5rem); align-self: start; }

.build-sidebar {
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1rem; box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.build-sidebar h4 {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--tone-500); margin: 0 0 0.75rem; padding: 0 0.5rem;
}
.build-sidebar ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.build-sidebar li { margin: 0; }
.build-sidebar a {
  display: flex; gap: 0.6rem; align-items: baseline;
  padding: 0.5rem 0.6rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.3;
  transition: background 0.15s, color 0.15s;
}
.build-sidebar a:hover { background: var(--tone-100); color: var(--tone-900); }
.build-sidebar a .n { font-weight: 700; color: var(--tone-300); min-width: 1.4em; font-size: 0.85rem; }
.build-sidebar li.is-current a { background: var(--tone-700); color: #fff; }
.build-sidebar li.is-current a .n { color: var(--tone-100); }

.step-content { min-width: 0; }
.step-header { border-bottom: 2px solid var(--line); padding-bottom: 1.5rem; margin-bottom: 2rem; }
.step-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; margin-bottom: 0.5rem; }
.step-badge {
  font-family: var(--sans); font-weight: 700; font-size: 0.8rem; color: #fff;
  background: var(--tone-700); border-radius: 999px; padding: 0.25rem 0.8rem;
}
.step-time-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 600; color: var(--tone-500);
  background: var(--tone-100); border-radius: 999px; padding: 0.25rem 0.8rem;
}
.step-purpose { font-size: 1.1rem; color: var(--ink-soft); max-width: 65ch; }

.content-block { margin-bottom: 2.5rem; }
.content-block h2 { margin: 0 0 0.9rem; }
.content-block ul, .content-block ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.content-block li { margin-bottom: 0.4rem; }

/* Tips block */
.tips {
  background: var(--ok-tint); border: 1px solid var(--ok-line); border-left: 4px solid var(--ok);
  border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin: 0 0 2.5rem;
}
.tips h3 { color: var(--ok-deep); margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.tips ul { margin: 0; padding-left: 1.2rem; }
.tips li { margin-bottom: 0.35rem; }

/* Mistakes & Fixes callout */
.callout {
  background: var(--warn-tint); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin: 0 0 2rem;
}
.callout h3 { color: var(--warn-deep); margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.callout p:last-child { margin-bottom: 0; }
.callout .fix { font-weight: 600; color: var(--ok-deep); }

/* Spec / key-instruction box */
.keybox {
  background: var(--tone-900); color: var(--tone-100);
  border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 0 0 2.5rem;
}
.keybox h3 { color: #fff; margin: 0 0 0.7rem; }
.keybox ul { margin: 0; padding-left: 1.2rem; }
.keybox li { margin-bottom: 0.35rem; }

/* Contained slideshow (final gallery on step 15) */
.gallery-slideshow {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  margin: 0 0 2.5rem; background: var(--tone-900);
}
.gallery-slideshow .hero-slideshow { position: absolute; inset: 0; }
.gallery-slideshow .hero-slide .ph { border-radius: 0; border: none; }

/* Image gallery on step pages */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin: 0 0 2.5rem;
}
.gallery-grid .ph { width: 100%; }

/* Inline "view images" CTA — opens a challenge-specific lightbox subset.
   The subset's <img data-lightbox> live in a hidden [data-lightbox-set]. */
[data-lightbox-set] { display: none; }
.inline-gallery-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-weight: 600; line-height: 1.3;
  color: var(--tone-700); background: var(--cream-card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.85rem; margin: 0.25rem 0;
  cursor: pointer; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease;
}
.inline-gallery-cta:hover { background: var(--tone-100); border-color: var(--tone-300); }
.inline-gallery-cta::before { content: "\25A3"; font-size: 1.05em; line-height: 1; }
.inline-gallery-cta::after { content: "\2192"; opacity: 0.7; }

/* Prev / next step nav */
.step-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 2px solid var(--line); padding-top: 1.75rem; margin-top: 1rem; }
.step-nav a {
  display: flex; flex-direction: column; gap: 0.2rem; text-decoration: none;
  padding: 0.9rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream-card); max-width: 48%; transition: border-color 0.15s, transform 0.15s;
}
.step-nav a:hover { border-color: var(--tone-300); transform: translateY(-2px); }
.step-nav .dir { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tone-500); font-weight: 600; }
.step-nav .ttl { font-weight: 600; color: var(--tone-900); }
.step-nav .next { text-align: right; margin-left: auto; }

/* ============================================================================
   TOOLS & MATERIALS FULL GUIDE (tools-and-materials.html)
   ========================================================================= */
.tools-page-head { padding-bottom: 1.5rem; }
.tools-page-head h1 { max-width: 20ch; }
.disclosure {
  font-size: 0.85rem; color: var(--ink-soft); max-width: 72ch;
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-top: 1.25rem;
}
.tools-toc {
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2.5rem;
}
.tools-toc-label {
  display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700; margin-bottom: 0.85rem;
}
.tools-toc ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.35rem 1.25rem;
}
.tools-toc a {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  text-decoration: none; color: var(--tone-900); font-weight: 600; font-size: 0.95rem;
  padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); transition: background 0.15s;
}
.tools-toc a:hover { background: var(--tone-100); }
.tools-toc-count {
  font-size: 0.78rem; font-weight: 700; color: var(--ink-soft);
  background: var(--tone-100); border-radius: 999px; padding: 0.05rem 0.5rem;
}
.tool-cat { margin-bottom: 3rem; scroll-margin-top: 84px; }
.tool-cat h2 { margin: 0 0 1.25rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--line); }
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}
.tool-card {
  display: flex; flex-direction: column;
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  scroll-margin-top: 84px;
}
.tool-card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.tool-card .ph { border-radius: 0; border-left: none; border-right: none; border-top: none; }
.tool-card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.tool-card-body h3 { margin: 0; font-size: 1.15rem; }
.tool-card-body p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.tool-used { font-size: 0.84rem !important; }
.tool-buy { margin-top: auto; align-self: flex-start; font-size: 0.88rem; padding: 0.6rem 1.1rem; }
.tool-buys { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.tool-buys .tool-buy { margin-top: 0; }

/* ============================================================================
   BUILD PROGRESS (progress.js — localStorage, per-browser)
   ========================================================================= */
.resume-banner {
  background: var(--tone-700); color: var(--tone-100);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.resume-banner .container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding-top: 0.8rem; padding-bottom: 0.8rem; font-size: 0.95rem;
}
.resume-banner .btn { padding: 0.55rem 1.15rem; font-size: 0.88rem; }

.toc-progress { max-width: 560px; margin: 0 auto 2.25rem; text-align: center; }
.toc-progress-label { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.toc-progress-track {
  height: 10px; border-radius: 999px; background: var(--track);
  border: 1px solid var(--line); overflow: hidden;
}
.toc-progress-fill {
  height: 100%; border-radius: 999px; min-width: 4px;
  background: linear-gradient(90deg, var(--tone-500), var(--accent));
  transition: width 0.4s ease;
}
.toc-card.is-done { border-color: var(--ok); }
.toc-card.is-done .toc-step-num { background: var(--ok); }

.build-sidebar li.is-done a .t::after { content: " ✓"; color: var(--ok); font-weight: 700; }
.build-sidebar li.is-done.is-current a .t::after { color: var(--ok-light); }

.step-complete {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  background: var(--cream-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 0 0 1.75rem;
}
.step-complete-btn {
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  color: var(--tone-700); background: transparent;
  border: 1.5px solid var(--tone-300); border-radius: 999px;
  padding: 0.6rem 1.3rem; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.step-complete-btn:hover { background: var(--tone-100); }
.step-complete-btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-complete-note { font-size: 0.85rem; color: var(--ink-soft); }

/* ============================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 880px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .step-layout { grid-template-columns: 1fr; }
  /* Content first on small screens; the step list follows as an "up next" map */
  .step-layout aside { order: 2; position: static; }
  .build-sidebar {
    position: static; max-height: none;
    margin-top: 2rem; margin-bottom: 0;
  }
  .build-sidebar ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.15rem; }
}
@media (max-width: 560px) {
  /* Keep the Tools + Materials link reachable from the header on phones */
  .header-actions a:not(.btn):not([href$="tools-and-materials.html"]) { display: none; }
  .header-actions { gap: 0.6rem; }
  .header-actions a[href$="tools-and-materials.html"] { font-size: 0.82rem; white-space: nowrap; }
  .brand { white-space: nowrap; }
  .brand-text { font-size: 1rem; }
  /* Keep the Kyrza logo (route back to the hub) reachable on phones */
  .brand-mark { height: 48px; }
  .header-actions .btn { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .slideshow-arrow { display: none; }
  .step-nav { flex-direction: column; }
  .step-nav a { max-width: 100%; }
}

/* ============================================================================
   ENGINE ADDITIONS (not in Rosewood)
   ========================================================================= */

/* Portrait photos in 16:9 slideshows: show the whole frame instead of
   cropping it to a sliver (slideshow.js tags them .is-portrait on load). */
.hero-slide img.is-portrait,
.gallery-slideshow .hero-slide img.is-portrait { object-fit: contain; background: var(--tone-900); }

/* TOC card without a photo yet */
.toc-card .ph.toc-card-img { aspect-ratio: 4 / 3; }

/* Companion / cross-link panel ("Part 2: the sheaths") */
.companion {
  display: flex; gap: 1.1rem; align-items: center;
  background: var(--cream-card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 1.1rem 1.35rem; margin: 0 0 2.5rem;
  text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s;
}
a.companion:hover { border-color: var(--tone-300); transform: translateY(-2px); }
.companion .companion-kicker {
  display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--tone-500);
}
.companion strong { font-family: var(--serif); font-size: 1.15rem; color: var(--tone-900); }
.companion p { margin: 0.25rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.companion .companion-arrow { margin-left: auto; font-size: 1.4rem; color: var(--tone-500); }

/* Feature sidebar ("Meet the Beast") */
.feature-aside {
  display: grid; grid-template-columns: 200px 1fr; gap: 1.25rem; align-items: center;
  background: var(--tone-900); color: var(--tone-100);
  border-radius: var(--radius); padding: 1.25rem; margin: 0 0 2.5rem;
}
.feature-aside img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) / 2); }
.feature-aside .ph { aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, var(--hero-ph-a) 0 14px, var(--hero-ph-b) 14px 28px); color: var(--tone-100); border-color: var(--tone-500); }
.feature-aside h3 { color: #fff; margin: 0 0 0.4rem; }
.feature-aside p { margin: 0 0 0.75rem; font-size: 0.95rem; }
.feature-aside .btn { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
@media (max-width: 560px) { .feature-aside { grid-template-columns: 1fr; } }

/* Spec comparison table (e.g. stabilized vs raw wood) */
.compare-table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: 0.93rem; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
.compare-table thead th { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tone-500); border-bottom: 2px solid var(--line); }
.compare-table tbody th { color: var(--tone-900); font-weight: 600; white-space: nowrap; }
.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }

/* Labeled layer diagram (inline SVG; Leather Step 1) */
.layer-diagram { margin: 1.25rem 0 0; background: var(--cream-card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1rem 0.75rem; }
.layer-diagram svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
.layer-diagram figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.5rem; }
.layer-diagram .ld-layer rect { stroke: var(--tone-700); stroke-width: 1.5; }
.layer-diagram .ld-wrap rect  { fill: var(--tone-500); }
.layer-diagram .ld-front rect { fill: var(--tone-300); }
.layer-diagram .ld-welt rect  { fill: var(--tone-100); }
.layer-diagram .ld-back rect  { fill: var(--tone-100); }
.layer-diagram .ld-layer text { fill: var(--tone-900); font-size: 15px; font-weight: 600; }
.layer-diagram .ld-layer text.ld-sub { fill: var(--ink-soft); font-size: 12px; font-weight: 400; }
.layer-diagram .ld-cavity rect { fill: none; stroke: var(--tone-500); stroke-dasharray: 4 4; }
.layer-diagram .ld-cavity text { fill: var(--tone-500); font-size: 12px; font-style: italic; }
.layer-diagram .ld-stitch line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 2 5; }
.layer-diagram .ld-note { fill: var(--ink-soft); font-size: 12px; }
.layer-diagram .ld-skin rect { fill: var(--tone-300); }
.layer-diagram .ld-core rect { fill: var(--tone-100); }
.layer-diagram .ld-fold-edge { fill: none; stroke: var(--tone-700); stroke-width: 17; }
.layer-diagram .ld-fold { fill: none; stroke: var(--tone-500); stroke-width: 14; }
.layer-diagram .ld-same,
.layer-diagram .ld-bracket { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.layer-diagram .ld-same { stroke-dasharray: 3 4; }
.layer-diagram .ld-clip rect { fill: var(--ink); }
.layer-diagram .ld-clip text { fill: var(--ink-soft); font-size: 12px; }
.layer-diagram .ld-total { fill: var(--tone-900); font-size: 14px; font-weight: 700; }
.layer-count { margin: 0.75rem 0 1rem; }
.layer-count li { margin-bottom: 0.5rem; }
.layer-photo { margin: 1.25rem 0 0; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); overflow: hidden; }
.layer-photo img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.layer-key-panel { background: var(--cream-card); border: 1px solid var(--line); border-top: 3px solid var(--tone-700); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 1.1rem 1.4rem 1rem; }
.layer-key-kicker { margin: 0 0 0.75rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tone-500); }
.layer-key { list-style: none; margin: 0; padding: 0; counter-reset: layer; display: grid; grid-template-rows: repeat(5, auto); grid-auto-flow: column; column-gap: 2rem; row-gap: 0.55rem; }
.step-content .layer-key { margin: 0; padding: 0; }
.layer-key li { counter-increment: layer; display: flex; align-items: baseline; gap: 0.6rem; margin: 0; font-size: 0.93rem; color: var(--ink-soft); line-height: 1.35; }
.layer-key li::before {
  content: counter(layer); flex: none; align-self: center;
  width: 1.55rem; height: 1.55rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--tone-700); color: #fff; font-size: 0.78rem; font-weight: 700;
  box-shadow: 0 0 0 2px var(--cream-card), 0 0 0 3px var(--tone-300);
}
.layer-key li strong { color: var(--ink); font-weight: 600; }
.layer-key-panel figcaption { margin: 0.95rem 0 0; padding-top: 0.75rem; border-top: 1px dashed var(--line); font-size: 0.88rem; font-style: italic; color: var(--ink-soft); }
@media (max-width: 640px) {
  .layer-key { grid-template-rows: none; grid-auto-flow: row; }
}

/* "What I'd do differently" box */
.differently {
  background: var(--cream-card); border: 1px solid var(--line); border-left: 4px solid var(--tone-500);
  border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin: 0 0 2rem;
}
.differently h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.differently p:last-child, .differently ul:last-child { margin-bottom: 0; }

/* Story slideshow: linear, captioned, no autoplay (The Beast page) */
.story { margin: 0 0 2.5rem; }
.story .gallery-slideshow { margin-bottom: 0; }
.story-caption {
  background: var(--cream-card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.35rem 1.15rem; min-height: 6.5rem;
}
.story-caption .story-count { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tone-500); }
.story-caption h3 { margin: 0.2rem 0 0.35rem; font-size: 1.15rem; }
.story-caption p { margin: 0; color: var(--ink-soft); }
.story .gallery-slideshow { border-radius: var(--radius) var(--radius) 0 0; }

/* Phones: longer journal names than "Rosewood Table" need the room. The header
   button is dropped (the hero CTA and the brand link cover it) and wide
   comparison tables scroll sideways instead of squeezing. */
@media (max-width: 560px) {
  .header-actions .btn { display: none; }
  .brand-text { font-size: 0.95rem; }
  .compare-table { min-width: 560px; }
}

/* Video grid (e.g. The Beast "See it run") */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.video-grid figure { margin: 0; }
.video-grid video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--tone-900); border-radius: var(--radius); }
.video-grid figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--ink-soft); }

/* "Projects it worked on" cross-link list (e.g. The Beast). Add one <li> per project. */
.used-on-heading { margin: 1.75rem 0 0.75rem; }
.used-on, .content-block .used-on { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.used-on a {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
  background: var(--cream-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color 0.15s, transform 0.15s;
}
.used-on a:hover { border-color: var(--tone-300); transform: translateY(-2px); }
.used-on img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.used-on span { display: block; padding: 0.75rem 0.9rem 0.9rem; font-size: 0.9rem; color: var(--ink-soft); }
.used-on strong { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--tone-900); margin-bottom: 0.15rem; }
