/* ============================================================
   Homeowners page — additional styles
   Append these to style.css, or keep as a separate stylesheet
   loaded after it. Every color/font below reads from your
   existing CSS variables first (var(--token, fallback)) so if
   style.css already defines --ink / --paper / --rust etc. this
   file inherits them automatically. Fallback values match the
   palette visible on the live narrative page in case those
   variables don't exist yet under those exact names — rename
   the fallbacks to your real variable names once you confirm
   them from style.css.
   ============================================================ */

.page-homeowners {
  /* Corrected to the real variable names defined in style-v5.css's
     :root (--brick, --chalk, --line, etc.) — the previous fallback
     chain (--rust/--accent/--paper/--hairline/--font-*) referenced
     names that don't actually exist there, so this page had been
     rendering with guessed fallback colors instead of the site's
     real palette (most visibly, "--h-rust" was never actually the
     site's brown accent). */
  --h-paper: var(--chalk, #F3EFE5);
  --h-ink: var(--ink, #2A2420);
  --h-ink-soft: var(--ink-soft, #6b6459);
  --h-rust: var(--brick, #A85138);
  --h-card: var(--chalk-2, #EAE4D6);
  --h-line: var(--line, rgba(42, 36, 32, 0.14));
  --h-serif: var(--serif, 'Fraunces', serif);
  --h-sans: var(--sans, 'Work Sans', sans-serif);
  --h-mono: var(--mono, 'IBM Plex Mono', monospace);

  background: var(--h-paper);
  color: var(--h-ink);
}

/* This page has no sticky header of its own (see homeowners.html), so the
   side-index jump-nav — the only nav left on the page — is anchored near
   the top instead of style-v5.css's default vertical centering, reading
   as a slim nav bar rather than a floating mid-page element. */
.page-homeowners .side-index {
  top: 140px;
  transform: none;
}

/* ---------- Bridge header ---------- */
.bridge-header {
  position: relative;
  overflow: hidden;
  padding: 80px 0 80px;
  border-bottom: 1px solid var(--h-line);
}

/* Faint background photo — a separate opacity-0.07 layer rather than
   applying opacity to a background-image property directly (which
   isn't supported), so the text above stays fully opaque. */
.bridge-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('images/image7.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.07;
}

.bridge-header .section-inner {
  position: relative;
  z-index: 1;
}

/* Matches the size of index.html's own section headers (.who h2,
   .featured-head h2, .process-head h2 all use this exact same
   clamp(1.6rem, ~5.5vh, 2.6rem) formula) — this page's h1 was using a
   much larger, unrelated vw-based clamp that made it look oversized
   next to the rest of the site instead of like one of its section
   headers. */
.bridge-header h1 {
  font-family: var(--h-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 5.33vh, 2.6rem);
  line-height: 1.15;
  margin: 18px 0 24px;
  max-width: 16ch;
}

.bridge-header h1 em {
  color: var(--h-rust);
  font-style: italic;
}

.bridge-sub {
  font-family: var(--h-sans);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.15rem);
  color: var(--h-ink-soft);
  max-width: 52ch;
  line-height: 1.6;
}

.bridge-sub a {
  color: var(--h-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bridge-cross {
  font-family: var(--h-sans);
  font-size: 0.85rem;
  color: var(--h-ink-soft);
  margin-top: 16px;
}

.bridge-cross a {
  color: var(--h-rust);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Stages, expanded ---------- */
/* Same dot-grid technique as .featured's background in style-v5.css,
   applied to the whole section behind all six cards rather than a
   single card. */
.stages-full {
  padding: 60px 0 100px;
  background-color: var(--h-paper);
  background-image: radial-gradient(rgba(42, 36, 32, 0.12) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

.stages-head { margin-bottom: 48px; }
.stages-head h2 {
  font-family: var(--h-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2.4rem);
}

/* Three columns, two rows. Each card shows a thumbnail + ~3 lines of
   teaser text (title + 2-line clamped teaser). Clicking a card doesn't
   expand it in place (that fought the hover/layout of its neighbours) —
   instead its full text is copied by JS (homeowners.js) into the single
   shared .stage-modal overlay below, which sits on top of all six cards. */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.stage-card {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--h-line);
  border-radius: 4px;
  background: var(--h-paper);
  scroll-margin-top: 160px; /* keeps jump-nav targets clear of the sticky header */
  cursor: pointer;
  overflow: hidden; /* clips the sliding rollover layer below to the card's rounded corners */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  outline: none;
}

/* Rollover: the site's brown accent slides in from the left over the
   beige background, sitting behind the thumbnail/text (z-index 0 vs 1)
   so it reads as a color change rather than covering the content. */
.stage-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--h-rust);
  transform: translateX(-100%);
  transition: transform 0.45s ease;
}

.stage-card:hover,
.stage-card:focus-visible {
  border-color: var(--h-rust);
  box-shadow: 0 6px 18px rgba(42, 36, 32, 0.1);
}

.stage-card:hover::before,
.stage-card:focus-visible::before {
  transform: translateX(0);
}

.stage-card__thumb {
  position: relative;
  z-index: 1;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border-radius: 3px;
  overflow: hidden;
}

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

.stage-card:hover .stage-card__thumb img,
.stage-card:focus-visible .stage-card__thumb img {
  transform: scale(1.05);
}

.stage-card__body { position: relative; z-index: 1; flex: 1; min-width: 0; }

.stage-card .sk-num {
  font-family: var(--h-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--h-rust);
  transition: color 0.35s ease;
}

.stage-card .s-name {
  font-family: var(--h-serif);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 4px 0 4px;
  color: var(--h-ink);
  transition: color 0.35s ease;
}

.stage-card .s-teaser {
  font-family: var(--h-serif);
  font-style: italic;
  color: var(--h-ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.35s ease;
}

.stage-card:hover .sk-num,
.stage-card:focus-visible .sk-num,
.stage-card:hover .s-name,
.stage-card:focus-visible .s-name,
.stage-card:hover .s-teaser,
.stage-card:focus-visible .s-teaser {
  color: #fff;
}

/* Kept in the DOM only as the source JS copies from into the modal —
   never shown inline in the card itself. */
.stage-card .s-full { display: none; }

@media (max-width: 1100px) {
  .stages-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Stage detail modal ---------- */
.stage-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.stage-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.stage-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 36, 32, 0.55);
}

.stage-modal__panel {
  position: relative;
  display: flex;
  gap: 28px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 44px;
  background: var(--h-paper);
  border-radius: 6px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
  transform: translateY(16px);
  transition: transform 0.35s ease;
}

.stage-modal.is-open .stage-modal__panel { transform: translateY(0); }

.stage-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--h-line);
  background: var(--h-paper);
  color: var(--h-ink-soft);
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.stage-modal__close:hover { color: var(--h-rust); border-color: var(--h-rust); }

.stage-modal__thumb {
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  border-radius: 4px;
  overflow: hidden;
}

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

.stage-modal__body { flex: 1; min-width: 0; }

.stage-modal__num {
  font-family: var(--h-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--h-rust);
}

.stage-modal__name {
  font-family: var(--h-serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 8px 0 18px;
}

/* column-fill:balance (and no break-inside:avoid on the paragraphs
   below) makes even a single short paragraph split across both
   columns instead of piling entirely into the first one and leaving
   the second empty — shorter text just means shorter columns, not
   fewer of them. */
.stage-modal__text { column-count: 2; column-gap: 32px; column-fill: balance; }

.stage-modal__text p {
  font-family: var(--h-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--h-ink);
  margin: 0 0 14px;
}

.stage-modal__text p:last-child { margin-bottom: 0; }

@media (max-width: 780px) {
  .stage-modal__panel { flex-direction: column; padding: 30px; }
  .stage-modal__thumb { width: 100%; height: 160px; }
  .stage-modal__text { column-count: 1; }
}

@media (max-width: 640px) {
  .stages-grid { grid-template-columns: 1fr; }
  .stage-card { flex-direction: column; }
  .stage-card__thumb { width: 100%; height: 150px; }
  .stage-card:hover .s-full,
  .stage-card:focus-visible .s-full { column-count: 1; }
}

/* Cost calculator floating frame: moved to style-v5.css so every page
   (not just this one) can use it with a single shared definition — see
   that file's "Cost calculator floating frame" section. */

/* ---------- Tiers ---------- */
.tiers-section { padding: 60px 0 100px; background: var(--h-card); }

.tiers-head h2 {
  font-family: var(--h-serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.6vw + 1rem, 2.4rem);
  margin-bottom: 40px;
}

.tier-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  font-family: var(--h-mono);
  font-size: 0.8rem;
  color: var(--h-ink-soft);
  max-width: 900px;
  margin: 0 auto 8px;
  text-align: center;
}

.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.tier-card {
  background: var(--h-paper);
  border: 1px solid var(--h-line);
  border-radius: 4px;
  padding: 28px 26px 32px;
}

.tier-card--featured {
  border-color: var(--h-rust);
  box-shadow: 0 0 0 1px var(--h-rust);
}

.tier-card h3 {
  font-family: var(--h-serif);
  font-weight: 500;
  font-size: 1.6rem;
  margin: 10px 0 14px;
}

.tier-card p {
  font-family: var(--h-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--h-ink-soft);
}

/* Bracket visually spans the stage numbers included in each tier,
   proportionate to a 6-column grid: Core=1-4, Premium=1-5, Enhanced=1-6 */
.tier-card__range { margin-bottom: 14px; }
.tier-bracket {
  display: block;
  height: 4px;
  background: var(--h-rust);
  border-radius: 2px;
}
.tier-bracket--core     { width: 66%; }
.tier-bracket--premium  { width: 83%; }
.tier-bracket--enhanced { width: 100%; }

.tiers-note {
  text-align: center;
  margin-top: 36px;
  font-family: var(--h-sans);
  color: var(--h-ink-soft);
}
.tiers-note a { color: var(--h-rust); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 780px) {
  .tiers { grid-template-columns: 1fr; }
  .tier-scale { display: none; }
}

/* ---------- Visualisations & Joinery ---------- */
.extras { padding: 80px 0; }

.extras-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.extras-card {
  padding: 32px;
  border: 1px solid var(--h-line);
  border-radius: 4px;
}

.extras-card h3 {
  font-family: var(--h-serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 10px 0 14px;
}

.extras-card p {
  font-family: var(--h-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--h-ink-soft);
}

@media (max-width: 780px) {
  .extras-grid { grid-template-columns: 1fr; }
}

/* ---------- Cost calculator promo card ---------- */
.calc-promo { padding: 20px 0 100px; }

.guide-card--calc {
  max-width: 720px;
  margin: 0 auto;
  background: var(--h-card);
  border-radius: 6px;
  padding: 40px;
}

.guide-card--calc h3 {
  font-family: var(--h-serif);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 10px 0 12px;
}

.guide-card--calc p {
  font-family: var(--h-sans);
  color: var(--h-ink-soft);
  line-height: 1.6;
}

/* ---------- Lighter closing CTA (no qualify widget) ---------- */
.action--light {
  padding: 80px 0 100px;
  background: var(--h-paper);
  /* .action's base rule sets color:var(--chalk) — a pale color meant to
     sit on the dark photo background index.html's own #action section
     uses. This page's version has no photo, just plain paper, so that
     inherited chalk text (plus the equally pale contact-card borders
     and gold labels below) was rendering low-contrast on light-on-light.
     Re-asserted to the page's ink palette throughout. */
  color: var(--h-ink);
  position: static; /* narrative page uses parallax positioning; this page doesn't need it */
}

.action--light .action-head h2 {
  font-family: var(--h-serif);
  font-weight: 400;
  color: var(--h-ink);
}

.action--light .action-head h2 em { color: var(--h-rust); }

.action--light .action-head p { color: var(--h-ink-soft); }

.action--light .action-contact a {
  border-color: var(--h-line);
  color: var(--h-ink);
}

.action--light .action-contact a:hover {
  border-color: var(--h-rust);
  background: var(--h-card);
}

.action--light .action-contact .lbl { color: var(--h-rust); }

/* ---------- Footer ---------- */
.page-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--h-line);
  text-align: center;
}

.page-footer__links {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-family: var(--h-mono);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.page-footer__links a {
  color: var(--h-ink-soft);
  text-decoration: none;
}
.page-footer__links a:hover { color: var(--h-rust); }

.page-footer .disclaimer {
  max-width: 640px;
  margin: 0 auto 20px;
}
