/* ==========================================================================
   M R Dental — site styles
   Brand guideline is fixed: palette, Avenir (headings) + Mulish (body), logo rules.
   Avenir is a commercial typeface; "Nunito Sans" is the stand-in until the
   Avenir webfont licence is in place (see assets/fonts/README.md).
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito Sans";
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/mulish-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Mulish";
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/mulish-latin-italic.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* Brand palette — do not change */
  --teal: #24a88f;
  --teal-deep: #147f6b;
  --mint: #89ccbf;
  --grey: #d8d8d8;
  --white: #ffffff;
  --charcoal: #494848;

  /* Derived (tints/overlays of the palette, not new brand colours) */
  --paper: var(--white);
  --paper-soft: #f3f8f6;           /* 6% mint on white */
  --ink: var(--charcoal);
  --ink-strong: #2f3634;           /* charcoal deepened for display type */
  --ink-soft: #626866;
  --rule: var(--grey);
  --scrim: 13, 52, 46;             /* deep teal at ~40% black, used as rgba() */

  /* Type */
  --font-head: "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Mulish", "Segoe UI", system-ui, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-h3: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  --text-h2: clamp(2rem, 1.1rem + 2.6vw, 3.25rem);
  --text-display: clamp(2.5rem, 1.2rem + 3.8vw, 4.25rem);

  /* Layout */
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --space-section: clamp(72px, 9vw, 136px);
  --header-h: 84px;
  --radius: 4px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 300; line-height: 1.1; color: var(--ink-strong); }
p { margin: 0 0 1.25em; }
p:last-child { margin-bottom: 0; }
a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--teal); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--white); color: var(--teal-deep); padding: 10px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); line-height: 1;
  text-decoration: none; transition: background-color .2s, color .2s, border-color .2s;
  border: 1px solid transparent;
}
.btn--primary { background: var(--teal); color: var(--white); border-color: var(--teal); }
.btn--primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--white); }
.btn--ghost { color: var(--white); border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: var(--white); color: var(--white); }
.btn--outline { color: var(--teal-deep); border-color: var(--teal); }
.btn--outline:hover { background: var(--teal); color: var(--white); }
.btn--light { background: var(--white); color: var(--teal-deep); border-color: var(--white); }
.btn--light:hover { background: var(--mint); border-color: var(--mint); color: var(--teal-deep); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  color: var(--white);
  --logo-icon: var(--teal);
  --logo-word: var(--white);
  transition: color .3s, height .3s;
}
.site-header::before, .site-header::after {
  content: ""; position: absolute; inset: 0; z-index: -1; transition: opacity .3s;
}
/* Over the hero: a soft shade behind the white logo and links. */
.site-header::before {
  background: linear-gradient(to bottom, rgba(var(--scrim), .55), rgba(var(--scrim), 0));
  opacity: 1;
}
/* Solid state: the frosted white bar. It is painted by ::after and never by the header itself:
   a backdrop-filter on the header makes the header the containing block of the fixed mobile
   menu (.site-nav), which then shrinks to the height of the bar and lets the page show
   through behind the links. Keep filter / backdrop-filter / transform off .site-header. */
