/* LEVEL UP — loyalty programme page.
   Loaded on top of style.css (palette, chrome, furniture) and service.css
   (.lvl-card, .steps, .compare-wrap, .faq, .process-grid). */

.site-head nav a.is-current { opacity: 1; color: var(--wood); }

/* ================= PRINCIPLE ================= */

.principle { padding-top: 4vh; }
.principle-line {
  font-size: clamp(1.5rem, 3.6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.2;
  max-width: 22ch;
  margin: 1.6rem 0 6vh;
}
.principle-line em { color: var(--wood); font-style: normal; }

.principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}
.principle-grid > div { border-top: 1px solid var(--line); padding-top: 1.8rem; }
.principle-grid b {
  display: block;
  margin-bottom: .9rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.principle-grid p { color: var(--muted); font-size: .95rem; line-height: 1.7; }

/* ================= XP CALCULATOR ================= */

.calc-section { padding-bottom: 6vh; }

.xp-calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: stretch;
  padding: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #fbf9f4, #efe9db);
}

.xp-inputs { display: flex; flex-direction: column; gap: 2rem; justify-content: center; }

.xp-input { display: block; }
.xp-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .9rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.xp-label output {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Range track styled in both engines; the thumb is a brass button. */
.xp-input input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.xp-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brass);
  border: 3px solid var(--bg);
  box-shadow: 0 2px 8px rgba(32, 28, 24, .28);
  cursor: grab;
  transition: transform .2s;
}
.xp-input input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); cursor: grabbing; }
.xp-input input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brass);
  border: 3px solid var(--bg);
  box-shadow: 0 2px 8px rgba(32, 28, 24, .28);
  cursor: grab;
}
.xp-input input[type="range"]:focus-visible { outline: 2px solid var(--wood); outline-offset: 6px; }

/* --- readout: the lift rail, repurposed as a progress meter --- */
.xp-result {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  padding: 2rem;
  border-radius: 12px;
  background: linear-gradient(165deg, #3d2717, #180e06);
  color: var(--cab-cream);
}

/* Fixed width so the threshold labels, which overflow the zero-width mark
   column, have room and never land on top of the readout. */
.xp-meter { position: relative; display: flex; flex: none; width: 128px; }
.xp-track {
  position: relative;
  width: 3px;
  min-height: 260px;
  background: rgba(245, 241, 232, .16);
  border-radius: 2px;
}
.xp-fill {
  position: absolute;
  bottom: 0; left: 0;
  width: 3px;
  height: 0%;
  border-radius: 2px;
  background: var(--brass);
  box-shadow: 0 0 14px rgba(176, 138, 83, .9);
  transition: height .5s cubic-bezier(.2, .7, .2, 1);
}
.xp-marks { position: relative; list-style: none; width: 0; }
.xp-marks li {
  position: absolute;
  left: 0;
  transform: translate(-8px, 50%);
  display: flex;
  align-items: center;
  gap: .8rem;
  white-space: nowrap;
}
.xp-marks .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(245, 241, 232, .45);
  background: transparent;
  transition: background .35s, border-color .35s, box-shadow .35s;
}
.xp-marks li.reached .dot {
  background: var(--brass);
  border-color: var(--brass);
  box-shadow: 0 0 12px rgba(176, 138, 83, .95);
}
.xp-marks .lbl {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cab-muted);
  opacity: .55;
  transition: opacity .35s, color .35s;
}
.xp-marks li.reached .lbl { opacity: 1; color: var(--cab-cream); }

.xp-readout { display: flex; flex-direction: column; justify-content: center; gap: .5rem; }
.xp-floor {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--brass);
}
.xp-level {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);   /* must fit "LEVEL 100" on one line */
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  text-transform: uppercase;
}
.xp-level b { color: var(--brass); font-variant-numeric: tabular-nums; }
.xp-total { font-size: .9rem; color: var(--cab-muted); margin-top: .4rem; }
.xp-total b { color: var(--cab-cream); font-variant-numeric: tabular-nums; }
.xp-next {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(245, 241, 232, .16);
  font-size: .85rem;
  line-height: 1.5;
  color: var(--cab-muted);
}
.xp-next b { color: var(--brass); font-variant-numeric: tabular-nums; }

.calc-note { margin-top: 1.5rem; font-size: .8rem; color: var(--muted); }

/* Floor names are long compound words that won't fit a card on one line, so
   break them in two. Scoped to this page — on the service pages the same <b>
   holds the tier number and must stay inline. */
body.levelup .lvl-name {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.05;
}
body.levelup .lvl-name b { display: block; }

