/* ===========================================================
   LAYAN — section VI «Контакты» (reference: twks.ch footer)
   Warm black field, one viewport on ≥1024px (client: "all in one frame"):
   · a short call-back form (heading, name, phone, send), centred on the
     page's centre line in the space above the panther (js/contact.js);
   · phone / email / address bottom-right, set like the side nav and
     mirroring it (same type, same baseline);
   · the ASCII panther along the bottom (js/contact-beast.js).
   ≥1024px: .contact__in rises 20% slower than the page (curtain reveal),
   so the section clips its own overflow.
   =========================================================== */
.contact{
  --beast-w:min(38.7vw,800px);
  --beast-b:clamp(20px,5svh,64px);
  position:relative;background:var(--black);color:var(--cotton-fluff);
  overflow:clip;
}
/* cursor fog (js/contact-fog.js): transparent canvas behind everything,
   never takes the pointer */
.contact__fog{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;display:block}
.contact__in{
  position:relative;z-index:1;min-height:100lvh;
  display:flex;flex-direction:column;
  /* bottom: room for the panther (box height ≈ .566 w; its back reaches
     ~.42 w above the floor line) */
  padding:clamp(64px,10svh,120px) var(--pad-x) calc(var(--beast-b) + var(--beast-w) * .42 + clamp(24px,4svh,56px)) var(--content-l);
  will-change:transform;
}
.contact__body{position:relative;z-index:1;flex:1;display:flex;flex-direction:column;justify-content:center}
.contact__copy{
  position:absolute;left:var(--content-l);bottom:clamp(16px,2.5svh,28px);z-index:1;
  font-family:var(--font-text);font-size:var(--fs-small);line-height:1.2;
  color:var(--cream-a60);
}

/* the body bleeds out of the content column so the form sits on the page's
   centre line, like the panther under it */
.contact__body{align-items:center}
/* ≥1024px the form is centred on the page (like the panther), not on the
   content column: everything else in .contact__in is absolute there, so
   the side padding just goes. (A negative-margin bleed of --content-l came
   out ~40px off-centre: it's a % and resolves against a different box.) */
@media (min-width:1024px){
  /* exactly one screen, so the page ends flush on the section's top edge
     (with min-height, wide-but-short windows grew it a few px taller and
     the page scrolled past the headline) */
  .contact__in{padding-left:0;padding-right:0;height:100lvh}
  .contact__body{min-height:0}
  .contact__body{margin-left:0;margin-right:0}
}

/* ---------- form (reference: grail-app.com footer, 2026-10-28) ----------
   A centred heading, then two huge Faberge fields (Ваше имя / Телефон), light
   (thinned) type, a 40 % placeholder and a faint hairline running to 32px
   from the page edges (as grail) that lights up on hover / focus. No send
   button: once the other field is done, a burgundy brush stroke is painted
   on beside the text being typed — «Дополните…» while the phone is short,
   «Отправить» when everything is valid (js/contact.js). */
.cform{width:100%;margin:0;padding:0;display:flex;flex-direction:column;align-items:center}
@media (min-width:1024px){
  .cform{width:calc(100% - 64px)}
}
/* heading: two lines in the side nav title's set (Arimo 700, the *x* word
   in Faberge italic), Cotton Fluff, centred above the fields; 4px under
   the earlier 3-line size (client) */
.cform__ttl{
  margin:0 0 clamp(16px,4svh,48px);color:var(--cotton-fluff);text-align:center;white-space:nowrap;
  font-family:var(--font-text);font-weight:700;font-size:clamp(20px,calc(2.3vw - 4px),36px);line-height:.95;letter-spacing:-.02em;
  opacity:0;transform:translateY(.4em);
  transition:opacity .9s ease .2s, transform 1.1s cubic-bezier(.22,1,.36,1) .2s;
}
.cform__ttl .ln{display:block}
.cform__ttl .it{font-family:var(--font-display);font-style:italic;font-weight:400;font-size:1.06em}
.cform.is-live .cform__ttl{opacity:1;transform:none}

