/* =============================================================================
   BluPrint Longevity — Premium enhancement layer
   Loaded ON TOP of style.css on every page except Home.
   Adds richer, interactive section components while reusing all base tokens.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Reading progress bar (long pages)
   --------------------------------------------------------------------------- */
.readbar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 300;
  background: linear-gradient(90deg, var(--russet), var(--chestnut));
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Specimen plate — branded image placeholder (looks intentional, not a grey box)
   Swap the inner .plate__glyph for a real <img> later; keep the frame.
   --------------------------------------------------------------------------- */
.plate {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(196,168,130,0.28) 0%, rgba(196,168,130,0) 55%),
    linear-gradient(155deg, var(--linen) 0%, var(--oat) 100%);
  border: 1px solid rgba(140, 92, 53, 0.16);
  box-shadow:
    0 1px 2px rgba(35,21,8,0.04),
    0 24px 60px rgba(35,21,8,0.10);
  display: grid;
  place-items: center;
  isolation: isolate;
}
.plate--4x5 { aspect-ratio: 4 / 5; }
.plate--1x1 { aspect-ratio: 1 / 1; }
.plate--3x2 { aspect-ratio: 3 / 2; }
.plate--16x9 { aspect-ratio: 16 / 9; }
.plate--tall { aspect-ratio: 3 / 4; }

/* If a real image is dropped in, it covers the frame */
.plate > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

/* Register / measurement ticks in the corners — precision-instrument motif */
.plate__frame {
  position: absolute;
  inset: 14px;
  z-index: 1;
  pointer-events: none;
}
.plate__frame::before,
.plate__frame::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid rgba(140, 92, 53, 0.4);
}
.plate__frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.plate__frame::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.plate__glyph {
  position: relative;
  z-index: 1;
  width: clamp(56px, 12vw, 96px);
  opacity: 0.5;
  filter: saturate(0.9);
}
.plate__glyph svg,
.plate__glyph img { width: 100%; height: auto; display: block; }

.plate__caption {
  position: absolute;
  left: 20px; bottom: 18px;
  z-index: 1;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--russet);
  opacity: 0.8;
}

/* Soft ambient drift for parallax plates (JS sets --py) */
.plate[data-parallax] .plate__glyph {
  transform: translateY(var(--py, 0));
  transition: transform 0.1s linear;
}

/* ---------------------------------------------------------------------------
   Premium sub-hero — split display + media plate
   --------------------------------------------------------------------------- */
.phero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3rem, 7vh, 5.5rem));
  padding-bottom: var(--space-lg);
  background-color: var(--ivory);
  background-image: linear-gradient(180deg, var(--linen) 0%, var(--ivory) clamp(220px, 40vh, 460px));
  overflow: hidden;
}
.phero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.phero__eyebrow { margin-bottom: var(--space-sm); }
.phero__title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  line-height: 1.08;
  color: var(--coffee);
  margin-bottom: var(--space-sm);
}
.phero__lede {
  font-size: var(--text-md);
  line-height: 1.85;
  color: var(--coffee);
  opacity: 0.82;
  max-width: 52ch;
  margin-bottom: var(--space-sm);
}
.phero__note {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--russet);
  opacity: 0.9;
  max-width: 52ch;
}
.phero__media { position: relative; }
.phero__media .plate { width: 100%; }

/* Centered variant (no media) — for pages that read better centered */
.phero--center { text-align: center; }
.phero--center .phero__grid { grid-template-columns: 1fr; max-width: 66ch; margin-inline: auto; }
.phero--center .phero__inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.phero--center .phero__lede,
.phero--center .phero__note { margin-inline: auto; }

@media (max-width: 900px) {
  .phero__grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .phero__media { order: -1; max-width: 460px; }
}

/* ---------------------------------------------------------------------------
   Stat band — animated count-up figures
   --------------------------------------------------------------------------- */
