/*
 * components.css: self-contained widgets.
 * Preloader, masthead, duotone media, status pills,
 * service rows, insurance band, assessment list, portraits, the
 * booking form and the floating action.
 */

/* ===============================================================
 * Preloader: the page's single orchestrated motion moment.
 *
 * It opens on the brand's own yellow field, as the printed logo
 * sits, and reveals the clinic's écorché figure under a downward
 * scan. The sweep is borrowed from the thing the clinic actually
 * does: read a body from the top down, then say what it found.
 * The figure is the logo's own artwork, isolated from the wordmark,
 * recoloured here by mask so one asset serves every ground.
 * =============================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1.25rem, 3vw, 2rem);
  background: var(--gold);
  background-image: radial-gradient(118% 86% at 50% 16%, var(--gold-lift) 0%, var(--gold) 56%, var(--gold-deep) 132%);
  transition: opacity 540ms var(--ease-out), visibility 540ms;
}
.preloader[hidden] { display: none; }
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.pl-stage {
  position: relative;
  width: clamp(152px, 26vw, 250px);
  aspect-ratio: 230 / 315;
}

.pl-figure {
  position: absolute;
  inset: 0;
  background: var(--ink);
  -webkit-mask: url("../img/figure.svg") no-repeat center / contain;
          mask: url("../img/figure.svg") no-repeat center / contain;
  /* Revealed top-down by the scan; clip-path animates reliably where
   * animating a second mask layer does not. */
  clip-path: inset(0 0 100% 0);
  animation: pl-reveal 1180ms var(--ease-both) 200ms forwards;
}

.pl-scan {
  position: absolute;
  left: -6%;
  right: -6%;
  top: 0;
  height: 2px;
  background: var(--ink);
  opacity: 0;
  animation: pl-scan 1180ms var(--ease-both) 200ms forwards;
}

@keyframes pl-reveal { to { clip-path: inset(0 0 0% 0); } }
@keyframes pl-scan {
  0%   { top: 0;    opacity: 0; }
  8%   {            opacity: 1; }
  88%  {            opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.preloader-word {
  color: var(--ink);
  opacity: 0;
  animation: pl-word 620ms var(--ease-out) 1240ms forwards;
}
.preloader-word .lock-1,
.preloader-word .lock-2 { font-size: clamp(1.45rem, 4.4vw, 2.5rem); }
.preloader-word .lock-3 { font-size: clamp(0.55rem, 1.45vw, 0.74rem); }
@keyframes pl-word { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Reduced motion: the mark is simply present, already revealed. */
@media (prefers-reduced-motion: reduce) {
  .pl-figure { clip-path: inset(0 0 0% 0); }
  .pl-scan { display: none; }
  .preloader-word { opacity: 1; }
}

/* ===============================================================
 * Masthead
 * =============================================================== */
.masthead {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fast) var(--ease-out);
}
.masthead.is-stuck { border-bottom-color: var(--ink-line); }

.masthead-in {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 4.75rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; margin-right: auto; }
.brand .lockup { color: var(--bone); }
/* Matches the clinic's dark-ground logo variant: POWER in the brand
 * yellow, Precision in white, the tracked sans line muted. */
.brand .lock-1 { font-size: 1.32rem; color: var(--gold); }
.brand .lock-2 { font-size: 1.32rem; color: var(--bone); }
.brand .lock-3 { font-size: 0.7rem; color: var(--bone-dim); letter-spacing: 0.145em; margin-top: 0.42em; }

.nav { display: flex; gap: 1.5rem; }
.nav a {
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--bone-dim);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out);
}
.nav a:hover { color: var(--bone); border-bottom-color: var(--gold); }

.masthead .btn { padding: 0.7rem 1.15rem; font-size: var(--step--1); }

@media (max-width: 920px) { .nav { display: none; } }

/* ===============================================================
 * Duotone media
 * The clinic supplies photography of varying grade. Compositing it
 * through a yellow/black duotone keeps the page art-directed
 * whatever arrives. Portraits use .duo-soft so faces stay natural,
 * this is healthcare, and a person's face should not be a graphic.
 * =============================================================== */
.duo {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  background-image: linear-gradient(162deg, var(--gold-deep) 0%, var(--gold) 54%, var(--gold-lift) 100%);
  isolation: isolate;
}
.duo > img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12) brightness(0.92);
  mix-blend-mode: luminosity;
}
.duo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--ink) 70%, transparent) 100%);
  pointer-events: none;
}

