/* ---------------------------------------------------------------------------
   Third Floor Renovation
   Neutral graphite + a soft clay accent. Change the tokens below and the
   whole page follows.
   --------------------------------------------------------------------------- */

:root {
  --fg: #ecebe8;
  --fg-muted: #c0bdb7;
  --fg-faint: #8b8781;
  --accent: #cf9a6d;
  --accent-lo: #e2b88f;
  --accent-ink: #2a2119;
  --link: #ddd0c2;
  --plate: #e6e6e6;
  --plate-ink: #4a4744;
  --danger: #d9695f;
  --ok: #a9c9a4;
  --hero-band: linear-gradient(155deg, #34312d 0%, #1b1a18 100%);
  --page: linear-gradient(180deg, #1a1a19 0%, #121211 100%);
  --hairline: rgba(255, 255, 255, 0.09);
  --edge: rgba(255, 255, 255, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 10px;
  --r-md: 15px;
  --r-lg: 20px;

  --shadow-media: 5px 5px 5px rgba(63, 63, 63, 0.85);
  --shadow-card: 0 15px 15px rgba(0, 0, 0, 0.28);

  /* thumbnail size in the progress strips */
  --strip: 124px;
  /* thumbnail size in the "finished space" strips */
  --strip-main: 300px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font);
  overflow-x: hidden;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 { text-transform: uppercase; font-weight: 700; }

.wrap { max-width: 1170px; margin: 0 auto; padding: 0 15px; }
.center { text-align: center; }

/* --- sticky bar --- */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--hairline);
}
.bar-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand {
  font-weight: 700; text-transform: uppercase; font-size: 20px;
  letter-spacing: 0.08em; color: var(--fg); white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 22px; overflow-x: auto; }
.nav a {
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg-muted); white-space: nowrap;
}
.nav a.is-accent { color: var(--accent); }

/* --- hero --- */
.hero { background: var(--hero-band); padding: 96px 15px 84px; text-align: center; }
/* When hero.background is set in _data/page.yml, an <img class="hero-photo">
   sits super-blurred behind the heading, under a dark scrim that keeps the
   text readable. The gradient band stays as the fallback. (A real <img>, not
   a CSS url(), so the relative path resolves against the page, not the
   stylesheet.) The negative inset hides the blur's faded edges. */
.hero.has-photo { position: relative; overflow: hidden; }
/* Fit-to-width: the photo spans the hero's width at its natural aspect,
   centered vertically, so only the vertical overflow is cropped. The small
   horizontal bleed hides the blur's faded edges. */
.hero-photo {
  position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
  width: calc(100% + 40px); height: auto;
  filter: blur(42px) saturate(1.2) brightness(0.8);
}
.hero.has-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(155deg, rgba(27, 26, 24, 0.2) 0%, rgba(18, 18, 17, 0.55) 100%);
}
.hero-in { max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(38px, 7vw, 72px); line-height: 1.06;
  letter-spacing: 0.03em; margin: 26px 0 0;
}
.lede {
  font-size: 20px; line-height: 1.7; color: #cfccc6;
  margin: 26px auto 0; max-width: 62ch; text-wrap: pretty;
}
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 44px; margin-top: 48px; }
.stat-v { font-weight: 700; font-size: 44px; line-height: 1; }
.stat-l {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 12px; color: #a6a29b; margin-top: 4px;
}

/* --- pills --- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 1000px;
  font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.pill-dark { background: rgba(0, 0, 0, 0.55); color: var(--fg); border: 1px solid var(--edge); }
.pill-accent { background: var(--accent); color: var(--accent-ink); }

/* --- rooms --- */
.room { padding: 70px 15px; border-top: 1px solid var(--hairline); }
.room:first-of-type { border-top: 0; }
.room [id], .room, section[id] { scroll-margin-top: 84px; }
.room-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.room-head h2 { font-size: 38px; letter-spacing: 0.04em; margin: 0; }
.meta { font-family: var(--mono); font-size: 14px; color: var(--fg-faint); }
.body {
  font-size: 20px; line-height: 1.7; color: var(--fg-muted);
  margin: 18px 0 44px; max-width: 68ch; text-wrap: pretty;
}

/* --- before / after --- */
.ba {
  margin: 0 0 16px; position: relative; aspect-ratio: 4 / 3;
  border-radius: var(--r-md); overflow: hidden;
  border: 2px solid #fff; box-shadow: var(--shadow-media);
  cursor: ew-resize; touch-action: none; user-select: none; background: #000;
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-clip { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.ba-l { position: absolute; left: 14px; bottom: 14px; pointer-events: none; }
.ba-r { position: absolute; right: 14px; bottom: 14px; pointer-events: none; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: #fff; box-shadow: 0 0 10px #0c0c0c; pointer-events: none;
}
.ba-handle span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--plate-ink);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.1)) drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
.cap { font-family: var(--mono); font-size: 14px; color: var(--fg-faint); margin: 0 0 52px; }

