/* ==========================================================================
   Centro de Fisioterapia San Juan
   Sistema: marfil / piedra / salvia / tinta. Un solo acento (salvia).
   Formas: controles en píldora, fotografía con arista recta,
   campos de formulario solo con subrayado.
   ========================================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}

:root {
  --ivory: #F3F1EA;
  --ivory-2: #ECE9E0;
  --stone: #E2DED3;
  --stone-line: #D3CEC1;
  --ink: #1B201D;
  --ink-2: #464D48;
  --ink-3: #5D645F;
  --sage: #8A9A82;
  --sage-ink: #4D5F4E;
  --sage-deep: #2E3A31;
  --on-deep: #EEEBE3;
  --on-deep-2: #C3CCBE;

  --bg: var(--ivory);
  --bg-alt: var(--ivory-2);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --line: var(--stone-line);
  --accent: var(--sage-ink);
  --btn-bg: var(--ink);
  --btn-fg: var(--ivory);
  --btn-fill: var(--sage-ink);
  --error: #9B3B2E;

  --font-display: "Bricolage", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1360px;
  --gutter: clamp(20px, 4vw, 56px);
  --section: clamp(96px, 13vw, 200px);
  --nav-h: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* z-index scale */
  --z-float: 5;
  --z-dock: 40;
  --z-nav: 50;
  --z-menu: 45;
  --z-skip: 100;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121613;
    --bg-alt: #171C18;
    --fg: #ECE9E1;
    --fg-2: #BEC2BA;
    --fg-3: #A2A79F;
    --line: #2B322D;
    --accent: #A9BA9F;
    --btn-bg: #ECE9E1;
    --btn-fg: #121613;
    --btn-fill: #A9BA9F;
    --sage-deep: #1E2820;
    --error: #E59A8C;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must always win over component display rules (menu, form states):
   otherwise a "hidden" full-screen menu stays on top, invisible, and swallows every click. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(16px, 0.35vw + 15px, 18px);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--sage); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 16px; top: 12px; z-index: var(--z-skip);
  padding: 10px 18px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg);
  transform: translateY(-160%); transition: transform .3s var(--ease-out);
}
.skip:focus { transform: none; }

.ico { width: 1.15em; height: 1.15em; flex: none; }
.accent { color: var(--accent); }

/* ---------- type ---------- */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.25rem, 4.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.link {
  display: inline-flex; align-items: center; gap: .35em;
  color: var(--fg);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease-out), color .3s;
  padding-bottom: 2px;
}
.link .ico { transition: transform .4s var(--ease-out); }
@media (hover: hover) {
  .link:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--accent); }
  .link:hover .ico { transform: translate(2px, -2px); }
}
.link--lg { font-size: 1.15rem; }

