/* Dr Shaun East, Orthopaedic Surgeon
   Palette from the practice logo: navy and gold, on bone white. */

:root {
  --navy: #1c2542;
  --navy-logo: #283052;
  --navy-deep: #131a30;
  --gold: #a9812f;
  --gold-light: #d9b25f;
  --bone: #f6f4ee;
  --white: #ffffff;
  --ink: #1a1d27;
  --slate: #5b6070;
  --rule: #dcd9d0;
  --rule-navy: rgba(255, 255, 255, 0.14);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;

  --measure: 34rem;
  --pad: clamp(1.25rem, 5vw, 5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 1em; }
dl, dd { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Masthead */
.masthead {
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem var(--pad);
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}
.brand img { width: clamp(180px, 22vw, 260px); height: auto; }
.masthead nav { display: flex; gap: 1.75rem; margin-left: auto; }
.masthead nav a, .masthead-phone { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--navy); }
.masthead nav a { border-bottom: 2px solid transparent; padding: 0.2rem 0; }
.masthead nav a:hover { border-color: var(--gold); }
.masthead-phone { white-space: nowrap; color: var(--gold); }
.masthead-phone:hover { text-decoration: underline; }

/* Hero */
.hero {
  padding: 0; /* overrides the generic section padding; hero-text carries its own */
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  min-height: min(82vh, 760px);
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
.hero-text {
  padding: clamp(3rem, 8vw, 6rem) var(--pad) clamp(3rem, 8vw, 6rem);
  max-width: 40rem;
  position: relative; z-index: 1;
}
.hero-role { color: var(--gold-light); font-weight: 500; margin-bottom: 1.5rem; }
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.025em;
  max-width: 12ch;
  margin-bottom: 1.5rem;
}
.hero-lede { max-width: var(--measure); font-size: 1.125rem; color: rgba(255, 255, 255, 0.82); margin-bottom: 2.25rem; }
.hero-actions { display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap; }

.hero-stage {
  position: relative;
  align-self: stretch;
  min-height: 420px;
  background:
    radial-gradient(60% 55% at 55% 50%, rgba(217, 178, 95, 0.22), rgba(217, 178, 95, 0) 70%),
    radial-gradient(90% 90% at 70% 40%, var(--navy-logo), var(--navy-deep));
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-fallback { position: absolute; inset: 0; margin: auto; width: 160px; opacity: 0.9; display: none; }
.hero-stage.no-webgl .hero-canvas { display: none; }
.hero-stage.no-webgl .hero-fallback { display: block; }

/* Page-load motion: one orchestrated entrance for the hero copy. */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-text > :nth-child(2) { animation-delay: 0.08s; }
  .hero-text > :nth-child(3) { animation-delay: 0.16s; }
  .hero-text > :nth-child(4) { animation-delay: 0.24s; }
  .hero-stage { animation: fadein 1.4s ease-out both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* Buttons and links */
.button {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.9rem 1.6rem;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.button:hover { background: #8f6c25; }
.link-quiet { font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; text-decoration-color: var(--gold); }
.link-quiet:hover { text-decoration-thickness: 2px; }

/* Sections */
section { padding: clamp(3.5rem, 8vw, 7rem) var(--pad); }
.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head p { color: var(--slate); margin: 1rem 0 0; }

/* Treatments */
.treatments { background: var(--bone); }
.treatment-groups {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
.treatment-group h3 { color: var(--navy); padding-bottom: 0.75rem; border-bottom: 2px solid var(--gold); margin-bottom: 0.5rem; }
.treatment-group dl > div { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.treatment-group:first-child dl { columns: 2; column-gap: 3rem; }
.treatment-group:first-child dl > div { break-inside: avoid; }
.treatment-group dt { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--navy); margin-bottom: 0.25rem; }
.treatment-group dd { color: var(--slate); font-size: 0.98rem; }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.about-text { max-width: var(--measure); }
.about-text h2 { margin-bottom: 1.25rem; }
.about-text p { font-size: 1.1rem; }
.credentials { border-left: 2px solid var(--gold); padding-left: 1.75rem; }
.credentials h3 { color: var(--navy); margin-bottom: 1rem; }
.credentials dl > div { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.credentials dt { font-size: 0.85rem; color: var(--slate); margin-bottom: 0.1rem; }
.credentials dd { font-weight: 600; color: var(--navy); }

/* Patient forms */
.patients { background: var(--bone); }
.downloads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); gap: 1.25rem; }
.downloads a {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  background: var(--white);
  border-left: 4px solid var(--gold);
  text-decoration: none;
  transition: border-left-width 0.15s ease;
}
.downloads a:hover { border-left-width: 10px; }
.download-name { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--navy); }
.download-meta { font-size: 0.9rem; color: var(--slate); }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  background: var(--navy);
  color: var(--white);
}
.contact h2 { margin-bottom: 1.5rem; }
.contact address { font-style: normal; font-size: 1.1rem; margin-bottom: 1.5rem; }
.contact-lines > div { display: grid; grid-template-columns: 6.5rem 1fr; padding: 0.55rem 0; border-top: 1px solid var(--rule-navy); }
.contact-lines dt { color: var(--gold-light); font-size: 0.95rem; }
.contact-lines dd a { text-decoration: none; font-weight: 500; }
.contact-lines dd a:hover { text-decoration: underline; }
.contact-details > .link-quiet { display: inline-block; margin-top: 1.5rem; }

.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 34rem; }
.form-lede { color: rgba(255, 255, 255, 0.78); margin-top: -0.75rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.95rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink);
  padding: 0.75rem 0.9rem;
  border: 1px solid transparent; border-radius: 3px;
  background: var(--white);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.contact-form textarea { resize: vertical; min-height: 7rem; }
.contact-form .button { align-self: flex-start; margin-top: 0.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { min-height: 1.5em; color: var(--gold-light); margin: 0; }

/* Footer */
.footer {
  padding: 2rem var(--pad);
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer p { margin: 0; }

/* Responsive */
@media (max-width: 960px) {
  .masthead { flex-wrap: wrap; gap: 0.75rem 1.5rem; }
  .masthead nav { margin-left: 0; order: 3; width: 100%; gap: 1.25rem; flex-wrap: wrap; }
  .masthead-phone { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-stage { min-height: 360px; }
  .treatment-groups, .about, .contact { grid-template-columns: 1fr; }
  .treatment-group:first-child dl { columns: 1; }
  .credentials { border-left: 0; border-top: 2px solid var(--gold); padding: 1.5rem 0 0; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .brand img { width: 170px; }
  .hero h1 { font-size: 2.4rem; }
  .hero-stage { min-height: 300px; }
  .contact-lines > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .footer { flex-direction: column; }
}

/* Services dropdown (masthead) */
.nav-services { position: relative; }
.nav-services summary {
  list-style: none; cursor: pointer; font-weight: 500; font-size: 0.95rem; color: var(--navy);
  border-bottom: 2px solid transparent; padding: 0.2rem 0; white-space: nowrap;
}
.nav-services summary::-webkit-details-marker { display: none; }
.nav-services summary::after { content: ''; display: inline-block; width: 0.4em; height: 0.4em; margin-left: 0.45em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-0.2em) rotate(45deg); }
.nav-services summary:hover, .nav-services[open] summary { border-color: var(--gold); }
.nav-services ul {
  list-style: none; margin: 0; padding: 0.5rem 0; position: absolute; left: 0; top: calc(100% + 0.6rem); z-index: 20;
  min-width: 18rem; background: var(--white); border: 1px solid var(--rule); border-top: 2px solid var(--gold);
  box-shadow: 0 12px 32px rgba(28, 37, 66, 0.12);
}
.nav-services ul::before { content: ''; position: absolute; left: 0; right: 0; top: -0.7rem; height: 0.7rem; }
.masthead nav .nav-services ul a { display: block; padding: 0.55rem 1.25rem; border-bottom: 0; }
.masthead nav .nav-services ul a:hover { background: var(--bone); }
.treatment-group dt a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.treatment-group dt a:hover { border-color: var(--gold); }

/* Service pages */
.page-hero { background: var(--navy); color: var(--white); padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero h1 { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.05; max-width: 22ch; margin: 0 0 1.25rem; }
.breadcrumb { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--gold-light); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-hero .hero-actions .link-quiet { color: var(--white); }
.service-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: clamp(2.5rem, 6vw, 5rem); padding: clamp(3rem, 7vw, 5.5rem) var(--pad); align-items: start; }
.service-section { padding: 0; margin-bottom: 2.75rem; }
.service-section:last-child { margin-bottom: 0; }
.service-section h2 { font-family: var(--display); font-weight: 500; font-size: 1.6rem; color: var(--navy); margin: 0 0 0.9rem; }
.service-section p, .service-section li { max-width: var(--measure); color: var(--ink); }
.service-section p { margin: 0 0 1rem; }
.service-section ul { margin: 0; padding-left: 1.2rem; }
.service-section li { margin-bottom: 0.5rem; }
.service-aside { background: var(--bone); padding: 1.75rem; position: sticky; top: 1.5rem; }
.service-aside h3 { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--navy); margin: 0 0 0.9rem; }
.service-aside h3 + ul, .service-aside dl { margin: 0 0 1.75rem; }
.service-aside dl > div { padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.service-aside dt { font-size: 0.8rem; color: var(--slate); margin-bottom: 0.1rem; }
.service-aside dd { margin: 0; font-size: 0.95rem; color: var(--ink); }
.related { list-style: none; margin: 0; padding: 0; }
.related li { border-top: 1px solid var(--rule); }
.related a { display: block; padding: 0.55rem 0; color: var(--navy); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.related a:hover { color: var(--gold); }
.faq { background: var(--bone); }
.faq h2 { font-family: var(--display); font-weight: 500; font-size: 1.9rem; color: var(--navy); margin: 0 0 1.5rem; }
.faq-item { max-width: 44rem; border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item summary { cursor: pointer; padding: 1rem 0; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--gold); font-weight: 400; font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 0 0 1.25rem; max-width: var(--measure); color: var(--ink); }
.cta-band { background: var(--navy-deep); color: var(--white); text-align: center; }
.cta-band h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 auto 1rem; max-width: 24ch; }
.cta-band p { max-width: var(--measure); margin: 0 auto 2rem; color: rgba(255, 255, 255, 0.78); }
.cta-band a:not(.button) { color: var(--gold-light); }
@media (max-width: 960px) {
  .nav-services ul { position: static; min-width: 0; box-shadow: none; border: 0; border-left: 2px solid var(--gold); padding: 0.25rem 0; margin-top: 0.5rem; }
  .masthead nav .nav-services ul a { padding: 0.4rem 1rem; }
  .service-layout { grid-template-columns: 1fr; }
  .service-aside { position: static; }
}