.cfield{
  --fs:clamp(40px,min(6.4vw,9.5svh),92px);
  --gap:clamp(9px,.9vw,15px);                       /* text → line */
  position:relative;width:100%;margin-top:clamp(40px,8svh,128px);
}
.cfield input,
.cfield__ph,
.cfield__measure{
  font-family:var(--font-display);font-weight:400;font-size:var(--fs);line-height:.88;
  letter-spacing:-.01em;text-transform:uppercase;
}
.cfield input{
  display:block;width:100%;padding:0 0 var(--gap);text-align:center;
  color:var(--cotton-fluff);background:transparent;border:0;border-radius:0;outline:0;
  caret-color:var(--cotton-fluff);
  -webkit-text-stroke:.035em var(--black);paint-order:normal;   /* light, like the placeholder */
}
.cfield input:-webkit-autofill{-webkit-text-fill-color:var(--cotton-fluff);transition:background-color 9999s}
.cfield__ph{
  position:absolute;inset:0;padding-bottom:var(--gap);
  display:flex;align-items:center;justify-content:center;
  color:var(--cotton-fluff);opacity:.4;pointer-events:none;white-space:pre;
  /* "very light": Faberge has one weight, so the glyph edges are eaten by
     a stroke in the section's own Black (thinner, not a faked weight) */
  -webkit-text-stroke:.035em var(--black);paint-order:normal;
  transition:opacity .25s ease;
}
.cfield.is-filled .cfield__ph,
.cfield:focus-within .cfield__ph{opacity:0}
.cfield__ph i{font-style:normal;display:inline-block;opacity:0;transform:translateY(.55em)}
.cfield__ph i.sp{width:.28em}   /* Faberge's nbsp is zero-width */
.cform.is-live .cfield__ph i{animation:cph-rise .5s cubic-bezier(.22,1,.36,1) forwards;animation-delay:var(--d,0s)}
@keyframes cph-rise{to{opacity:1;transform:none}}
.cfield + .cfield{margin-top:clamp(40px,8svh,120px)}
.cfield__measure{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none;white-space:pre}

/* the hairline: low opacity, full on hover / focus */
.cfield__line{
  position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--cotton-fluff);
  opacity:.1;pointer-events:none;transform:scaleX(0);transform-origin:50% 50%;
  transition:transform 1.1s cubic-bezier(.22,1,.36,1) .5s, opacity .25s ease;
}
.cform.is-live .cfield__line{transform:scaleX(1)}
.cfield:hover .cfield__line,
.cfield:focus-within .cfield__line{opacity:1}
.cfield.is-invalid .cfield__line{opacity:1}

/* the button: a burgundy brush stroke with a cream sticker edge and
   cream Faberge on it (client sketch, 2026-10-28). It sits beside the end
   of the text, vertically centred on it (js sets left / top). Painting on:
   the strokes in .cflag__brush draw one after another, back and forth like
   a brush (stroke-dashoffset, --i = order), then the word fades in; off
   runs the strokes back, fast, in reverse order. Rough bristle edges and
   the sticker rim come from the #cflag-paint filter (js/contact.js). */
.cflag{
  --n:8;
  position:absolute;left:0;top:calc(.44 * var(--fs));z-index:2;margin:0;
  padding:.7em 1.25em .75em;white-space:nowrap;
  background:none;border:0;border-radius:0;color:var(--cotton-fluff);
  font:400 clamp(15px,1.25vw,22px)/1 var(--font-display);letter-spacing:-.01em;
  transform:translateY(-50%) rotate(-12deg);pointer-events:none;cursor:default;
  transition:left .35s cubic-bezier(.22,1,.36,1), top .35s cubic-bezier(.22,1,.36,1);
}
.cflag[hidden]{display:none}
.cflag__brush{position:absolute;left:-4%;top:-10%;width:108%;height:120%;overflow:visible;pointer-events:none}
.cflag__brush path{
  fill:none;stroke-linecap:round;stroke-dasharray:1 1.2;stroke-dashoffset:1.1;
  transition:stroke-dashoffset .14s cubic-bezier(.4,0,.6,1) calc((var(--n) - var(--i)) * 22ms);
}
.cflag.is-on .cflag__brush path{
  stroke-dashoffset:0;
  transition:stroke-dashoffset .2s cubic-bezier(.45,.05,.35,1) calc(var(--i) * 75ms);
}
.cflag__txt{position:relative;display:inline-flex;align-items:center;opacity:0;transform:translateY(.15em);
            transition:opacity .15s ease, transform .15s ease}
.cflag.is-on .cflag__txt{opacity:1;transform:none;transition:opacity .35s ease .55s, transform .5s cubic-bezier(.22,1,.36,1) .55s}
.cflag__dots{display:inline-flex;gap:3px;margin-left:.4em}
.cflag__dots i{width:4px;height:4px;border-radius:50%;background:currentColor;animation:cflag-dot 1.2s ease-in-out infinite}
.cflag__dots i:nth-child(2){animation-delay:.18s}
.cflag__dots i:nth-child(3){animation-delay:.36s}
@keyframes cflag-dot{0%,60%,100%{opacity:.25;transform:none}30%{opacity:1;transform:translateY(-3px)}}
.cflag.is-go{pointer-events:auto;cursor:pointer}
.cflag.is-go:hover .cflag__brush{filter:brightness(1.18)}
.cflag.is-go:focus-visible{outline:1px solid var(--cotton-fluff);outline-offset:10px}
.cflag-defs{position:absolute;width:0;height:0;overflow:hidden}