/* ---------- buttons ---------- */
.btn {
  --h: 54px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  height: var(--h);
  padding: 0 1.6em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: color .45s var(--ease-out), border-color .45s var(--ease-out), transform .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn--sm { --h: 44px; padding: 0 1.25em; font-size: 14.5px; }
.btn::before {
  content: "";
  position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .55s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn .ico { transition: transform .45s var(--ease-out); }

/* label roll: JS wraps the text in .btn__roll; a text-shadow copy sits 1.3em below
   and rolls into place on hover */
.btn__label { position: relative; display: inline-block; overflow: hidden; line-height: 1.3; height: 1.3em; }
.btn__roll { display: block; transition: transform .55s var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn__roll { text-shadow: 0 1.3em 0 currentColor; }
  .btn:hover::before { transform: translateY(0); }
  .btn:hover .btn__roll { transform: translateY(-1.3em); }
  .btn:hover > .ico { transform: translateX(3px); }
}

.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary::before { background: var(--btn-fill); }
.btn--ghost { border-color: color-mix(in srgb, var(--fg) 30%, transparent); color: var(--fg); }
.btn--ghost::before { background: var(--fg); }
@media (hover: hover) {
  .btn--ghost:hover { color: var(--bg); border-color: var(--fg); }
  .btn--primary:hover { color: var(--btn-fg); }
}
.btn--light { background: var(--on-deep); color: #1E2820; }
.btn--light::before { background: #FFFFFF; }
.btn--ghost-light { border-color: rgb(238 235 227 / .4); color: var(--on-deep); }
.btn--ghost-light::before { background: var(--on-deep); }
@media (hover: hover) { .btn--ghost-light:hover { color: #1E2820; border-color: var(--on-deep); } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  height: var(--nav-h);
  transition: background-color .4s, box-shadow .4s, transform .5s var(--ease-out);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: baseline; gap: .55em; }
.brand__name {
  font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 48;
}
.brand__sub { font-size: 13px; color: var(--fg-2); letter-spacing: 0.02em; }
.nav__links { display: flex; gap: clamp(20px, 2.6vw, 40px); font-size: 15px; }
.nav__links a { position: relative; padding: 6px 0; color: var(--fg-2); transition: color .3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out);
}
@media (hover: hover) {
  .nav__links a:hover { color: var(--fg); }
  .nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
}
.nav__actions { display: flex; align-items: center; gap: 20px; }
.nav__phone { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--fg-2); transition: color .3s; }
@media (hover: hover) { .nav__phone:hover { color: var(--fg); } }
.nav__toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; align-items: center; justify-content: center; cursor: pointer;
}
.nav__toggle .ico { width: 22px; height: 22px; }
.nav__toggle .ico--close { display: none; }
.nav__toggle[aria-expanded="true"] .ico--open { display: none; }
.nav__toggle[aria-expanded="true"] .ico--close { display: block; }

/* mobile menu */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--bg);
  padding: calc(var(--nav-h) + 24px) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-out);
}
.menu.is-open { opacity: 1; pointer-events: auto; }
.menu__nav { display: flex; flex-direction: column; }
.menu__nav a {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2.3rem, 10vw, 3.2rem);
  letter-spacing: -0.035em; line-height: 1.25; padding: 4px 0;
  transform: translateY(18px); opacity: 0;
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms + 80ms);
}
.menu.is-open .menu__nav a { transform: none; opacity: 1; }
.menu__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu__foot p { grid-column: 1 / -1; color: var(--fg-2); font-size: 14px; margin-top: 8px; }

