/* Story motion (see story.js): the listing fix, the enquiries landing, and the lock-on at contact.
   Without JS or with reduced motion, everything shows in its finished state. */

/* ================= What we fix ================= */
.fix { border-bottom: 1px solid var(--border); }
.fix-pin { padding: 72px 0; }
.fix-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 48px; align-items: center; }
.fix-head { display: flex; flex-direction: column; gap: 14px; }
.fix-head h2 { margin: 0; }

.fix-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: fx; }
.fix-steps li { display: flex; align-items: center; gap: 12px; color: var(--heading); font-size: 1rem; }
/* --on: 0 = empty ring, 1 = filled gold with a tick (story.js animates it) */
.fix-steps li { --on: 1; opacity: calc(0.45 + var(--on) * 0.55); }
.fix-steps i { position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--blip); }
.fix-steps i::before { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; background: var(--blip); transform: scale(var(--on)); }
.fix-steps i::after { /* tick */
  content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px; opacity: var(--on);
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.fix-stage { position: relative; display: flex; gap: 32px; align-items: center; justify-content: flex-end; }

/* The listing card */
.fix-card {
  position: relative; margin: 0; width: min(100%, 440px); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.fix-card::after { /* gold edge once it's all fixed */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--blip), 0 0 0 0 transparent; opacity: var(--done, 1);
}
.fc-photos { position: relative; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; height: 190px; background: var(--surface-strong); }
.fc-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-photos img:first-of-type { grid-row: 1 / 3; }
.fc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; opacity: 0; }
.fc-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.fc-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fc-title strong { color: var(--heading); font-size: 1.2rem; font-weight: 500; }
.fc-title small { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.fc-rating { position: relative; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.fc-score { color: var(--heading); font-weight: 500; }
.fc-stars, .fc-stars-fill { display: inline-block; height: 14px; width: 82px; -webkit-mask: var(--star-mask); mask: var(--star-mask); }
.fc-stars {
  --star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 82 14'%3E%3Cg%3E%3Cpath id='s' d='M7 0l2.1 4.3 4.7.7-3.4 3.3.8 4.7L7 10.8 2.8 13l.8-4.7L.2 5l4.7-.7z'/%3E%3Cuse href='%23s' x='17'/%3E%3Cuse href='%23s' x='34'/%3E%3Cuse href='%23s' x='51'/%3E%3Cuse href='%23s' x='68'/%3E%3C/g%3E%3C/svg%3E") left / 82px 14px no-repeat;
  position: relative; background: var(--surface-strong);
}
.fc-stars-fill { position: absolute; left: 0; top: 0; background: var(--blip); -webkit-mask: none; mask: none; width: 96%; }
.fc-count { color: var(--muted); }
.fc-none { position: absolute; left: 0; color: var(--muted); opacity: 0; }
.fc-cat { color: var(--text); font-size: 0.92rem; }
.fc-row { display: grid; font-size: 0.92rem; }
.fc-row > * { grid-area: 1 / 1; }
.fc-before { color: var(--muted); opacity: 0; }
.fc-after em { font-style: normal; font-weight: 500; color: var(--open); }
.fc-link { color: var(--hint); }
.fc-actions { display: flex; gap: 8px; margin-top: 6px; font-size: 0.9rem; }
.fc-actions span { flex: 1; text-align: center; border: 1px solid var(--border); border-radius: 999px; padding: 9px 0; color: var(--heading); }
.fc-actions .sl-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }

/* The phone */
.fix-phone {
  position: relative; flex-shrink: 0; width: 240px; height: 470px; padding: 9px; border-radius: 40px;
  background: var(--surface-strong); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.fp-screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 32px; padding: 34px 12px 12px; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--blip) 16%, transparent), transparent 60%), var(--bg);
}
.fp-time { display: block; color: var(--heading); font-size: 3rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.fp-date { display: block; margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.fp-quiet { position: absolute; left: 0; right: 0; top: 52%; color: var(--muted); font-size: 0.8rem; opacity: 0; }
.fp-stack { display: grid; gap: 8px; margin-top: 26px; text-align: left; }
.fp-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; font-size: 0.74rem; line-height: 1.3; color: var(--text);
  background: var(--glass-strong); border: 1px solid color-mix(in srgb, var(--blip) 40%, var(--border));
}
.fp-note .signal-dot { margin-top: 4px; }
.fp-note small { display: block; font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.fp-note b { display: block; color: var(--heading); font-weight: 500; font-size: 0.82rem; }

/* Narrower screens: head on top, the phone rises over the card when the enquiries start */
@media (max-width: 1099px) {
  .fix-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .fix-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
  .fix-steps li { font-size: 0.88rem; gap: 8px; }
  .fix-steps i { width: 18px; height: 18px; }
  .fix-steps i::after { left: 5px; top: 1.5px; width: 4px; height: 8px; }
  .fix-stage { flex-direction: column; justify-content: center; } /* no script: card, then phone */
  .js-story .fix-stage { min-height: 470px; }
  .js-story .fix-phone { position: absolute; left: 50%; top: 0; margin-left: -120px; } /* story.js raises it over the card */
}
@media (max-width: 600px) {
  .fix-pin { padding: 40px 0; }
  .fix-head h2 { font-size: 1.9rem; }
  .fc-photos { height: 150px; }
  .js-story .fix-stage { min-height: 440px; }
  .fix-phone { width: 220px; height: 410px; }
  .fp-screen { padding-top: 26px; }
  .fp-time { font-size: 2.5rem; }
  .fp-stack { margin-top: 18px; gap: 7px; }
  .fp-note { padding: 9px 11px; }
  .fp-note:nth-child(4) { display: none; } /* three fit a small phone */
  .js-story .fix-phone { margin-left: -110px; }
}

/* ================= Lock-on at contact ================= */
.closing-panel { position: relative; isolation: isolate; overflow: hidden; }
.lock { position: absolute; inset: 0; z-index: -1; pointer-events: none; display: none; }
.js-story .lock { display: block; }
.lock-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.lock-rings circle { fill: none; stroke: color-mix(in srgb, var(--blip) 22%, var(--radar-ring)); stroke-width: 1; }
.lock-rings .lock-core { fill: var(--blip); stroke: none; }
.lock-beam {
  position: absolute; width: 1000px; height: 1000px; margin: -500px 0 0 -500px; border-radius: 50%; opacity: 0;
  background: conic-gradient(from 0deg, transparent 0deg 290deg, color-mix(in srgb, var(--blip) 20%, transparent) 360deg);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 10%, rgba(0,0,0,.5) 60%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 10%, rgba(0,0,0,.5) 60%, transparent 100%);
}
.lock-beam::after {
  content: ""; position: absolute; left: calc(50% - 0.5px); top: 0; width: 1px; height: 50%;
  background: linear-gradient(to top, var(--blip), transparent 95%);
}
.lock-box { position: absolute; opacity: 0; }
.lock-box i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--blip); }
.lock-box i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.lock-box i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.lock-box i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.lock-box i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }
.lock-ping { position: absolute; border-radius: 999px; border: 1.5px solid var(--blip); opacity: 0; }
.lock-target { position: relative; transition: box-shadow .6s ease, background-color .2s, color .2s, border-color .2s; }
.lock-target.is-locked { box-shadow: 0 0 0 1px var(--blip), 0 10px 40px -6px color-mix(in srgb, var(--blip) 55%, transparent); }