.statband {
  background-color: var(--coffee);
  background-image:
    radial-gradient(90% 120% at 100% 0%, rgba(140,92,53,0.42) 0%, rgba(140,92,53,0) 55%),
    linear-gradient(160deg, #2A1A0C 0%, var(--coffee) 100%);
  padding-block: var(--space-lg);
}
.statband__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.stat { text-align: center; position: relative; }
.stat + .stat::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-md) / 2);
  top: 12%; bottom: 12%;
  width: 1px;
  background: rgba(245,239,227,0.16);
}
.stat__num {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--ivory);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15em;
}
.stat__suffix { font-size: 0.5em; color: var(--chestnut); }
.stat__label {
  margin-top: 0.65rem;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--ivory);
  opacity: 0.72;
}
@media (max-width: 700px) {
  .statband__grid { grid-template-columns: 1fr; gap: var(--space-sm); }
  .stat + .stat::before { display: none; }
  .stat + .stat { padding-top: var(--space-sm); border-top: 1px solid rgba(245,239,227,0.14); }
}

/* ---------------------------------------------------------------------------
   Alternating feature rows (media + text) — Concierge model, etc.
   --------------------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.feature + .feature { margin-top: var(--space-xl); }
.feature__media .plate { width: 100%; }
.feature__index {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--chestnut);
  line-height: 1;
  margin-bottom: var(--space-sm);
}
.feature__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  line-height: 1.2;
  color: var(--coffee);
  margin-bottom: var(--space-sm);
}
.feature__body {
  font-size: var(--text-md);
  line-height: 1.85;
  opacity: 0.82;
}
/* Even rows flip the media to the right */
.feature:nth-child(even) .feature__media { order: 2; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: var(--space-md); }
  .feature__media { order: -1 !important; max-width: 520px; }
}

/* ---------------------------------------------------------------------------
   Vertical numbered timeline — process / first-consultation
   --------------------------------------------------------------------------- */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 22px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--chestnut), rgba(196,168,130,0.15));
}
.tl-step {
  position: relative;
  padding-left: 68px;
  padding-block: var(--space-sm);
}
.tl-step__dot {
  position: absolute;
  left: 0; top: var(--space-sm);
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--linen), var(--oat));
  border: 1px solid rgba(140,92,53,0.25);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--russet);
  box-shadow: 0 6px 16px rgba(35,21,8,0.10);
  z-index: 1;
}
.tl-step__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--coffee);
  margin-bottom: 0.35rem;
}
.tl-step__body {
  font-size: var(--text-base);
  line-height: 1.8;
  opacity: 0.82;
  max-width: 60ch;
}

/* ---------------------------------------------------------------------------
   Interactive process stepper (Consultation → Care)
   Clickable steps, filling progress line, cross-fading detail panels.
   --------------------------------------------------------------------------- */
.process {
  max-width: 900px;
  margin-inline: auto;
}

.process__rail {
  position: relative;
  display: flex;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  justify-content: space-between;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* Base track + filling progress, threaded behind the dots */
.process__track {
  position: absolute;
  top: 23px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: rgba(140, 92, 53, 0.18);
  z-index: 0;
}

.process__progress {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--russet), var(--chestnut));
  transition: width 0.55s var(--ease-inout);
}

.process__step {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  color: var(--coffee);
}

.process__dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ivory);
  border: 1px solid rgba(140, 92, 53, 0.28);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--russet);
  box-shadow: 0 6px 16px rgba(35, 21, 8, 0.08);
  transition: transform 0.4s var(--ease-out),
              background 0.4s var(--ease-out),
              color 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out),
              box-shadow 0.4s var(--ease-out);
}

.process__name {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.process__step:hover .process__dot {
  border-color: var(--chestnut);
  transform: translateY(-2px);
}
.process__step:hover .process__name { opacity: 0.85; }

/* Active + already-completed states */
.process__step.is-active .process__dot,
.process__step.is-done .process__dot {
  background: linear-gradient(150deg, var(--russet), #5A3A22);
  border-color: transparent;
  color: var(--ivory);
}
.process__step.is-active .process__dot {
  transform: scale(1.08);
  box-shadow: 0 10px 26px rgba(140, 92, 53, 0.35);
}
.process__step.is-active .process__name {
  opacity: 1;
  color: var(--russet);
}

.process__step:focus-visible .process__dot {
  outline: 2px solid var(--russet);
  outline-offset: 3px;
}

/* Panels share one grid cell so the stage sizes to the tallest — no layout jump */
.process__stage {
  display: grid;
  background: linear-gradient(180deg, rgba(245, 239, 227, 0.6), rgba(232, 221, 208, 0.35));
  border: 1px solid rgba(140, 92, 53, 0.14);
  border-radius: 18px;
  padding: clamp(1.75rem, 3.5vw, 3rem);
  box-shadow: 0 20px 50px rgba(35, 21, 8, 0.08);
}

.process__panel {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease-out),
              transform 0.45s var(--ease-out),
              visibility 0.45s;
}

.process__panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.process__panel[hidden] { display: block; } /* JS toggles is-active; keep in grid cell */

.process__index {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--chestnut);
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.process__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--coffee);
  margin-bottom: 0.6rem;
}