/* ---------- hero ---------- */
.hero { padding-top: calc(var(--nav-h) + clamp(28px, 4vw, 56px)); }
.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.hero__title {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 96;
  font-size: clamp(2.75rem, 7.4vw, 7.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  position: relative; z-index: 2;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero__title .line > span { display: inline-block; }
.hero__title .line:nth-child(2) { padding-left: clamp(0px, 9vw, 150px); }

.hero__copy {
  grid-column: 1 / span 4;
  margin-top: clamp(32px, 4vw, 64px);
  display: flex; flex-direction: column; gap: 32px;
}
.hero__lead { font-size: clamp(1.05rem, 0.4vw + 0.95rem, 1.2rem); color: var(--fg-2); max-width: 34ch; line-height: 1.55; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__media {
  grid-column: 6 / -1;
  margin-top: clamp(32px, 4vw, 64px);
  width: calc(100% + var(--gutter));
  position: relative; z-index: 1;
}
.hero__frame {
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--stone);
}
.hero__frame img {
  width: 100%; height: 118%; position: relative; top: -9%; object-fit: cover; object-position: 50% 40%;
  will-change: transform;
}

/* ---------- intro ---------- */
.intro { padding-block: var(--section) calc(var(--section) * .8); }
.manifesto {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.75rem, 3.6vw, 3.4rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  max-width: 22ch;
  max-width: min(100%, 1080px);
  text-wrap: pretty;
}
.manifesto .w { transition: opacity .25s linear; }
.js .manifesto[data-words-ready] .w { opacity: .18; }
.js .manifesto[data-words-ready] .w.is-on { opacity: 1; }

.intro__grid {
  margin-top: clamp(72px, 9vw, 140px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: end;
}
.intro__media { grid-column: 1 / span 7; overflow: hidden; aspect-ratio: 4 / 3; background: var(--stone); }
.intro__media img { width: 100%; height: 112%; position: relative; top: -6%; object-fit: cover; }
.intro__text { grid-column: 9 / -1; display: flex; flex-direction: column; gap: 18px; color: var(--fg-2); }
.intro__name {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2vw, 2rem);
  letter-spacing: -0.03em; color: var(--fg); line-height: 1.1;
}
.intro__role { margin-top: -10px; font-size: 15px; color: var(--accent); }
.intro__facts { margin-top: 18px; display: grid; gap: 18px; border-top: 1px solid var(--line); padding-top: 22px; }
.intro__facts dt { color: var(--fg); font-weight: 500; }
.intro__facts dd { font-size: 15px; }

/* ---------- services index ---------- */
.services { position: relative; padding-block: calc(var(--section) * .6) var(--section); }
.services .section-title { max-width: 14ch; margin-bottom: clamp(48px, 6vw, 88px); }
.index { border-top: 1px solid var(--line); }
.index__item { border-bottom: 1px solid var(--line); }
.index details > summary { list-style: none; }
.index details > summary::-webkit-details-marker { display: none; }
.index summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(18px, 1.8vw, 26px) 0;
  cursor: pointer;
}
.index__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: "opsz" 96;
  font-size: clamp(1.75rem, 4.2vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  transition: transform .6s var(--ease-out), color .4s;
}
.index__plus { width: 26px; height: 26px; color: var(--fg-2); transition: transform .5s var(--ease-out); }
.index details[open] .index__plus { transform: rotate(45deg); }
.index__body { padding: 0 0 24px; color: var(--fg-2); max-width: 46ch; }
.services__more { margin-top: 40px; color: var(--fg-2); max-width: 60ch; }


/* desktop editorial index: description inline, hover image */
@media (min-width: 900px) {
  .index summary { cursor: default; padding-block: clamp(20px, 1.9vw, 30px); }
  .index__plus { display: none; }
  .index details { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: center; column-gap: 32px; }
  .index details > .index__body { padding: 0; font-size: 15.5px; opacity: .85; transition: opacity .4s; }
  .index__item { transition: background-color .5s var(--ease-out); }
  .index:hover .index__name { color: color-mix(in srgb, var(--fg) 38%, var(--bg)); }
  .index .index__item:hover .index__name { color: var(--fg); transform: translateX(clamp(16px, 2vw, 32px)); }
  .index .index__item:hover .index__body { opacity: 1; }
}

/* ---------- featured ---------- */
.featured { padding-block: calc(var(--section) * .4) var(--section); }
.featured__title { max-width: 13ch; }
.featured__grid {
  margin-top: clamp(56px, 7vw, 110px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  row-gap: clamp(64px, 8vw, 120px);
}
.feature__media { overflow: hidden; background: var(--stone); }
.feature__media img { width: 100%; height: 112%; position: relative; top: -6%; object-fit: cover; }
.feature__text { margin-top: 22px; display: grid; gap: 10px; color: var(--fg-2); max-width: 40ch; }
.feature__title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  letter-spacing: -0.03em; line-height: 1.1; color: var(--fg);
}
.feature--a { grid-column: 1 / span 6; grid-row: 1 / span 2; }
.feature--a .feature__media { aspect-ratio: 4 / 5; }
.feature--b { grid-column: 8 / span 5; margin-top: clamp(80px, 12vw, 200px); }
.feature--b .feature__media { aspect-ratio: 4 / 5; }
.feature--c { grid-column: 8 / span 5; }
.feature--c .feature__media { aspect-ratio: 11 / 8; }
.feature--c { margin-left: calc(-1 * clamp(0px, 6vw, 110px)); }

/* ---------- method ---------- */
.method { padding-block: calc(var(--section) * .6) var(--section); background: var(--bg-alt); }
.method__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}
.method__stage { grid-column: 1 / span 6; position: relative; }
.method__sticky {
  position: sticky; top: calc(var(--nav-h) + 2vh);
  height: calc(100vh - var(--nav-h) - 4vh);
  height: calc(100dvh - var(--nav-h) - 4vh);
  max-height: 960px;
}
.method__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.method__sticky::before {
  content: ""; position: absolute; left: 50%; bottom: 8%; width: 46%; aspect-ratio: 4 / 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sage) 26%, transparent), transparent);
  pointer-events: none;
}
.method__content { grid-column: 8 / -1; padding-top: clamp(40px, 8vh, 100px); }
.method__content .section-title { margin-top: 20px; font-size: clamp(2rem, 3.4vw, 3.4rem); max-width: 15ch; }
.steps { margin-top: clamp(56px, 8vh, 96px); counter-reset: step; }
.step {
  position: relative;
  min-height: 46vh;
  padding: 28px 0 28px 0;
  border-top: 1px solid var(--line);
  color: var(--fg-3);
  transition: color .6s var(--ease-out);
}
.step:last-child { min-height: 34vh; }
.step::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--fg); transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease-out);
}
.step h3 {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 3.2vw, 3rem);
  letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 14px;
  color: var(--fg-3);
  transition: color .6s var(--ease-out);
}
.step p { max-width: 36ch; }
.step.is-active { color: var(--fg-2); }
.step.is-active h3 { color: var(--fg); }
.step.is-active::before { transform: scaleX(1); }

