/* Colorado cabin project board — warm rustic, mobile-first */

:root {
  --pine-dark: #13261c;
  --pine: #1a3a2a;
  --pine-mid: #2c5a3f;
  --pine-soft: #3d6b4f;
  --wood-dark: #2b1d14;
  --wood: #5c3a21;
  --wood-mid: #8b5a2b;
  --wood-light: #c4a484;
  --cream: #f4efe6;
  --snow: #fffcf7;
  --paper: #faf6f0;
  --ink: #2b2118;
  --muted: #6b5a4c;
  --line: #e2d6c6;
  --amber: #c4842a;
  --amber-soft: #f3e3c4;
  --rust: #b5522a;
  --shadow: 0 10px 28px rgba(43, 33, 24, 0.12);
  --shadow-soft: 0 2px 10px rgba(43, 33, 24, 0.08);
  --radius: 14px;
  --page-max: 1600px;
  --page-pad: clamp(16px, 3vw, 40px);
  --header-h: 0px;
  --font-serif: "Fraunces", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #e8efe8 0%, var(--cream) 280px, var(--cream) 100%);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
}

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

button,
a {
  font-family: inherit;
}

/* ----- Header ----- */

.site-header {
  position: relative;
  color: var(--snow);
  overflow: hidden;
  background: linear-gradient(180deg, #163025 0%, var(--pine) 55%, #24382c 100%);
}

.header-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.header-sky svg {
  width: 100%;
  height: 100%;
  display: block;
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px var(--page-pad) 22px;
  padding-right: max(var(--page-pad), 240px);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brand-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 252, 247, 0.2);
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wood-light);
  font-weight: 600;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.example-banner {
  max-width: var(--page-max);
  width: calc(100% - 2 * var(--page-pad));
  margin: -18px auto 0;
  position: relative;
  z-index: 2;
  padding: 12px 16px;
  background: #f8eed6;
  color: #5a3a10;
  border: 1px solid #e4c98a;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(43, 33, 24, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.example-banner strong {
  font-weight: 700;
}

/* ----- Layout ----- */

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px var(--page-pad) 64px;
}

/* ----- Totals ----- */

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0 28px;
}

.stat {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-soft);
}

.stat-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pine);
}

.stat-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat--spent .stat-value { color: var(--wood); }
.stat--left .stat-value { color: var(--pine-mid); }

.budget-bar {
  grid-column: 1 / -1;
  height: 10px;
  background: #e8dfd2;
  border-radius: 999px;
  overflow: hidden;
}

.budget-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--wood-mid), var(--pine-mid));
  border-radius: inherit;
  width: 0;
  transition: width 0.4s ease;
}

.budget-bar[hidden] { display: none; }

.totals.is-empty .stat-value {
  color: var(--muted);
}


/* ----- The house ----- */

.house {
  margin: 0 0 32px;
}

.house-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 24px 36px;
  align-items: stretch;
}

.house-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
}

.house-head {
  display: block;
  margin: 0;
}

.house-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.house-address {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.house-hero {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #d8cbb8;
  cursor: zoom-in;
  box-shadow: var(--shadow-soft);
}

.house-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.house-hero:hover,
.house-hero:focus-visible {
  outline: 3px solid var(--pine-mid);
  outline-offset: 2px;
}

.house-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.house-facts li {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pine);
  box-shadow: var(--shadow-soft);
}

.house-board {
  display: grid;
  gap: 14px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.house-board-count {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.house-board-count strong {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--pine);
  margin-right: 4px;
}

.house-status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.house-status-counts li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.house-money {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.house-board-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.current-project {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.current-project:hover,
.current-project:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

.current-project:focus-visible {
  box-shadow: var(--shadow), 0 0 0 3px var(--pine-mid);
}

.current-kicker {
  margin: 0 0 12px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.current-main {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px 16px;
  flex: 1;
  align-items: stretch;
}

.current-thumb {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 10px;
  background: #d8cbb8;
}

.current-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.current-title-row {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
}

.current-copy h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.current-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
}

.current-next {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.4;
}

.current-copy .steps-summary {
  margin: 14px 0 0;
}

.current-progress {
  height: 8px;
  margin-top: 6px;
  background: #e8dfd2;
  border-radius: 999px;
  overflow: hidden;
}

.current-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wood-mid), var(--pine-mid));
}