/* ================= XP STORE ================= */

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.store-item {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1.8rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .3s, transform .3s;
}
.store-item:hover { border-color: var(--brass); transform: translateY(-4px); }
.store-item b {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--wood);
  font-variant-numeric: tabular-nums;
}
.store-item span { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.store-item.is-top {
  background: linear-gradient(165deg, #3d2717, #180e06);
  border-color: rgba(176, 138, 83, .45);
}
.store-item.is-top b { color: var(--brass); }
.store-item.is-top span { color: var(--cab-muted); }

/* ================= HOMEPAGE TEASER: THE PASS =================
   Pinned for one screen while the pass fills, like a battle pass: the track
   sweeps left to right, each stop lights as it is reached, and the HUD counts
   up. levelup.js drives all of it from scroll position through .levelup-pin.

   Colour: the contact footer directly above (upward mode) is walnut #241609,
   so this panel goes near-black with a warm floor glow. Two brass hairlines
   close it off, so the two dark sections read as separate rooms. */

.levelup-pin { position: relative; height: 280vh; }

.levelup-teaser {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 6vw;
  color: var(--cab-cream);
  background: radial-gradient(ellipse 130% 90% at 50% 108%, #2c1b0d 0%, #100b07 55%, #080605 100%);
  border-top: 1px solid rgba(176, 138, 83, .45);
  border-bottom: 1px solid rgba(176, 138, 83, .45);
}

/* Faint HUD grid — reads as a screen rather than another page section. */
.lu-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 7vw, rgba(176,138,83,.09) 7vw calc(7vw + 1px)),
    repeating-linear-gradient(0deg, transparent 0 7vw, rgba(176,138,83,.06) 7vw calc(7vw + 1px));
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000, transparent 78%);
}
.levelup-teaser .wrap { position: relative; z-index: 1; width: 100%; }

/* Every element rises in at its own point in the pass; levelup.js sets --p. */
.lu-in {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.lu-in.is-lit { opacity: 1; transform: none; }

.levelup-teaser .eyebrow-lg { color: var(--brass); }
.levelup-teaser .section-title-lg { color: var(--cab-cream); margin-top: 1rem; }
.levelup-teaser .lead { color: var(--cab-muted); max-width: 68ch; margin-top: 1.1rem; }
.levelup-teaser .lead strong { color: var(--cab-cream); }

/* ---- HUD ---- */
.lu-hud {
  display: flex;
  gap: clamp(2rem, 6vw, 5rem);
  margin: 3.4vh 0 0;
  padding-bottom: 2vh;
  border-bottom: 1px solid rgba(245, 241, 232, .12);
}
.lu-hud b {
  display: block;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}
.lu-hud span {
  display: block;
  margin-top: .55rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--cab-muted);
}

/* ---- the track ----
   The top padding is headroom for the reward cards, which rise out of the rail.
   Nodes reuse the same value so the two always line up. */
.lu-track {
  --lu-top: clamp(150px, 24vh, 215px);
  position: relative;
  padding: var(--lu-top) 0 4vh;
}

.lu-rail {
  position: relative;
  height: 4px;
  border-radius: 3px;
  background: rgba(245, 241, 232, .12);
}
.lu-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8a6a3d, var(--brass));
  box-shadow: 0 0 18px rgba(176, 138, 83, .75);
}
/* Bright head riding the leading edge of the fill. */
.lu-head {
  position: absolute;
  top: 50%;
  right: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  transform: translate(50%, -50%);
  background: #ffdca8;
  box-shadow: 0 0 22px 4px rgba(255, 205, 135, .75);
}

.lu-nodes { position: absolute; inset: var(--lu-top) 0 4vh; list-style: none; }
.lu-nodes li {
  position: absolute;
  left: var(--at);
  bottom: 0;
  transform: translateX(-50%);
}
.lu-dot {
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 22px; height: 22px;
  border-radius: 50%;
  transform: translateX(-50%) scale(.75);
  background: #16100a;
  border: 2px solid rgba(245, 241, 232, .3);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), border-color .4s, background .4s, box-shadow .4s;
}
.lu-nodes li.is-reached .lu-dot {
  transform: translateX(-50%) scale(1);
  background: var(--brass);
  border-color: #ffdca8;
  box-shadow: 0 0 20px rgba(176, 138, 83, .95);
}

/* ---- reward card above each stop ---- */
.lu-card {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  width: clamp(180px, 19vw, 250px);
  transform: translate(-50%, 18px);
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid rgba(176, 138, 83, .35);
  border-radius: 10px;
  background: rgba(20, 14, 9, .82);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1), border-color .5s;
}
.lu-nodes li.is-reached .lu-card { opacity: 1; transform: translate(-50%, 0); border-color: var(--brass); }
.lu-card.is-top { background: linear-gradient(165deg, rgba(61,39,23,.92), rgba(16,10,6,.94)); }

.lu-card b {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--brass);
}
.lu-card em {
  display: block;
  margin-top: .25rem;
  font-style: normal;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cab-muted);
}
.lu-card i {
  display: inline-block;
  margin-top: .7rem;
  padding: .2rem .55rem;
  border: 1px solid rgba(176, 138, 83, .5);
  border-radius: 2rem;
  font-style: normal;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--cab-cream);
}
.lu-rewards { display: flex; flex-direction: column; gap: .35rem; margin-top: .9rem; }
.lu-rewards span {
  position: relative;
  padding-left: .9rem;
  font-size: .72rem;
  line-height: 1.4;
  color: var(--cab-muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease var(--rd, 0s), transform .45s ease var(--rd, 0s);
}
.lu-rewards span::before { content: "+"; position: absolute; left: 0; color: var(--brass); }
.lu-nodes li.is-reached .lu-rewards span { opacity: 1; transform: none; }

.levelup-teaser .btn-brass { margin-top: 2vh; background: var(--brass); color: #201c18; }
.levelup-teaser .btn-brass:hover { background: var(--cab-cream); }

/* ================= RESPONSIVE ================= */

@media (max-width: 860px) {
  .xp-calc { grid-template-columns: 1fr; }
  .xp-result { flex-direction: column; gap: 2.5rem; }
  .xp-track { min-height: 180px; }
  .teaser-steps div:nth-child(2),
  .teaser-steps div:nth-child(3) { padding-bottom: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-fill { transition: none; }
}