/* ---------- cta ---------- */
.cta {
  position: relative; overflow: hidden;
  background: var(--sage-deep);
  color: var(--on-deep);
  min-height: min(92vh, 860px);
  min-height: min(92dvh, 860px);
  display: flex; align-items: center;
  isolation: isolate;
}
.cta__art {
  position: absolute; z-index: -1;
  top: 50%; right: -6vw;
  width: min(62vw, 900px); height: min(62vw, 900px); /* explicit height: no aspect-ratio dependency */
  transform: translateY(-50%);
}
.cta__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- 3D handoff: still render underneath, live canvas fades in on its first frame ---------- */
.gl-canvas { opacity: 0; transition: opacity 1s var(--ease-out); }
.gl-canvas.is-live { opacity: 1; }
.gl-fallback { position: absolute; inset: 0; pointer-events: none; transition: opacity .9s var(--ease-out); }
.gl-fallback img { width: 100%; height: 100%; object-fit: contain; }
.gl-canvas.is-live + .gl-fallback { opacity: 0; }
.gl-fallback__dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gl-fallback__light { display: none; }
  :root:not([data-theme="light"]) .gl-fallback__dark { display: block; }
}
:root[data-theme="dark"] .gl-fallback__light { display: none; }
:root[data-theme="dark"] .gl-fallback__dark { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .gl-fallback img { animation: gl-breathe 9s ease-in-out infinite alternate; }
}
@keyframes gl-breathe {
  from { transform: translateY(-1.2%) rotate(-1deg); }
  to { transform: translateY(1.2%) rotate(1deg); }
}
.cta__inner { padding-block: clamp(96px, 12vw, 160px); }
.cta__title {
  font-family: var(--font-display); font-weight: 300; font-variation-settings: "opsz" 96;
  font-size: clamp(2.4rem, 5.4vw, 5.4rem); line-height: 1.0; letter-spacing: -0.04em;
  max-width: 12ch;
}
.cta__title .accent { color: var(--on-deep-2); }
.cta__lead { margin-top: 28px; max-width: 38ch; color: var(--on-deep-2); font-size: 1.1rem; }
.cta__actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.cta :focus-visible { outline-color: var(--on-deep); }