.site-header::after {
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
  opacity: 0;
}
.site-header.is-solid {
  color: var(--ink-strong);
  --logo-icon: var(--teal);
  --logo-word: var(--teal);
  height: 72px;
}
.site-header.is-solid::before { opacity: 0; }
.site-header.is-solid::after { opacity: 1; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.brand svg { height: 34px; width: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.site-nav__list { display: flex; gap: clamp(18px, 2.4vw, 36px); list-style: none; margin: 0; padding: 0; }
.site-nav__link {
  color: inherit; text-decoration: none; font-weight: 600; font-size: var(--text-sm);
  padding: 8px 0; border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-nav__link:hover, .site-nav__link[aria-current="page"] { border-bottom-color: currentColor; color: inherit; }
.site-nav .btn { padding: 11px 18px; }
.site-header:not(.is-solid) .site-nav .btn--primary { background: var(--white); color: var(--teal-deep); border-color: var(--white); }
.site-header:not(.is-solid) .site-nav .btn--primary:hover { background: var(--mint); border-color: var(--mint); }

.nav-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px; background: currentColor; position: relative;
  transition: transform .3s var(--ease-out), opacity .2s;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  /* The menu is a full-screen sheet. The bar's height is a transparent top border (the teal
     still paints under it), so on a short screen the links scroll beneath the logo and the
     close button instead of running over them. */
  .site-nav {
    position: fixed; inset: 0; z-index: 40;
    border-top: var(--header-h) solid transparent; padding: 24px var(--gutter) 40px;
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--teal-deep); color: var(--white);
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 32px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s, transform .3s var(--ease-out), visibility 0s .3s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .3s var(--ease-out); }
  .brand, .nav-toggle { position: relative; z-index: 45; }
  .site-nav__list { flex-direction: column; gap: 6px; }
  .site-nav__link { font-family: var(--font-head); font-weight: 300; font-size: 2rem; padding: 6px 0; }
  /* Open menu = a teal surface: all-white logo (brand guideline p. 8), white close button and focus ring. */
  .site-header.is-open { color: var(--white); --logo-icon: var(--white); --logo-word: var(--white); }
  .site-header.is-open::before { opacity: 0; }
  .site-header.is-open :focus-visible { outline-color: var(--white); }
  .site-nav .btn, .site-header:not(.is-solid) .site-nav .btn--primary { background: var(--white); color: var(--teal-deep); border-color: var(--white); padding: 14px 24px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(560px, 66vh, 780px);
  display: flex; align-items: flex-end;
  color: var(--white);
  background: var(--teal-deep);
}
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: var(--teal-deep); }
.hero__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 1.2s ease; }
.hero__player {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  pointer-events: none;
}
.hero__player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__player iframe { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 0; pointer-events: none; }
.hero.is-playing .hero__player { opacity: 1; }
.hero.is-playing .hero__poster { opacity: 0; transition-delay: .3s; }
.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(var(--scrim), .90) 0%, rgba(var(--scrim), .78) 34%, rgba(var(--scrim), .28) 66%, rgba(var(--scrim), .08) 100%),
    linear-gradient(0deg, rgba(var(--scrim), .55) 0%, rgba(var(--scrim), 0) 40%);
}
.hero__inner { position: relative; padding: calc(var(--header-h) + 28px) 0 48px; }
.hero__content { max-width: 640px; }
.br-wide { display: none; }
@media (min-width: 861px) { .br-wide { display: inline; } }
.hero__title { color: var(--white); font-size: var(--text-display); letter-spacing: -0.015em; margin-bottom: 0.3em; }
.hero__tagline { font-family: var(--font-head); font-weight: 400; font-size: var(--text-lg); color: var(--mint); margin: 0 0 1.1em; letter-spacing: 0.005em; }
.hero__desc { max-width: 60ch; font-size: var(--text-md); line-height: 1.6; color: rgba(255,255,255,.92); margin-bottom: 1.6em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__sound {
  position: absolute; right: var(--gutter); bottom: 28px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 10px; border-radius: 999px;
  color: var(--white); background: rgba(var(--scrim), .45); border: 1px solid rgba(255,255,255,.35);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.01em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease-out), background-color .2s;
}
.hero.is-playing .hero__sound { opacity: 1; transform: none; }
.hero__sound:hover { background: rgba(var(--scrim), .7); }
.hero__sound svg { width: 18px; height: 18px; }
.hero__sound .on, .hero__sound[aria-pressed="true"] .off { display: none; }
.hero__sound[aria-pressed="true"] .on { display: block; }
.hero__sound[hidden] { display: none; }

@media (max-width: 860px) {
  .hero { min-height: 82vh; }
  .hero__inner { padding-bottom: 84px; }
  .hero__desc { font-size: 1rem; }
  .hero__scrim {
    background:
      linear-gradient(180deg, rgba(var(--scrim), .70) 0%, rgba(var(--scrim), .80) 55%, rgba(var(--scrim), .88) 100%);
  }
  .hero__sound { bottom: 20px; }
}

/* ---------- Section rhythm ---------- */
.section { padding-block: var(--space-section); }
.section__heading { font-size: var(--text-h2); letter-spacing: -0.01em; max-width: 16ch; margin-bottom: 0.6em; }
.lead { font-size: var(--text-lg); line-height: 1.55; }
.rule { width: 48px; height: 2px; background: var(--teal); border: 0; margin: 0 0 28px; }