.process__body {
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--coffee);
  opacity: 0.82;
  max-width: 62ch;
}

@media (max-width: 560px) {
  .process__name { display: none; }
  .process__track { top: 23px; }
  .process__rail { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .process__progress,
  .process__panel,
  .process__dot { transition: none; }
}

/* ---------------------------------------------------------------------------
   Long service pages — sticky scroll-spy rail + rich topic articles
   --------------------------------------------------------------------------- */
.svc-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

/* Sticky left rail (desktop) */
.rail {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: start;
}
.rail__label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--russet);
  opacity: 0.7;
  margin-bottom: var(--space-sm);
}
.rail__list { position: relative; display: flex; flex-direction: column; }
.rail__link {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.15rem;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--coffee);
  opacity: 0.55;
  border-left: 2px solid var(--oat);
  transition: opacity 0.3s var(--ease-out), color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.rail__link:hover { opacity: 0.85; }
.rail__link.is-active {
  opacity: 1;
  color: var(--russet);
  font-weight: 600;
  border-color: var(--russet);
  transform: translateX(2px);
}

/* Mobile pill strip (sticky) — shown instead of the rail below 960px */
.pillnav {
  display: none;
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: rgba(245,239,227,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--oat);
  padding-block: 0.75rem;
}
.pillnav__inner {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pillnav__inner::-webkit-scrollbar { display: none; }
.pillnav__link {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  padding: 0.5em 1.05em;
  border-radius: 999px;
  border: 1px solid var(--oat);
  color: var(--coffee);
  opacity: 0.72;
  transition: all 0.25s var(--ease-out);
}
.pillnav__link.is-active {
  background: var(--russet);
  border-color: var(--russet);
  color: var(--ivory);
  opacity: 1;
}

/* Rich topic article */
.rtopic {
  padding-block: var(--space-lg);
  scroll-margin-top: calc(var(--nav-h) + 6rem);
}
.rtopic + .rtopic { border-top: 1px solid var(--oat); }
.rtopic__index {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--chestnut);
  line-height: 1;
}
.rtopic__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: 1.14;
  color: var(--coffee);
  margin: 0.5rem 0 0.75rem;
}
.rtopic__tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--russet);
  line-height: 1.45;
  margin-bottom: var(--space-md);
  padding-left: 1.1rem;
  border-left: 2px solid var(--chestnut);
}
.rtopic__media { margin: var(--space-md) 0; }
.rtopic__media .plate { width: 100%; }

.rtopic__block { margin-top: var(--space-md); }
.rtopic__kicker {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--russet);
  margin-bottom: 0.85rem;
}
.rtopic__block > p {
  font-size: var(--text-base);
  line-height: 1.85;
  opacity: 0.85;
  margin-bottom: 1rem;
}
.rtopic__block > p:last-child { margin-bottom: 0; }
.rtopic__subhead {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--coffee);
  margin: 1.1rem 0 0.5rem;
}

.rtopic__cta { margin-top: var(--space-md); }

@media (max-width: 960px) {
  .svc-body { grid-template-columns: 1fr; gap: 0; }
  .rail { display: none; }
  .pillnav { display: block; }
  .rtopic { scroll-margin-top: calc(var(--nav-h) + 4.5rem); }
}

/* ---------------------------------------------------------------------------
   Chip list — "who it's for" and focus areas as tactile chips/cards
   --------------------------------------------------------------------------- */