/* --- progress strip --- */
.label {
  font-size: 13px; letter-spacing: 0.14em; color: var(--fg-faint);
  margin: 0 0 16px; font-weight: 400;
}
.strip { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb {
  width: var(--strip); aspect-ratio: 1; padding: 0;
  border: 2px solid #fff; border-radius: var(--r-sm); overflow: hidden;
  box-shadow: var(--shadow-media); cursor: zoom-in; background: #000;
}
.thumb img,
.thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb { position: relative; }
.thumb .play {
  position: absolute; inset: 0; margin: auto; width: 34px; height: 34px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; padding-left: 2px;
  pointer-events: none;
}
/* --- "finished space" strip: same chrome as progress, just bigger --- */
.strip-main { margin-bottom: 52px; }
.thumb-main { width: var(--strip-main); aspect-ratio: 4 / 3; }

.thumb .tdate {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: #fff;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.72));
  pointer-events: none; text-align: left;
}

/* --- costs --- */
.costs { background: var(--hero-band); padding: 84px 15px; }
.costs-head { text-align: center; max-width: 620px; margin: 0 auto; }
.costs-head h2 {
  font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08;
  letter-spacing: 0.03em; margin: 20px 0 0;
}
.iconplate {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--plate); color: var(--plate-ink); font-size: 33px;
}
.card {
  background: rgba(0, 0, 0, 0.45); border: 1px solid var(--edge);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px); padding: 20px 22px;
}
.lock { max-width: 460px; margin: 36px auto 0; }
.lock label {
  display: block; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 12px; color: #a6a29b; margin-bottom: 10px;
}
.lock-row { display: flex; gap: 10px; }
.lock-row input {
  flex: 1; min-width: 0; padding: 12px 14px; min-height: 46px;
  border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.4); color: var(--fg);
  font-family: var(--mono); font-size: 18px; letter-spacing: 0.2em;
}
.lock-row input::placeholder { color: rgba(255, 255, 255, 0.4); }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; min-height: 46px; border: none; border-radius: var(--r-sm);
  background: linear-gradient(0deg, var(--accent-lo) 0%, var(--accent) 100%);
  color: var(--accent-ink); font-family: var(--font); font-weight: 700; font-size: 16px;
  cursor: pointer; box-shadow: 0 0 10px rgba(207, 154, 109, 0.32); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.985); }
.err { display: flex; align-items: center; gap: 9px; font-size: 15px; color: #e6b0a6; margin: 14px 0 0; }
.err[hidden] { display: none; }
.err i { color: var(--danger); }
.fine { font-family: var(--mono); font-size: 13px; color: #8f8b84; margin: 16px 0 0; line-height: 1.6; }

.totals { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 44px 0 40px; }
.totals .tot { flex: 1 1 300px; text-align: center; padding: 26px 30px; }
.tot-v { font-weight: 700; font-size: clamp(44px, 7vw, 76px); line-height: 1.05; margin-top: 10px; }
.tot-d { font-weight: 700; font-size: clamp(30px, 4.5vw, 46px); line-height: 1.1; margin-top: 10px; }
.tot-d.is-under { color: var(--ok); }
.tot-d.is-over { color: #e6b0a6; }

.rm { margin-bottom: 14px; }
.rm-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding-bottom: 8px;
}
.rm-head h3 { font-size: 22px; margin: 0; letter-spacing: 0.04em; }
.rm-tots { text-align: right; }
.rm-total { font-family: var(--mono); font-size: 22px; color: var(--link); }
.rm-est { font-family: var(--mono); font-size: 12px; color: var(--fg-faint); margin-top: 2px; }
.task { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.task > summary {
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 0; cursor: pointer; list-style: none;
}
.task > summary::-webkit-details-marker { display: none; }
.task > summary > i { color: var(--accent); font-size: 13px; flex: none; width: 10px; }
.t-name { flex: 1 1 200px; font-size: 17px; line-height: 1.4; }
.t-date { font-family: var(--mono); font-size: 13px; color: var(--fg-faint); white-space: nowrap; }
.t-amt { font-family: var(--mono); font-size: 17px; white-space: nowrap; min-width: 96px; text-align: right; }
.t-body { padding: 4px 0 18px 24px; }
.t-meta { font-family: var(--mono); font-size: 13px; color: var(--fg-faint); margin-bottom: 10px; }
.t-item {
  display: flex; gap: 10px; align-items: baseline; font-size: 15px;
  color: var(--fg-muted); line-height: 1.5; padding: 3px 0;
}
.t-item::before { content: "\00b7"; color: var(--accent); flex: none; }
.t-iname { flex: 1 1 auto; min-width: 0; }
.t-idate {
  font-family: var(--mono); font-size: 12px; color: var(--fg-faint);
  white-space: nowrap; flex: none;
}
.t-iamt {
  font-family: var(--mono); font-size: 14px; white-space: nowrap;
  flex: none; min-width: 78px; text-align: right;
}
.cols { columns: 2; column-gap: 40px; }
.cols .t-item { break-inside: avoid; }

/* --- footer --- */
.foot { padding: 56px 15px; text-align: center; border-top: 1px solid var(--hairline); }
.foot p { font-family: var(--mono); font-size: 14px; color: var(--fg-faint); margin: 0; line-height: 1.7; }

/* --- lightbox --- */
.lb {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.93);
  display: flex; align-items: center; justify-content: center;
  padding: 64px; cursor: zoom-out;
}
.lb[hidden] { display: none; }
.lb video {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border: 2px solid #fff; box-shadow: var(--shadow-media); background: #000;
}
.lb video[hidden], .lb img[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border: 2px solid #fff; box-shadow: var(--shadow-media); }
.lb-btn {
  position: absolute; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(0, 0, 0, 0.55);
  color: var(--fg); font-size: 18px; cursor: pointer;
}
.lb-x { top: 16px; right: 20px; }
.lb-p { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-n { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-cap {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 13px; color: var(--fg-muted);
  text-align: center; max-width: 70ch; padding: 0 12px;
}
.lb-count { color: var(--fg-faint); }

@media (max-width: 640px) {
  :root { --strip: 96px; --strip-main: calc(50% - 6px); }
  /* A width-fit photo can't fill the tall narrow hero, so cover it again.
     (Explicit width/height: a replaced element ignores insets when auto.) */
  .hero-photo {
    top: -20px; transform: none;
    width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover;
  }
  .room { padding: 48px 15px; }
  .body { font-size: 18px; }
  .cols { columns: 1; }
  .lb { padding: 56px 12px; }
}