.current-link {
  margin: auto 0 0;
  padding-top: 16px;
  color: var(--pine);
  font-weight: 700;
}

.project-budget-quiet {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.project-budget-quiet span + span::before {
  content: none;
}

.project-budget-note {
  flex-basis: 100%;
  font-style: italic;
}

.project-side .project-budget-quiet {
  margin: 0 0 20px;
  padding: 8px 2px 0;
}

@media (max-width: 800px) {
  .current-main {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .current-thumb {
    width: 76px;
    height: 76px;
  }
  .current-copy h3 {
    font-size: 1.25rem;
  }
}

.house-totals {
  margin: auto 0 0;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 10px;
}

.house-totals .stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  align-items: baseline;
  padding: 12px 16px;
}

.house-totals .stat-value {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  font-size: 1.4rem;
}

.house-totals .stat-note {
  grid-column: 1;
}

.house-totals .budget-bar {
  margin-top: 2px;
}

@media (max-width: 800px) {
  .house-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .house-hero {
    min-height: 0;
    aspect-ratio: 16 / 10;
    height: auto;
  }
}

.back-link {
  margin: 0 0 16px;
}

.back-link a {
  color: var(--pine);
  font-weight: 600;
  text-decoration: none;
}

.back-link a:hover,
.back-link a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.house-gallery {
  grid-template-columns: repeat(4, 1fr);
}

.house-gallery.is-collapsed .is-more {
  display: none;
}

.house-empty {
  margin: 0;
  padding: 20px 16px;
  color: var(--muted);
  background: var(--snow);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.show-all {
  display: inline-block;
  margin-top: 12px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--snow);
  color: var(--pine);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.show-all:hover,
.show-all:focus-visible {
  border-color: var(--pine-mid);
  outline: none;
}

.coming-soon {
  background: var(--snow);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 20px 18px;
  color: var(--muted);
}

.coming-soon-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  font-style: italic;
}

.coming-soon p:last-child {
  margin: 0;
}

/* ----- Filters ----- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 18px;
}

.toolbar h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--snow);
  color: var(--ink);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.filter:hover {
  border-color: var(--wood-light);
}

.filter.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--snow);
}

.filter .count {
  display: inline-block;
  margin-left: 4px;
  font-weight: 500;
  opacity: 0.75;
  font-size: 0.82em;
}

/* ----- Project rows ----- */

.project-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "photo body"
    "photo stats";
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 280px;
}

.project-row:hover,
.project-row:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

.project-row:focus-visible {
  box-shadow: var(--shadow), 0 0 0 3px var(--pine-mid);
}

.project-row-photo {
  position: relative;
  grid-area: photo;
  min-height: 260px;
  background: #d8cbb8;
}

.project-row-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.project-row-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-area: body;
  padding: 20px 22px 8px;
  min-width: 0;
}

.project-row-body h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.row-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.row-desc {
  margin: 0;
  max-width: 62ch;
}

.project-row-stats {
  grid-area: stats;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 22px 20px;
  min-width: 0;
}

.project-row-stats .row-stats {
  margin-top: 0;
}

.row-soon {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.row-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.row-stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.row-stat-value {
  display: block;
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pine);
  letter-spacing: -0.02em;
}

.row-progress {
  grid-column: 1 / -1;
  height: 8px;
  background: #e8dfd2;
  border-radius: 999px;
  overflow: hidden;
}

.row-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--wood-mid), var(--pine-mid));
  border-radius: inherit;
}

.row-stats-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.row-stats-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.row-status {
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.row-status .badge {
  position: static;
  text-transform: uppercase;
}

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--snow);
  color: var(--ink);
}