/* ---------- location ---------- */
.location { padding-block: var(--section) calc(var(--section) * .5); }
.location__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px); align-items: stretch;
}
.location__text { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.location__text .section-title { font-size: clamp(2rem, 3.6vw, 3.6rem); max-width: 10ch; }
.location__address { font-style: normal; font-size: 1.25rem; line-height: 1.5; margin-top: 12px; }
.location__note { color: var(--fg-2); max-width: 32ch; }
.location__map {
  grid-column: 6 / -1; position: relative; min-height: 460px; overflow: hidden;
  background: var(--stone);
  margin-right: calc(var(--gutter) * -1);
}
.location__map iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  filter: grayscale(1) sepia(.18) contrast(.95) brightness(1.02);
  transition: filter .8s var(--ease-out);
}
@media (prefers-color-scheme: dark) {
  .location__map iframe { filter: grayscale(1) invert(.9) hue-rotate(180deg) contrast(.85) brightness(.95); }
}
@media (hover: hover) { .location__map:hover iframe { filter: none; } }
.location__pin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%);
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--sage-ink); color: var(--ivory); pointer-events: none;
  opacity: 0; transition: opacity .4s;
}
.location__map:not(.is-loaded) .location__pin { opacity: 1; }

/* ---------- contact ---------- */
.contact { padding-block: calc(var(--section) * .5) var(--section); }
.contact__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  border-top: 1px solid var(--line); padding-top: clamp(48px, 6vw, 88px);
}
.contact__intro { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 22px; color: var(--fg-2); }
.contact__intro p { max-width: 34ch; }
.contact__phone {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.03em; color: var(--fg); margin-top: 12px;
  transition: color .3s;
}
@media (hover: hover) { .contact__phone:hover { color: var(--accent); } }

.form { grid-column: 6 / -1; }
.form__body { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; row-gap: 30px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; color: var(--fg-2); font-weight: 500; }
.field__opt { font-weight: 400; color: var(--fg-3); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--fg) 40%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 12px;
  font-size: 17px;
  transition: border-color .3s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 28px;
}
.field select option { background: var(--bg); color: var(--fg); }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--fg); box-shadow: 0 1px 0 var(--fg); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }
.field.has-error input, .field.has-error select { border-bottom-color: var(--error); }
.field__error { font-size: 13.5px; color: var(--error); min-height: 0; }
.field__error:empty { display: none; }
.field--check { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.field--check label { font-weight: 400; flex: 1; font-size: 15px; }
.field--check .field__error { flex-basis: 100%; }
.field--check input {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin: 1px 0 0; flex: none;
  border: 1px solid color-mix(in srgb, var(--fg) 50%, transparent); border-radius: 6px;
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .25s, border-color .25s;
}
.field--check input::after {
  content: ""; width: 10px; height: 6px; border: 1.5px solid var(--btn-fg); border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .25s var(--ease-out);
}
.field--check input:checked { background: var(--btn-bg); border-color: var(--btn-bg); }
.field--check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.form__submit { grid-column: 1 / -1; }
.form.is-sending .btn { opacity: .6; pointer-events: none; }
.form__done { padding-top: 12px; display: grid; gap: 12px; color: var(--fg-2); }
.form__done .ico { width: 40px; height: 40px; color: var(--accent); }
.form__done-title {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.03em; color: var(--fg); line-height: 1.1;
}
.form__done:focus { outline: none; }

/* ---------- footer ---------- */
.footer { overflow: clip; }
.footer { padding-top: clamp(64px, 8vw, 120px); padding-bottom: calc(24px + env(safe-area-inset-bottom)); background: var(--bg-alt); color: var(--fg-2); }
.footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; font-size: 15px; }
.footer__label { color: var(--fg); font-weight: 500; margin-bottom: 10px; }
.footer ul { display: grid; gap: 6px; }
.footer ul a { transition: color .3s; }
@media (hover: hover) { .footer ul a:hover { color: var(--fg); } }
.footer__mark {
  margin-top: clamp(56px, 8vw, 120px);
  font-family: var(--font-display); font-weight: 300; font-variation-settings: "opsz" 96;
  font-size: clamp(5rem, 28.5vw, 30rem);
  line-height: .8; letter-spacing: -0.065em;
  color: var(--fg);
  white-space: nowrap;
  margin-left: -0.04em;
}
.footer__base {
  margin-top: clamp(24px, 3vw, 40px); padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px;
}

/* ---------- mobile dock ---------- */
.dock { display: none; }