.cform__status{
  min-height:1.4em;margin-top:clamp(14px,2.4svh,26px);
  font-family:var(--font-text);font-size:var(--fs-small);color:var(--cream-a90);text-align:center;
}
.cform__status a{color:var(--cotton-fluff);white-space:nowrap}
/* sending: fields and the brush stroke locked so a lead can't go twice */
.cform.is-sending input,.cform.is-sending .cflag{pointer-events:none}
.cform.is-sending .cflag{opacity:.5}
/* honeypot for bots — off-screen, never focused or read out */
.cform__hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

/* ---------- clinic details: the side nav's type, mirrored ----------
   Same face/size/leading/dimming as .shell__nav names (css/shell.css),
   right-aligned. ≥1024px its last line shares the nav's last line
   (shell bottom 20px + footer 18px + 3 × 11px × 1.35). */
.cinfo{
  position:relative;z-index:1;font-style:normal;
  display:flex;flex-direction:column;align-items:flex-start;
  color:var(--cotton-fluff);
}
.cinfo a{
  color:inherit;text-decoration:none;white-space:nowrap;
  font-family:var(--font-text);font-weight:700;font-size:clamp(13px,1.05vw,16px);line-height:1.08;letter-spacing:-.01em;
}
.cinfo .nm{opacity:.55;transition:opacity .3s ease}
.cinfo a:hover .nm,.cinfo a:focus-visible .nm{opacity:1}
.cinfo a:focus-visible{outline:1px solid currentColor;outline-offset:3px}

@media (min-width:1024px){
  .cinfo{position:absolute;right:var(--pad-x);bottom:calc(20px + 18px + 3 * 11px * 1.35);align-items:flex-end}
}

/* ---------- the panther ----------
   Centred on the full width like the reference, paws on the floor line;
   height is set in js from the clip's aspect. */
.contact__beast{
  position:absolute;left:50%;bottom:var(--beast-b);
  width:var(--beast-w);aspect-ratio:640/362;
  /* --shift (js) moves the body's centre of mass to the middle: the thin
     tail makes the clip look right-heavy when the box itself is centred.
     translateY 15%: the clip has ~15% empty floor under the paws (they touch
     down at row ~154/181), so this puts the paws on the box's bottom edge */
  transform:translate(calc(-50% + var(--shift, 0px)), 15%);
  pointer-events:none;
}
.contact__beast canvas{display:block;width:100%;height:100%}
.contact__beast video{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}

/* ≥1024px the shell footer already carries © bottom-left */
@media (min-width:1024px){
  .contact__copy{visibility:hidden}
}
@media (max-width:1023px){
  .contact{--beast-w:63vw}
  .cform{margin:0 auto}
  .cinfo{margin-top:clamp(40px,7svh,72px);align-self:flex-start;gap:4px}
  .cinfo a{font-size:16px}
}
@media (max-width:760px){
  .contact__in{padding-left:var(--gutter);padding-right:var(--gutter)}
  /* client 2026-11-04: the heading a little bigger, the details smaller
     (the address may wrap instead of running off the screen) */
  .cform__ttl{font-size:clamp(20px,6.6vw,28px)}
  /* client 2026-11-05: phone + email on the left, the address on the
     right in two lines (right-aligned), bottoms level */
  .cinfo{
    align-self:stretch;display:grid;grid-template-columns:auto auto;
    justify-content:space-between;align-items:end;column-gap:16px;row-gap:3px;
  }
  .cinfo a{font-size:12px;line-height:1.25;white-space:normal;grid-column:1}
  /* the address's two lines spread to the full height of phone + email,
     so its first and last lines sit level with theirs (client 2026-11-06) */
  .cinfo .cinfo__addr{grid-column:2;grid-row:1 / span 2;text-align:right;align-self:stretch;display:flex}
  .cinfo__addr .nm{flex:1;display:flex;flex-direction:column;justify-content:space-between}
  .cinfo .ln{display:block}
  .contact__copy{left:var(--gutter)}
}
@media (prefers-reduced-motion: reduce){
  .contact__in{will-change:auto}
  .cfield__line,.cfield__ph,.cform__ttl,.cflag,.cflag__brush path,.cflag__txt,.cinfo .nm{transition:none !important}
  .cflag__dots i{animation:none}
  .cfield__line{transform:none}
  .cfield__ph i{animation:none;opacity:1;transform:none}
}