/* ---------- About teaser ---------- */
.about { padding-block: var(--space-section); overflow: clip; }
.about__grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.about__figure { margin: 0; position: relative; }
.about__figure img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: 48% 55%; }
.about__figure figcaption { margin-top: 14px; font-size: var(--text-xs); color: var(--ink-soft); }
.about__body p { max-width: 58ch; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 36px 0 40px; padding: 0; list-style: none; }
.facts li { padding-top: 14px; border-top: 1px solid var(--rule); }
.facts strong { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.5rem; color: var(--teal-deep); line-height: 1.1; margin-bottom: 6px; letter-spacing: -0.01em; }
.facts span { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.45; display: block; }

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Announcement (new identity) ---------- */
.identity {
  background: var(--teal-deep); color: var(--white);
  padding-block: var(--space-section);
  overflow: clip;
  --logo-icon: var(--white); --logo-word: var(--white);
}
.identity h2, .identity h3 { color: var(--white); }
.identity .rule { background: var(--mint); }
.identity__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.identity__intro { max-width: 52ch; }
.identity__intro p { color: rgba(255,255,255,.9); }
.identity__quote { font-family: var(--font-head); font-weight: 300; font-size: var(--text-h3); line-height: 1.35; color: var(--white); margin: 0 0 1.2em; max-width: 30ch; }

.mark { position: relative; display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; margin-bottom: 40px; }
.mark__svg { width: clamp(132px, 15vw, 200px); height: auto; overflow: visible; }
.mark__svg path { transition: transform 1.1s var(--ease-out), opacity .9s ease; opacity: 0; }
.mark__svg path:nth-child(1) { transform: translate(-60px, -40px); }
.mark__svg path:nth-child(2) { transform: translate(60px, -40px); transition-delay: .12s; }
.mark__svg path:nth-child(3) { transform: translate(0, 70px); transition-delay: .24s; }
.identity.is-visible .mark__svg path { transform: none; opacity: 1; }
.mark__labels { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.mark__labels li { display: flex; align-items: baseline; gap: 14px; font-family: var(--font-head); font-size: var(--text-h3); font-weight: 400; opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s var(--ease-out); }
.mark__labels li::before { content: ""; width: 18px; height: 2px; background: var(--mint); flex: none; transform: translateY(-5px); }
.identity.is-visible .mark__labels li { opacity: 1; transform: none; }
.identity.is-visible .mark__labels li:nth-child(1) { transition-delay: .9s; }
.identity.is-visible .mark__labels li:nth-child(2) { transition-delay: 1.05s; }
.identity.is-visible .mark__labels li:nth-child(3) { transition-delay: 1.2s; }

.identity__why p { max-width: 56ch; color: rgba(255,255,255,.9); }
.swatch { display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: start; margin: 36px 0; padding: 22px 0; border-top: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); }
.swatch__chip { width: 72px; height: 72px; background: var(--teal); border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.swatch__text strong { display: block; font-family: var(--font-head); font-weight: 400; font-size: var(--text-lg); margin-bottom: 4px; }
.swatch__text p { font-size: var(--text-sm); margin: 0; max-width: 46ch; }
.identity__close { margin-top: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; }
.identity__close p { font-family: var(--font-head); font-weight: 300; font-size: var(--text-h2); line-height: 1.1; letter-spacing: -0.01em; margin: 0; flex: 1 1 320px; }

@media (max-width: 900px) {
  .identity__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mark { grid-template-columns: 1fr; }
  .mark__svg { width: 120px; }
}

/* ---------- Certifications strip ---------- */
.certs { background: var(--paper-soft); padding-block: 32px; border-top: 1px solid var(--rule); }
.certs__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 44px; }
.certs__list { display: flex; flex-wrap: wrap; gap: 14px 40px; list-style: none; margin: 0; padding: 0; }
.certs__list li { display: flex; align-items: center; gap: 12px; font-size: var(--text-sm); color: var(--ink); }
.certs__list svg { width: 20px; height: 20px; color: var(--teal); flex: none; }
.certs__note { margin-left: auto; font-size: var(--text-xs); color: var(--ink-soft); }
.certs__note a { color: var(--teal-deep); }
@media (max-width: 760px) { .certs__note { margin-left: 0; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-deep); color: rgba(255,255,255,.88);
  padding: 72px 0 36px; --logo-icon: var(--white); --logo-word: var(--white);
  font-size: var(--text-sm);
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--mint); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.2); }
.site-footer__brand svg { width: 240px; max-width: 100%; height: auto; margin-bottom: 18px; }
.site-footer__brand p { max-width: 36ch; }
.site-footer h3 { font-family: var(--font-head); font-weight: 500; font-size: var(--text-md); color: var(--white); margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer address + address { margin-top: 18px; }
.site-footer__contact a { text-decoration: none; }
.site-footer__contact a:hover { text-decoration: underline; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; font-size: var(--text-xs); color: rgba(255,255,255,.72); }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.site-footer__legal a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer__legal a:hover { color: var(--white); text-decoration: underline; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mark__svg path, .mark__labels li, .hero__poster, .hero__player, .hero__sound { transition: none; }
  .mark__svg path { transform: none; opacity: 1; }
  .mark__labels li { opacity: 1; transform: none; }
}