/* ==========================================================================
   Motion (only with JS + no reduced-motion preference)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .js .reveal-mask { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-in-out); }
  .js .reveal-mask img { scale: 1.12; transition: scale 1.8s var(--ease-out); }
  .js .reveal-mask.is-in { clip-path: inset(0 0 0 0); }
  .js .reveal-mask.is-in img { scale: 1; }

  .js .hero__title .line > span { transform: translateY(105%); transition: transform 1.3s var(--ease-out); }
  .js .hero__title .line:nth-child(2) > span { transition-delay: .12s; }
  .js .is-loaded .hero__title .line > span { transform: none; }

  .js .hero__frame { clip-path: inset(0 0 100% 0); transition: clip-path 1.6s var(--ease-in-out) .2s; }
  .js .hero__frame img { scale: 1.18; transition: scale 2.4s var(--ease-out) .2s; }
  .js .is-loaded .hero__frame { clip-path: inset(0 0 0 0); }
  .js .is-loaded .hero__frame img { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .nav__phone span { display: none; }
  .hero__copy { grid-column: 1 / span 5; }
  .hero__media { grid-column: 7 / -1; }
}

@media (max-width: 899px) {
  :root { --nav-h: 64px; }
  .nav__links, .nav__phone, .nav__actions > .btn { display: none; }
  .nav__toggle { display: inline-flex; }

  /* hero: stacked, image becomes a tall full-bleed plate under the copy */
  .hero { padding-top: calc(var(--nav-h) + 28px); }
  .hero__grid { display: flex; flex-direction: column; }
  .hero__title { font-size: clamp(2.6rem, 11.6vw, 4.6rem); line-height: 1.0; }
  .hero__title .line:nth-child(2) { padding-left: 0; }
  .hero__copy { margin-top: 24px; gap: 26px; }
  .hero__lead { max-width: 36ch; }
  .hero__ctas .btn { flex: 1 1 0; min-width: 0; }
  .hero__media { margin: 40px calc(var(--gutter) * -1) 0; width: auto; align-self: stretch; }
  .hero__frame { aspect-ratio: 4 / 5; }

  .intro__grid { display: flex; flex-direction: column; gap: 36px; }
  .intro__media { margin-inline: calc(var(--gutter) * -1); aspect-ratio: 5 / 4; }
  .manifesto { font-size: clamp(1.6rem, 6.6vw, 2.4rem); }

  .services .section-title { margin-bottom: 36px; }
  .index__name { font-size: clamp(1.6rem, 7.4vw, 2.6rem); }
  .index summary { min-height: 64px; }

  .featured__grid { display: flex; flex-direction: column; gap: 64px; }
  .feature--b, .feature--c { margin: 0; }
  .feature--b { width: 82%; align-self: flex-end; }
  .feature--c .feature__media { margin-inline: calc(var(--gutter) * -1); }
  .feature--a .feature__media { margin-right: calc(var(--gutter) * -1); }

  /* method: spine becomes a pinned band at the top while steps scroll */
  .method__grid { display: flex; flex-direction: column; }
  .method__stage { margin-inline: calc(var(--gutter) * -1); }
  .method__sticky { position: relative; top: auto; height: 58vh; height: 58svh; min-height: 340px; max-height: 560px; }
  .method__content { padding-top: 8px; }
  .method__content .section-title { font-size: clamp(2rem, 8.4vw, 2.8rem); }
  .steps { margin-top: 40px; }
  .step { min-height: 0; padding-block: 24px 40px; }
  .step:last-child { min-height: 0; }

  .cta { min-height: 0; align-items: flex-end; }
  .cta__art { top: 0; right: 50%; width: 120vw; height: 120vw; max-width: 720px; max-height: 720px; transform: translate(50%, -30%); opacity: .95; }
  .cta__inner { padding-top: 72vw; padding-bottom: 88px; }
  .cta__actions .btn { flex: 1 1 100%; }

  .location__grid { display: flex; flex-direction: column; gap: 40px; }
  .location__map { margin-inline: calc(var(--gutter) * -1); min-height: 340px; }

  .contact__grid { display: flex; flex-direction: column; gap: 48px; }
  .form__body { grid-template-columns: 1fr; row-gap: 26px; }
  .form__submit .btn { width: 100%; }

  .footer__grid { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .footer ul a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer ul { gap: 0; }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .dock {
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: var(--z-dock);
    padding: 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 0 0 1px var(--line), 0 12px 32px -12px rgb(27 32 29 / .28);
    transform: translateY(140%);
    transition: transform .55s var(--ease-out);
  }
  .dock .btn { --h: 48px; padding: 0 1em; }
  .dock.is-on { transform: none; }
}