.checklist { display: flex; flex-direction: column; gap: 0.7rem; }
.checklist li {
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3rem;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--ivory) 100%);
  border: 1px solid var(--oat);
  border-radius: 12px;
  font-size: var(--text-base);
  line-height: 1.6;
  opacity: 0.92;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background:
    linear-gradient(150deg, var(--russet), #5A3A22);
}
.checklist li::after {
  content: '';
  position: absolute;
  left: 1.42rem; top: 50%;
  width: 5px; height: 9px;
  border: solid var(--ivory);
  border-width: 0 2px 2px 0;
  transform: translateY(-62%) rotate(45deg);
}
.checklist li:hover {
  transform: translateX(4px);
  border-color: rgba(196,168,130,0.7);
  box-shadow: 0 10px 26px rgba(35,21,8,0.08);
}

/* Focus-area tags (compact pills) */
.tagset { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag {
  font-size: var(--text-sm);
  padding: 0.5em 1em;
  border-radius: 999px;
  background: var(--linen);
  border: 1px solid var(--oat);
  color: var(--coffee);
  opacity: 0.9;
  transition: transform 0.3s var(--ease-out), background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.tag:hover {
  transform: translateY(-2px);
  background: var(--russet);
  color: var(--ivory);
}

/* ---------------------------------------------------------------------------
   Diagnostics spec cards — categorised test panels
   --------------------------------------------------------------------------- */
.specset {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}
.speccard {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--ivory) 100%);
  border: 1px solid var(--oat);
  border-radius: 16px;
  padding: clamp(1.35rem, 2.5vw, 1.9rem);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.speccard:hover {
  transform: translateY(-4px);
  border-color: rgba(196,168,130,0.7);
  box-shadow: 0 18px 40px rgba(35,21,8,0.10);
}
.speccard__title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  color: var(--coffee);
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--oat);
}
.speccard ul { display: flex; flex-direction: column; gap: 0.5rem; }
.speccard li {
  position: relative;
  padding-left: 1rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  opacity: 0.8;
}
.speccard li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--chestnut);
}
@media (max-width: 700px) { .specset { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------
   Closing CTA band (dark) — reused across pages
   --------------------------------------------------------------------------- */
.ctaband {
  background-color: var(--coffee);
  background-image:
    radial-gradient(120% 90% at 0% 100%, rgba(140,92,53,0.45) 0%, rgba(140,92,53,0) 55%),
    linear-gradient(160deg, #2A1A0C 0%, var(--coffee) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ctaband__mark {
  position: absolute;
  right: -40px; top: 50%;
  transform: translateY(-50%);
  width: clamp(180px, 30vw, 360px);
  opacity: 0.06;
  pointer-events: none;
}
.ctaband__inner { max-width: 54ch; margin-inline: auto; position: relative; z-index: 1; }
.ctaband__eyebrow { color: var(--chestnut); justify-content: center; margin-bottom: var(--space-sm); }
.ctaband__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: 1.2;
  color: var(--ivory);
  margin-bottom: var(--space-sm);
}
.ctaband__body {
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--ivory);
  opacity: 0.8;
  margin-bottom: var(--space-md);
}

/* ---------------------------------------------------------------------------
   Section header helper (centered)
   --------------------------------------------------------------------------- */
.xhead { text-align: center; max-width: 64ch; margin: 0 auto var(--space-lg); }
.xhead__title { font-family: var(--font-heading); font-size: var(--text-2xl); line-height: 1.14; color: var(--coffee); margin-top: 0.75rem; }
.xhead__intro { font-size: var(--text-md); line-height: 1.85; opacity: 0.8; margin-top: 1rem; }

/* Alternating section backgrounds */
.bg-linen { background-color: var(--linen); }
.bg-ivory { background-color: var(--ivory); }

/* ---------------------------------------------------------------------------
   Premium enquiry form framing (Book page)
   --------------------------------------------------------------------------- */
.bookgrid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.booknext { position: sticky; top: calc(var(--nav-h) + 2rem); }
@media (max-width: 900px) {
  .bookgrid { grid-template-columns: 1fr; }
  .booknext { position: static; }
}

/* ---------------------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .readbar { transition: none; }
  .plate[data-parallax] .plate__glyph { transform: none !important; }
}