.duo-soft { background-image: linear-gradient(170deg, var(--gold-deep) 0%, var(--gold) 72%, var(--gold-lift) 100%); }
.duo-soft > img { filter: grayscale(0.3) contrast(1.04) brightness(0.99) saturate(0.94); mix-blend-mode: normal; }
.duo-soft::after { background: linear-gradient(180deg, transparent 54%, color-mix(in srgb, var(--ink) 54%, transparent) 100%); }

/* Escape hatch: data-duo="off" ships the photograph untouched. */
.duo[data-duo="off"] { background-image: none; }
.duo[data-duo="off"] > img { filter: none; mix-blend-mode: normal; }
.duo[data-duo="off"]::after { display: none; }

/* ===============================================================
 * Status pills: discrete objects, not a dot-joined meta string.
 * =============================================================== */
.pills { display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0; margin: 0; list-style: none; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.52rem 0.9rem;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-size: var(--step--1);
  color: var(--bone-dim);
}
.pill b { font-weight: 600; color: var(--bone); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); flex: none; }
.pill .star { width: 0.95em; height: 0.95em; fill: var(--gold); flex: none; }

.field-gold .pill { border-color: color-mix(in srgb, var(--ink) 26%, transparent); color: color-mix(in srgb, var(--ink) 78%, transparent); }
.field-gold .pill b { color: var(--ink); }
.field-gold .pill .star { fill: var(--ink); }

/* ===============================================================
 * Insurance band: the clinic's own claim, set in its own voice.
 * Insurer names are live type rather than logo files, so nothing
 * depends on third-party artwork to render correctly.
 * =============================================================== */
.insurers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2.5rem;
  padding: 0; margin: 0;
  list-style: none;
}
.insurers li {
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
}
.insurance-claim {
  font-family: var(--face-sans);
  font-weight: 400;
  font-size: var(--step-0);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  margin-bottom: 1.5rem;
}

/* ===============================================================
 * Service rows: an editorial index, not a deck of identical cards.
 * A service menu is a list, so it is built as one.
 * =============================================================== */
.rows { border-top: 1px solid var(--ink-line); }
.row { border-bottom: 1px solid var(--ink-line); }
.row-trigger {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  width: 100%;
  padding: clamp(1.3rem, 3vw, 2rem) 0;
  background: none; border: 0;
  color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.row-mark { width: 1.6rem; height: 1.6rem; color: var(--gold); flex: none; }
.row-name {
  font-family: var(--face-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  transition: color var(--fast) var(--ease-out);
}
.row-trigger:hover .row-name { color: var(--gold); }
.row-sign { width: 1.4rem; height: 1.4rem; position: relative; flex: none; }
.row-sign::before, .row-sign::after {
  content: ""; position: absolute; inset: 50% 0 auto 0;
  height: 1px; background: var(--gold);
  transition: transform var(--slow) var(--ease-out), opacity var(--fast) linear;
}
.row-sign::after { transform: rotate(90deg); }
.row-trigger[aria-expanded="true"] .row-sign::after { transform: rotate(0deg); opacity: 0; }

.row-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--slow) var(--ease-both); }
.row.is-open .row-body { grid-template-rows: 1fr; }
.row-body > div { overflow: hidden; }
.row-body p { padding-bottom: clamp(1.3rem, 3vw, 2rem); }

@media (max-width: 620px) {
  .row-trigger { grid-template-columns: auto 1fr; row-gap: 0.3rem; }
  .row-sign { grid-column: 2; justify-self: end; margin-top: -2rem; }
}

/* ===============================================================
 * Assessment list: the occupational / seafarer service line.
 * =============================================================== */
.checks { display: grid; gap: 0; padding: 0; margin: 0 0 clamp(1.3rem, 3vw, 2rem); list-style: none; }
.checks li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--ink-line);
}
.checks b { font-family: var(--face-sans); font-weight: 500; font-size: var(--step-0); color: var(--bone); }
.checks span { font-size: var(--step--1); color: var(--bone-dim); }

/* ===============================================================
 * Booking form
 * =============================================================== */
.form { display: grid; gap: 1.05rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: var(--step--1); font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: color-mix(in srgb, var(--bone) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 2px;
  font-family: var(--face-sans);
  font-size: var(--step-0);
  color: var(--ink);
  transition: border-color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { background: var(--bone); border-color: var(--ink); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }

.form-note { font-size: var(--step--1); color: color-mix(in srgb, var(--ink) 70%, transparent); }

.form-status {
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--ink) 38%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  font-size: var(--step--1);
  font-weight: 500;
}
.form-status[hidden] { display: none; }

/* ===============================================================
 * Floating action: thumb-reachable booking on a phone.
 * =============================================================== */
.float-book {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 70;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 60%, transparent);
}
@media (min-width: 921px) { .float-book { display: none; } }