@media (max-width: 380px) {
  .hero__ctas { flex-direction: column; }
  .hero__ctas .btn { flex: none; width: 100%; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* Shared photo grade: keeps stock photography inside the sage / stone palette */
.hero__frame img, .intro__media img, .feature__media img {
  filter: saturate(.8) contrast(1.03);
}

/* ---------- addresses: same type, open directions in Google Maps ---------- */
address { font-style: normal; }
.addr { display: inline-block; color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: text-decoration-color .3s, color .3s; }
@media (hover: hover) { .addr:hover { text-decoration-color: currentColor; color: var(--fg); } }
.location__map:not(.is-loaded) .location__pin { pointer-events: auto; }

/* ---------- legal dialogs ---------- */
.legal {
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--fg-2);
  box-shadow: 0 30px 80px -30px rgb(27 32 29 / .45), 0 0 0 1px var(--line);
}
.legal[open] { display: flex; flex-direction: column; }
.legal::backdrop { background: rgb(18 22 19 / .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.legal__body { overflow-y: auto; padding: clamp(24px, 4vw, 44px); display: grid; gap: 14px; font-size: 15.5px; }
.legal h2 {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em; line-height: 1.05; color: var(--fg); margin-bottom: 8px;
}
.legal strong { color: var(--fg); font-weight: 500; }
.legal form { padding: 0 clamp(24px, 4vw, 44px) clamp(24px, 4vw, 36px); }
@media (prefers-reduced-motion: no-preference) {
  .legal[open] { animation: legal-in .45s var(--ease-out); }
  @keyframes legal-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* ---------- external-link notice ---------- */
.ext-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: min(460px, calc(100vw - 32px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: grid; gap: 10px; padding: 18px 20px;
  background: var(--btn-bg); color: var(--btn-fg);
  box-shadow: 0 24px 60px -24px rgb(27 32 29 / .5);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
  font-size: 15px; line-height: 1.45;
}
.ext-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ext-toast strong { font-weight: 500; }
.ext-toast__url { font-size: 13px; opacity: .8; word-break: break-all; user-select: all; -webkit-user-select: all; }
.ext-toast__row { display: flex; flex-wrap: wrap; gap: 8px; }
.ext-toast button {
  height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--btn-fg) 40%, transparent); background: transparent; color: var(--btn-fg);
}
.ext-toast button.is-main { background: var(--btn-fg); color: var(--btn-bg); border-color: var(--btn-fg); }
@media (max-width: 899px) { .ext-toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- FAQ assistant ---------- */
.assistant { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.menu-open .assistant { display: none; }
.assistant__launch {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-size: 15px; font-weight: 500;
  box-shadow: 0 16px 40px -18px rgb(27 32 29 / .55);
  transition: transform .45s var(--ease-out), background-color .3s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
}
.assistant__launch .ico { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) {
  .assistant__launch:hover { transform: translateY(-2px); background: var(--btn-fill); box-shadow: 0 20px 44px -18px rgb(27 32 29 / .6); }
}
.assistant__launch:active { transform: scale(.97); }
.assistant__launch[aria-expanded="true"] { background: var(--btn-fill); }

.assistant__panel {
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 140px));
  height: min(600px, calc(100dvh - 140px));
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  box-shadow: 0 30px 80px -30px rgb(27 32 29 / .5), 0 0 0 1px var(--line);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(12px) scale(.97);
  transition: opacity .3s var(--ease-out), transform .45s var(--ease-out);
}
.assistant__panel.is-open { opacity: 1; transform: none; }
.assistant__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.assistant__title { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; letter-spacing: -0.025em; line-height: 1.1; }
.assistant__sub { font-size: 13px; color: var(--fg-3); margin-top: 4px; }
.assistant__close { width: 40px; height: 40px; flex: none; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--fg); display: grid; place-items: center; cursor: pointer; }
.assistant__close .ico { width: 18px; height: 18px; }

.assistant__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 8px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 11px 14px; font-size: 15px; line-height: 1.5; border-radius: 16px; }
.msg--bot { align-self: flex-start; background: var(--bg-alt); color: var(--fg-2); border-bottom-left-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.msg--user { align-self: flex-end; background: var(--btn-bg); color: var(--btn-fg); border-bottom-right-radius: 4px; }
.msg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg__action {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .3s;
}
.msg__action .ico { width: 16px; height: 16px; }
@media (hover: hover) { .msg__action:hover { background: var(--btn-fill); } }
.msg--typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.msg--typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); opacity: .4; }

