/* ==========================================================================
   Derry Physio — site styles
   Apple-inspired: system type, generous space, translucent chrome,
   instant press feedback, restrained motion.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand, sampled from the logo */
  --blue: #0a6db8;          /* "Derry" blue, darkened for AA text contrast */
  --blue-bright: #1a8ad6;
  --navy: #163a6b;          /* figure in the mark */
  --green: #6f9a2c;         /* "Physio" green, AA on white for large text */
  --green-soft: #eef5e2;
  --blue-soft: #e8f2fb;

  /* Neutrals */
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;

  --danger: #c4271c;
  --success: #248a3d;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
          "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display",
          "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max: 1120px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --nav-h: 3.5rem;

  /* Motion — critically damped feel, no overshoot */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.07);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

:focus-visible {
  outline: 3px solid rgba(26, 138, 214, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  font-weight: 700;
}

.display {
  font-size: clamp(2.5rem, 6.2vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
}

p { margin: 0 0 1em; color: var(--ink-2); }

/* Headline styling on a <p>, so the original SEO headings can stay the real <h1>/<h2> */
.display { color: var(--ink); font-family: var(--font-display); font-weight: 700; margin: 0 0 0.5em; }
h1.eyebrow { font-family: var(--font); }

.lead {
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1.1875rem, 2vw, 1.4375rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--ink-3);
  max-width: 40em;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--green);
}

.brand-blue { color: var(--blue-bright); }
.brand-green { color: var(--green); }

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: clamp(3rem, 6vw, 4.5rem); }

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lead { margin-inline: auto; }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }

/* ---------- Navigation (translucent material) ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 240ms var(--ease);
}
/* Scroll-edge effect instead of a hard divider: appears only once content is underneath */
.nav::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 240ms var(--ease);
}
.nav.is-scrolled::after { opacity: 1; }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--blue-bright);
  margin-right: auto;
}
.nav__brand:hover { text-decoration: none; }
.nav__brand img { width: 34px; height: 34px; }
.nav__brand b { color: var(--green); font-weight: 700; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--ink-2);
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.nav__links a:hover { color: var(--ink); text-decoration: none; background: rgba(0, 0, 0, 0.04); }
.nav__links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav__cta { margin-left: 0.5rem; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  color: var(--ink);
}
.nav__toggle span {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 300ms var(--ease-out);
}
.nav__toggle span:first-child { top: 18px; }
.nav__toggle span:last-child { top: 25px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav__toggle { display: block; }
  .nav .nav__cta { display: none; }

  /* Sheet drops from the bar it belongs to and returns the same way */
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
    transform-origin: top center;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms var(--ease), transform 320ms var(--ease-out), visibility 0s linear 320ms;
  }
  .nav.is-open .nav__links {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 220ms var(--ease), transform 320ms var(--ease-out), visibility 0s;
  }
  .nav__links li + li { border-top: 1px solid var(--line-soft); }
  .nav__links a {
    padding: 0.95rem 0.25rem;
    font-size: 1.0625rem;
    border-radius: 0;
  }
  .nav__links a:hover { background: transparent; }
  .nav__links .nav__sheet-cta { border-top: 0; padding-top: 1rem; }
  .nav__links .nav__sheet-cta a { padding: 0.85rem 1rem; border-radius: 999px; text-align: center; color: #fff; }
}
@media (min-width: 881px) { .nav__sheet-cta { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--blue);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 500 1.0625rem/1.2 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms var(--ease), transform 100ms ease-out, box-shadow 160ms var(--ease);
}
.btn:hover { text-decoration: none; background: #085a99; }
/* Feedback lives on the press, and it's instant */
.btn:active { transform: scale(0.97); }

.btn--sm { min-height: 34px; padding: 0.4rem 0.95rem; font-size: 0.875rem; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--blue); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { background: var(--blue-soft); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--navy); }
.btn--light:hover { background: #f0f4f9; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}
.link-arrow::after { content: "›"; font-size: 1.25em; line-height: 1; transform: translateY(-0.04em); transition: transform 200ms var(--ease-out); }
.link-arrow:hover::after { transform: translate(3px, -0.04em); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(4rem, 9vw, 7rem);
  overflow: hidden;
}
.hero::before {
  /* Soft brand aura behind the mark */
  content: "";
  position: absolute;
  width: 62rem;
  height: 62rem;
  right: -22rem;
  top: -18rem;
  background:
    radial-gradient(closest-side, rgba(26, 138, 214, 0.10), transparent 70%),
    radial-gradient(closest-side at 35% 70%, rgba(111, 154, 44, 0.10), transparent 70%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero__mark { justify-self: center; width: min(100%, 26rem); }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--ink-3);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero__meta svg { width: 1.1rem; height: 1.1rem; color: var(--green); flex: none; }

@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__mark { order: -1; width: min(60%, 15rem); }
}

/* Page heroes (inner pages) */
.page-hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3.5rem);
}
.page-hero .lead { margin-top: 0.5rem; }