.badge-planned { background: #e7eef4; color: #2a4458; }
.badge-in-progress { background: var(--amber-soft); color: #6a450c; }
.badge-done { background: #dcecdc; color: #1a3a2a; }
.badge-not-started { background: #e6e1da; color: #5c534a; }
.badge-example { background: var(--pine); color: var(--snow); }

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

.card-body h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.priority-high { color: var(--rust); font-weight: 700; }
.priority-medium { color: var(--amber); font-weight: 700; }
.priority-low { color: var(--pine-soft); font-weight: 700; }

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.card-cost {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pine);
}

.card-soon {
  color: var(--muted);
  font-style: italic;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  background: var(--snow);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ----- Detail (hash route / overlay) ----- */

.detail {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(19, 38, 28, 0.55);
  overflow: auto;
  padding: 20px 12px 40px;
}

.detail.is-open {
  display: block;
}

.detail-panel {
  position: relative;
  max-width: var(--page-max);
  margin: 20px auto;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(43, 33, 24, 0.18);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.95);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.detail-close:hover,
.detail-close:focus-visible {
  background: var(--snow);
}

.detail-hero {
  aspect-ratio: 16 / 10;
  background: #d8cbb8;
  min-height: 180px;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-body {
  padding: 22px 24px 32px;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.detail-body h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-meta {
  margin: 0 0 14px;
  color: var(--muted);
}

.detail-body p.desc {
  margin: 0 0 22px;
  max-width: 62ch;
}

.detail-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  padding: 14px 16px;
  margin-bottom: 24px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.detail-totals div strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--pine);
}

.detail-totals div span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* Gallery */

.section-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.gallery button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #d8cbb8;
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
}

.gallery button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery button:hover,
.gallery button:focus-visible {
  outline: 3px solid var(--pine-mid);
  outline-offset: 1px;
}

/* Items */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--snow);
}

table.items {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.98rem;
}

table.items th,
table.items td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

table.items th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f3ece2;
  font-weight: 700;
}

table.items tr:last-child td {
  border-bottom: 0;
}

table.items tfoot td {
  font-weight: 700;
  background: #f3ece2;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-cell img,
.item-ph {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8dfd2;
  flex-shrink: 0;
}

.item-ph {
  display: inline-block;
}

.item-cell a {
  color: var(--pine-mid);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.store {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bought,
.not-bought {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.bought { color: var(--pine-mid); }
.not-bought { color: var(--muted); }

.check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pine-mid);
  color: white;
  font-size: 12px;
}

.open-check {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #c4b8a6;
  border-radius: 50%;
}

/* Lightbox */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(19, 14, 10, 0.92);
  padding: 24px;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--snow);
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  background: var(--snow);
}

.lightbox-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--snow);
  font-weight: 600;
  letter-spacing: 0.04em;
}


/* ----- Project subpage ----- */

.project-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #d8cbb8;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}