.assistant__chips { display: flex; gap: 8px; padding: 8px 20px 12px; overflow-x: auto; scrollbar-width: none; flex-wrap: wrap; max-height: 132px; overflow-y: auto; }
.assistant__chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--fg) 26%, transparent); background: transparent; color: var(--fg);
  font: inherit; font-size: 14px; transition: background-color .25s, color .25s, border-color .25s;
}
@media (hover: hover) { .chip:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); } }

.assistant__form { display: flex; gap: 8px; padding: 12px 20px 6px; border-top: 1px solid var(--line); }
.assistant__form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--fg) 26%, transparent); background: var(--bg); color: var(--fg);
  font: inherit; font-size: 16px; /* 16px stops iOS from zooming on focus */
}
.assistant__form input::placeholder { color: var(--fg-3); }
.assistant__form input:focus { outline: none; border-color: var(--fg); }
.assistant__form button { width: 44px; height: 44px; flex: none; border-radius: 999px; border: 0; background: var(--btn-bg); color: var(--btn-fg); display: grid; place-items: center; cursor: pointer; }
.assistant__form button .ico { width: 18px; height: 18px; }
.assistant__note { padding: 4px 20px 14px; font-size: 12px; color: var(--fg-3); line-height: 1.4; }

@media (prefers-reduced-motion: no-preference) {
  .msg { animation: msg-in .35s var(--ease-out); }
  @keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .msg--typing span { animation: dot 1s ease-in-out infinite; }
  .msg--typing span:nth-child(2) { animation-delay: .15s; }
  .msg--typing span:nth-child(3) { animation-delay: .3s; }
  @keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
}

@media (max-width: 899px) {
  .assistant { right: 12px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transition: bottom .55s var(--ease-out); }
  .dock-on .assistant { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .assistant__launch { width: 52px; padding: 0; justify-content: center; }
  .assistant__launch-label { display: none; }
  /* open: the panel becomes a bottom sheet above everything, launcher steps aside */
  .assistant.is-open { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .assistant.is-open .assistant__launch { display: none; }
  .assistant__panel { width: 100%; height: min(640px, calc(100vh - 96px)); height: min(640px, calc(100dvh - 96px)); transform-origin: bottom center; }
}

/* ---------- opening hours ---------- */
.hours { display: grid; gap: 10px; width: 100%; max-width: 340px; padding-top: 18px; border-top: 1px solid var(--line); }
.hours > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.hours dt { color: var(--fg-2); }
.hours dd { color: var(--fg); font-variant-numeric: tabular-nums; }
.footer__hours { margin-top: 8px; font-size: 14px; color: var(--fg-3); }

/* CMS: optional offer published from the owner panel. */
.cms-price { display:block; margin-top:10px; color:var(--accent); font-size:.9em; font-weight:600; }
.cms-offer { padding:clamp(40px,7vw,96px) 0; background:var(--sage-deep); color:var(--on-deep); }
.cms-offer h2 { margin:8px 0; font-family:var(--font-display); font-size:clamp(32px,5vw,64px); font-weight:300; }
.cms-offer p:last-child { max-width:680px; }
