/* ============================================================
   Xtra Xray — shared design system
   Editorial medical aesthetic
   ============================================================ */

:root {
  /* ============================================================
     XTRA XRAY — STRICT BRAND PALETTE
     Only three colours: Crimson Red · Navy · White.
     Everything else is an opacity step of navy on white.
     ============================================================ */

  /* Navy — sole foreground colour */
  --ink:        #172244;                          /* brand navy — headlines, primary text */
  --ink-2:      rgba(23, 34, 68, 0.86);           /* body copy */
  --ink-mute:   rgba(23, 34, 68, 0.55);           /* meta / labels / muted */

  /* Paper — sole background colour */
  --paper:      #ffffff;
  --paper-2:    rgba(23, 34, 68, 0.04);           /* card surface (navy at 4%) */
  --paper-3:    rgba(23, 34, 68, 0.08);           /* hover / divider surface */

  /* Rules */
  --rule:       rgba(23, 34, 68, 0.14);
  --rule-soft:  rgba(23, 34, 68, 0.07);

  /* Crimson — sole accent */
  --coral:      #C8102E;                          /* brand red — CTAs, brand mark, X letters */
  --coral-dk:   #9F0B22;                          /* hover / pressed */

  /* Legacy aliases (kept for compatibility; resolve to the same brand colours) */
  --cyan:       rgba(23, 34, 68, 0.55);
  --cyan-deep:  #172244;
  --cyan-glow:  rgba(23, 34, 68, 0.45);
  --sage:       rgba(23, 34, 68, 0.30);

  /* Type */
  --display: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --sans:    "Work Sans", "Söhne", "Helvetica Neue", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --maxw: 1320px;
  --pad-x: clamp(20px, 4vw, 56px);
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

/* ============================================================
   TYPE SYSTEM
   ============================================================ */

.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.015em;
}
.display-xl  { font-size: clamp(56px, 9.5vw, 168px); }
.display-lg  { font-size: clamp(48px, 7vw, 112px); }
.display-md  { font-size: clamp(40px, 5vw, 80px); }
.display-sm  { font-size: clamp(32px, 4vw, 56px); }

.sans-h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.lede {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 60ch;
}

.italic-serif {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.bleed { width: 100%; padding: 0 var(--pad-x); }

.rule { height: 1px; background: var(--rule); width: 100%; }

.section { padding: clamp(80px, 10vw, 160px) 0; }
.section-tight { padding: clamp(56px, 7vw, 96px) 0; }

/* ============================================================
   TOP NAV
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1;
}
.brand-svg {
  width: 50px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.brand-name { color: var(--ink); }
.brand-name .x { color: var(--coral); }
.brand:hover .brand-svg .pin { transform-origin: center bottom; animation: pinBounce 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.brand:hover .brand-svg .pin.r { animation-delay: 0.08s; }
@keyframes pinBounce {
  0% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 999px;
  transition: background 0.15s;
}
.nav-links a:hover { background: var(--paper-3); }
.nav-links a.active {
  background: var(--ink);
  color: var(--paper);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.phone-link {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.phone-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--ink-2); }
.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-accent {
  background: var(--coral);
  color: #fff8f3;
}
.btn-accent:hover { background: var(--coral-dk); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-ghost:hover { background: var(--paper-2); }

.btn-lg { padding: 18px 28px; font-size: 15px; }

/* ============================================================
   CHIPS, BADGES
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.chip-cyan {
  background: rgba(61, 127, 184, 0.1);
  border-color: rgba(61, 127, 184, 0.2);
  color: var(--cyan-deep);
}
.chip-sage {
  background: rgba(174, 192, 163, 0.25);
  border-color: rgba(108, 130, 95, 0.3);
  color: #3d4a36;
}
.chip-coral {
  background: rgba(214, 90, 63, 0.1);
  border-color: rgba(214, 90, 63, 0.25);
  color: var(--coral-dk);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
}

/* Make big cards inherit the global radius token. Small chips keep their own. */
.svc-card, .why-card, .test-card, .channel, .hours-card, .contact-form,
.book-card, .summary, .success-card, .equipment-img, .map-visual, .opt-card {
  border-radius: var(--radius);
}

/* ============================================================
   X-RAY VIEWER MOTIF
   ============================================================ */

.xray-frame {
  position: relative;
  background: #050d18;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 30px 60px -20px rgba(15, 50, 79, 0.35),
    inset 0 0 60px rgba(111, 180, 232, 0.08);
}
.xray-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) brightness(1.02);
}
.xray-frame .xray-label {
  position: absolute;
  bottom: 12px; left: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--cyan-glow);
  text-transform: uppercase;
  z-index: 2;
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}
.xray-frame .xray-id {
  position: absolute;
  top: 12px; left: 14px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan-glow);
  z-index: 2;
}
.xray-frame::after {
  /* hides patient name strip cleanly — fallback when no .xray-mask div present */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 20%;
  min-height: 70px;
  background: linear-gradient(to top, #050d18, #050d18 70%, transparent);
  z-index: 1;
}
/* Real-div equivalent — bulletproof, used inside the frame */
.xray-frame > .xray-mask {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22%;
  min-height: 70px;
  background: linear-gradient(to top, #050d18, #050d18 68%, transparent);
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 80px;
}
.footer a { color: var(--paper); opacity: 0.78; }
.footer a:hover { opacity: 1; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-grid h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 18px;
}
.footer-grid ul { list-style: none; display: grid; gap: 10px; font-size: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.footer .display { color: var(--paper); }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .phone-link span.label { display: none; }
}

/* ============================================================
   UTILS
   ============================================================ */

.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-12 { gap: 48px; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mt-16 { margin-top: 64px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.text-mute { color: var(--ink-mute); }
.text-ink-2 { color: var(--ink-2); }
.font-mono { font-family: var(--mono); }

.hover-lift { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hover-lift:hover { transform: translateY(-4px); }

/* Subtle scanline ambient on hero backgrounds (used sparingly) */
.scanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 3px,
    rgba(15, 20, 24, 0.015) 3px,
    rgba(15, 20, 24, 0.015) 4px
  );
}