.project-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.project-intro h2 {
  margin: 8px 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.project-section {
  margin: 28px 0;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
  gap: 12px 48px;
  align-items: start;
}

.project-layout .project-section {
  margin-top: 12px;
}

.project-side .project-stats {
  margin: 12px 0 20px;
}

.project-side .project-section {
  margin-top: 0;
}

@media (max-width: 800px) {
  .project-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.project-details {
  margin: 0 0 14px;
  max-width: 62ch;
}

.project-details:last-child {
  margin-bottom: 0;
}

.project-stats {
  margin: 8px 0 28px;
  padding: 16px 18px 14px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.project-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 36px 0 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.project-pager a {
  color: var(--pine);
  font-weight: 600;
  text-decoration: none;
  max-width: 46%;
}

.project-pager a:hover,
.project-pager a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

.not-found {
  background: var(--snow);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
}

.not-found h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
}

.not-found a {
  color: var(--pine);
  font-weight: 600;
}

/* ----- Project steps ----- */

.project-steps--compact {
  padding-top: 2px;
}

.steps-summary {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.step-name {
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}

.project-steps--compact .step-name {
  font-size: 0.86rem;
}

.project-steps--compact .badge {
  flex-shrink: 0;
  position: static;
  font-size: 0.65rem;
  padding: 2px 7px;
  text-transform: uppercase;
}

.step-bar {
  height: 6px;
  margin-top: 5px;
  background: #e8dfd2;
  border-radius: 999px;
  overflow: hidden;
}

.step-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c5bdb2;
}

.step-bar-in-progress span {
  background: linear-gradient(90deg, var(--amber), #e0a54a);
}

.step-bar-done span {
  background: linear-gradient(90deg, var(--pine-mid), var(--pine-soft));
}

.project-steps--full {
  margin-top: 0;
}

.project-steps--full .steps-summary {
  margin-bottom: 4px;
}

.project-steps--full .steps-list {
  gap: 0;
}

.project-steps--full .step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.project-steps--full .step:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.project-steps--full .step-head {
  grid-column: 1 / -1;
}

.project-steps--full .step-name {
  font-size: 1rem;
}

.project-steps--full .badge {
  position: static;
  text-transform: uppercase;
}

.project-steps--full .step-bar {
  height: 8px;
  margin-top: 2px;
  align-self: center;
}

.step-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 2.6em;
  text-align: right;
  align-self: center;
}

.project-side .project-steps--full {
  margin: 0 0 20px;
  padding: 16px 18px 14px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* Footer */


.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad) 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

body.modal-open {
  overflow: hidden;
}

/* ----- Wide screens ----- */

@media (min-width: 1100px) {
  .project-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(250px, 0.8fr);
    grid-template-rows: 1fr;
    grid-template-areas: "photo body stats";
    min-height: 300px;
  }
  .project-row-body {
    padding: 22px 24px 22px;
  }
  .project-row-stats {
    margin: 0;
    padding: 22px;
    border-top: 0;
    border-left: 1px solid var(--line);
    justify-content: center;
  }
  .project-row-stats .row-stats {
    border-top: 0;
    padding-top: 0;
  }
}

@media (min-width: 721px) {
  .mobile-total { display: none; }
}

/* ----- Mobile ----- */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-inner { padding: 18px var(--page-pad) 18px; padding-right: 128px; }
  .wrap { padding: 16px var(--page-pad) 48px; }
  .example-banner { width: calc(100% - 2 * var(--page-pad)); }
  .totals { grid-template-columns: 1fr; gap: 10px; }
  .stat { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; align-items: baseline; }
  .stat-value { grid-column: 2; grid-row: 1 / span 2; font-size: 1.45rem; }
  .budget-bar { margin-top: 4px; }
  .house-split {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .house-hero {
    min-height: 0;
    aspect-ratio: 16 / 10;
    height: auto;
  }
  .house-head { margin-bottom: 0; }
  .house-money { gap: 8px; }
  .project-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "photo"
      "body"
      "stats";
    min-height: 0;
  }
  .project-row-photo {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
  .project-row-body { padding: 16px 16px 8px; }
  .project-row-stats { margin: 0 16px 16px; }
  .project-hero {
    aspect-ratio: 16 / 10;
    max-height: none;
  }
  .project-layout { grid-template-columns: 1fr; }
  .project-pager a { max-width: 100%; }
  .pager-next { text-align: left; margin-left: 0; }
  .house-gallery { grid-template-columns: repeat(2, 1fr); }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .detail { padding: 0; }
  .detail-panel { margin: 0; min-height: 100%; border-radius: 0; }
  .detail-body { padding: 18px 16px 40px; }
  .detail-hero { aspect-ratio: 16 / 10; }

  /* Stacked item cards instead of a squeezed table */
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.items,
  table.items tbody,
  table.items tr,
  table.items td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  table.items thead,
  table.items tfoot { display: none; }
  table.items tr {
    background: var(--snow);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 6px 0 8px;
  }
  table.items td {
    border: 0;
    padding: 6px 14px;
    text-align: left !important;
  }
  table.items td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 7.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }
  table.items td:first-child::before { display: none; }
  .mobile-total {
    display: block;
    margin-top: 8px;
    padding: 14px 16px;
    background: var(--snow);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* House details on the left of the photo, top-aligned (wide screens). */
@media (min-width: 801px) {
  .house-split { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.35fr); }
  .house-aside { order: -1; justify-content: flex-start; }
}