/* ---------- Cards ---------- */

.card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.section--alt .card { box-shadow: none; }
.card p:last-child { margin-bottom: 0; }

.card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1.1rem;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.card__icon--green { background: var(--green-soft); color: var(--green); }
.card__icon svg { width: 22px; height: 22px; }

.step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
}

/* ---------- Conditions ---------- */

.conditions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.conditions li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.section:not(.section--alt) .conditions li { background: var(--bg-alt); }
/* Pills that link to a treatment page: the whole pill is the tap target */
.conditions li:has(> a) { padding: 0; }
.conditions li:has(> a)::before { display: none; }
.conditions a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  color: inherit;
  border-radius: inherit;
  transition: background-color 160ms var(--ease), transform 100ms ease-out;
}
.conditions a::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-bright), var(--green));
}
.conditions a::after { content: "›"; margin-left: auto; padding-left: 0.25rem; color: var(--ink-3); font-size: 1.2em; line-height: 1; }
.conditions a:hover { text-decoration: none; background: var(--blue-soft); }
.conditions a:active { transform: scale(0.98); }
.conditions li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-bright), var(--green));
}

/* ---------- Feature / media ---------- */

.media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
}
.media img { width: 100%; height: 100%; object-fit: cover; }

/* Portrait of Liam: square, face kept in frame at every width */
.media.media--portrait { aspect-ratio: 1 / 1; background: #e9e7e1; }
.media--portrait picture { display: block; width: 100%; height: 100%; }
.media--portrait img { object-position: 50% 30%; }

.person { display: flex; align-items: center; gap: 0.9rem; margin: 0.25rem 0 1.1rem; }
.person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.person strong { display: block; font-weight: 600; color: var(--ink); }
.person span { display: block; font-size: 0.875rem; color: var(--ink-3); }

.checklist { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.checklist li { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--ink-2); }
.checklist svg { width: 1.3rem; height: 1.3rem; flex: none; margin-top: 0.12rem; color: var(--green); }

/* ---------- Gallery (scroll-snap, native momentum) ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 26rem);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery figure {
  margin: 0;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--line-soft);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-controls { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms var(--ease), transform 100ms ease-out, opacity 160ms var(--ease);
}
.icon-btn:hover { background: var(--line); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Banner / CTA ---------- */

.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(2.25rem, 6vw, 4.5rem);
  background: linear-gradient(135deg, var(--navy) 0%, #0d5b9e 55%, #3f7d3a 130%);
  color: #fff;
}
.banner h2, .banner p { color: #fff; }
.banner p { opacity: 0.85; max-width: 36rem; }
.banner__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.banner .btn--ghost { --btn-fg: #fff; }
.banner .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
/* Whole mark, kept fully inside the banner */
.banner::after {
  content: "";
  position: absolute;
  right: clamp(1.5rem, 5vw, 4.5rem);
  top: 50%;
  width: min(15rem, 32%);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: url("../img/mark.png") center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
}
.banner > * { position: relative; z-index: 1; }
@media (max-width: 760px) { .banner::after { display: none; } }

/* ---------- Memberships ---------- */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.badges li {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
}
.section--alt .badges li { background: var(--bg); }
.badges abbr { text-decoration: none; font-weight: 700; color: var(--ink); margin-right: 0.35rem; }

/* ---------- Contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 880px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
}
.contact-item .card__icon { margin: 0; flex: none; }
.contact-item strong { display: block; font-weight: 600; color: var(--ink); margin-bottom: 0.1rem; }
.contact-item span, .contact-item address { font-style: normal; color: var(--ink-2); font-size: 0.975rem; line-height: 1.5; }
.contact-item a { font-weight: 500; }
.note { font-size: 0.9375rem; color: var(--ink-3); }

/* ---------- Form ---------- */

.form-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}
.form-card h2, .form-card h3 { margin-bottom: 0.35rem; }
.form-card > p { margin-bottom: 1.75rem; }

.form { display: grid; gap: 1.1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.4rem; }
.field label, .field legend {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0;
}
.field .optional { font-weight: 400; color: var(--ink-3); }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font); /* 16px keeps iOS from zooming */
  letter-spacing: -0.005em;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: #a1a1a6; }
.input:hover { border-color: #b8b8bd; }
.input:focus {
  outline: none;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(26, 138, 214, 0.16);
}
textarea.input { min-height: 8.5rem; resize: vertical; }
select.input {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
}

.field.is-invalid .input { border-color: var(--danger); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 4px rgba(196, 39, 28, 0.14); }
.field__error {
  display: none;
  font-size: 0.8125rem;
  color: var(--danger);
}
.field.is-invalid .field__error { display: block; }

/* Segmented control */
.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: 12px;
  background: var(--line-soft);
  border: 0;
  margin: 0;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  padding: 0.5rem 1.1rem;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.segmented input:checked + label {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}
.segmented input:focus-visible + label { outline: 3px solid rgba(26, 138, 214, 0.55); outline-offset: 1px; }

/* Captcha */
.captcha {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--bg-alt);
}
.captcha__q {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.captcha__q strong {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 4.5ch;
}
.captcha .input { min-height: 44px; max-width: 8rem; justify-self: end; text-align: center; font-variant-numeric: tabular-nums; }
.captcha .field__error { grid-column: 1 / -1; }
.captcha__refresh {
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--ink-3);
}
.captcha__refresh:hover { background: var(--line-soft); color: var(--ink); }
.captcha__refresh.is-spinning svg { animation: spin 600ms var(--ease-out); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) {
  .captcha { grid-template-columns: 1fr; }
  .captcha .input { max-width: none; justify-self: stretch; }
}

/* Honeypot — invisible to people, tempting to bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
}
.form__privacy { margin: 0; font-size: 0.8125rem; color: var(--ink-3); max-width: 22rem; line-height: 1.45; }

.btn[data-loading="true"] { pointer-events: none; opacity: 0.85; }
.btn .spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn[data-loading="true"] .spinner { display: inline-block; }

.form-alert {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  background: #fdecea;
  color: #8a1c14;
}
.form-alert.is-visible { display: block; }

.form-success {
  display: none;
  text-align: center;
  padding: 2rem 0.5rem;
}
.form-success.is-visible { display: block; animation: materialize 500ms var(--ease-out) both; }
.form-success__tick {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--success);
}
.form-success__tick svg { width: 30px; height: 30px; }
.form-success__tick path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 450ms 200ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes materialize {
  from { opacity: 0; transform: scale(0.97); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- FAQ (native details) ---------- */

.faq { max-width: 48rem; }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 300ms var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq .faq__body { padding: 0 0 1.4rem; max-width: 42rem; }
.faq .faq__body p:last-child { margin-bottom: 0; }

/* ---------- Links page ---------- */

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  transition: transform 100ms ease-out, box-shadow 200ms var(--ease);
}
.link-list a:hover { text-decoration: none; box-shadow: var(--shadow); }
.link-list a:active { transform: scale(0.99); }
.link-list strong { display: block; font-weight: 600; letter-spacing: -0.01em; }
.link-list span { display: block; font-size: 0.9rem; color: var(--ink-3); }
.link-list svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }

/* Treatment links (icon + text + chevron) */
.treatments { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.treatments a { justify-content: flex-start; }
.section--alt .treatments a { background: var(--bg); }
.section:not(.section--alt) .treatments a { background: var(--bg-alt); }
.treatments .card__icon svg { width: 22px; height: 22px; color: inherit; }

/* Safety note on treatment pages */
.callout {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: #fff6e5;
  color: #6b4a00;
}
.callout strong { display: block; margin-bottom: 0.25rem; color: #4d3500; }
.callout p { margin: 0; color: inherit; font-size: 0.9375rem; }

/* ---------- Footer ---------- */

.footer {
  background: var(--bg-alt);
  padding-block: 3.5rem 2rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__about { grid-column: 1 / -1; } }
.footer h4 { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; color: var(--ink); margin-bottom: 0.85rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--ink); }
.footer p { color: var(--ink-3); font-size: 0.875rem; max-width: 22rem; }
.footer address { font-style: normal; line-height: 1.6; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
}

/* ---------- Mobile call bar ---------- */

.callbar {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 40;
  display: none;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transform: translateY(150%);
  transition: transform 420ms var(--ease-out);
}
.callbar.is-visible { transform: none; }
.callbar .btn { flex: 1; min-height: 46px; font-size: 1rem; }
@media (max-width: 640px) {
  .callbar { display: flex; }
  body { padding-bottom: 5rem; }
}

/* ---------- Phone layout ----------
   Denser rhythm for small screens: less dead space between sections,
   two-up condition pills, and cards that read as compact rows. */

@media (max-width: 640px) {
  :root { --gutter: 1.125rem; --radius: 16px; --radius-lg: 22px; }

  body { font-size: 1rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.625rem; line-height: 1.15; }
  h3 { font-size: 1.125rem; }
  .display { font-size: 2.5rem; letter-spacing: -0.03em; }
  .lead { font-size: 1.0625rem; line-height: 1.5; }
  .eyebrow { font-size: 0.8125rem; margin-bottom: 0.5rem; }

  .section { padding-block: 2.75rem; }
  .section--tight { padding-block: 1.5rem; }
  .section-head { margin-bottom: 1.5rem; }
  .grid { gap: 0.75rem; }
  .grid--2 { gap: 1.75rem; }

  /* Hero: small mark, actions side by side, trust points on one line */
  .hero { padding-block: 1.25rem 2.5rem; }
  .hero::before { width: 32rem; height: 32rem; right: -14rem; top: -10rem; }
  .hero__mark { width: 8.5rem; margin-bottom: 0.25rem; }
  .hero__grid { gap: 0.75rem; text-align: left; }
  .hero__actions { margin-top: 1.5rem; gap: 0.5rem; }
  .hero__actions .btn { flex: 1 1 auto; padding-inline: 1rem; font-size: 1rem; }
  .hero__meta { margin-top: 1.25rem; gap: 0.4rem 1rem; font-size: 0.8125rem; }

  .page-hero { padding-block: 2rem 1.25rem; }
  .page-hero .lead { margin-top: 0.25rem; }

  /* Cards become rows: icon on the left, text beside it */
  .grid--3 > .card {
    display: grid;
    grid-template-columns: 40px 1fr;
    column-gap: 0.95rem;
    align-items: start;
    padding: 1.1rem 1.15rem;
  }
  .grid--3 > .card > * { grid-column: 2; }
  .grid--3 > .card > .card__icon { grid-column: 1; grid-row: 1 / span 3; width: 40px; height: 40px; margin: 0; border-radius: 11px; }
  .grid--3 > .card .step-num { margin-bottom: 0.1rem; font-size: 0.75rem; }
  .grid--3 > .card h3 { margin-bottom: 0.3rem; }
  .grid--3 > .card p { font-size: 0.9375rem; line-height: 1.5; }

  /* Conditions two-up */
  .conditions { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .conditions li { padding: 0.7rem 0.75rem; gap: 0.5rem; font-size: 0.875rem; line-height: 1.3; border-radius: 12px; }
  .conditions li::before, .conditions a::before { width: 6px; height: 6px; }
  .conditions a { padding: 0.7rem 0.75rem; gap: 0.5rem; }

  .media { border-radius: var(--radius); aspect-ratio: 16 / 10; }
  .checklist { margin-top: 1rem; gap: 0.6rem; font-size: 0.9375rem; }

  .gallery { grid-auto-columns: 84%; gap: 0.625rem; }
  .gallery-controls { display: none; } /* swipe is the native gesture here */

  .badges { gap: 0.5rem; }
  .badges li { padding: 0.45rem 0.8rem; font-size: 0.8125rem; }

  .banner { padding: 1.75rem 1.5rem; }
  .banner__actions { margin-top: 1.25rem; gap: 0.5rem; }
  .banner__actions .btn { flex: 1 1 auto; font-size: 1rem; }

  /* Contact + form */
  .contact-layout { gap: 1.5rem; }
  .contact-list { gap: 0.5rem; }
  .contact-list[style] { margin-top: 1.25rem !important; }
  .contact-item { padding: 0.85rem 1rem; gap: 0.85rem; align-items: center; }
  .contact-item .card__icon { width: 38px; height: 38px; border-radius: 10px; }
  .form-card { padding: 1.35rem 1.15rem; border-radius: var(--radius-lg); }
  .form-card > p { margin-bottom: 1.25rem; font-size: 0.9375rem; }
  .form, .form__row { gap: 0.9rem; }
  .segmented { display: grid; width: 100%; }
  .form__footer { flex-direction: column-reverse; align-items: stretch; }
  .form__footer .btn { width: 100%; min-height: 50px; }
  .form__privacy { text-align: center; max-width: none; }

  .faq summary { padding: 1.05rem 0; font-size: 1.0625rem; }

  .link-list a { padding: 0.95rem 1.1rem; }

  .footer { padding-block: 2.25rem 1.5rem; }
  .footer__grid { gap: 1.5rem 1rem; padding-bottom: 1.5rem; }
  .footer__bottom { flex-direction: column; gap: 0.25rem; }

  .reveal { transform: translateY(12px); }
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 900ms var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal { transform: none; transition: opacity 300ms ease; }
  .nav__links, .callbar { transition: opacity 200ms ease !important; transform: none !important; }
  .callbar:not(.is-visible) { opacity: 0; }
  .btn:active, .icon-btn:active, .link-list a:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav, .nav__links, .callbar {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root { --ink-2: #1d1d1f; --ink-3: #3a3a3c; --line: #8e8e93; }
  .nav { background: #fff; border-bottom: 1px solid #000; }
  .input { border-color: #6e6e73; }
}

@media print {
  .nav, .callbar, .gallery-controls, .form-card, .banner { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}
