/*
Theme Name: Dr. Isaev — Ivory
Theme URI: https://dr-isaev.example
Author: Dr. Isaev Clinic
Description: Минимальная одностраничная тема для лендинга роботизированного эндопротезирования суставов. Холодная монохромная система "Ivory" (см. DESIGN.md исходного проекта).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dr-isaev
*/

  :root{
    --ink:#212121;        /* Rich Black */
    --bg:#EAEFF5;          /* Ice Blue */
    --white:#FFFFFF;       /* Pure White */
    --grey:#7B8493;        /* de-emphasis grey — darkened for 3:1+ contrast on --bg */
    --grey-2:#5C636E;      /* muted body text */
    --line:rgba(33,33,33,0.14);
    --ink-hover:#000;     /* primary-button hover darken, reused across cta/ct-msg/ct-form */
    --ease:cubic-bezier(.22,.61,.36,1);
  }
  *{margin:0;padding:0;box-sizing:border-box;}
  html{scroll-behavior:smooth;overflow-anchor:none;}
  /* systemic widow/orphan guard — balance short headings, soften long prose,
     instead of patching text-wrap onto each heading rule individually */
  h1,h2,h3{text-wrap:balance;}
  p{text-wrap:pretty;}
  body{
    font-family:'Inter',system-ui,sans-serif;
    color:var(--ink);
    -webkit-font-smoothing:antialiased;overflow-x:clip;
    letter-spacing:-0.01em;
    background:linear-gradient(120deg,#EAEFF5,#E3E9F2,#EFF2F9,#E6EBF4);
    background-size:300% 300%;
    animation:bg-flow 22s ease-in-out infinite;
  }
  @keyframes bg-flow{
    0%,100%{background-position:0% 50%;}
    50%{background-position:100% 50%;}
  }
  @media (prefers-reduced-motion:reduce){
    body{animation:none;background-position:0% 50%;}
  }
  a:focus-visible, button:focus-visible, summary:focus-visible,
  input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
    outline:2px solid var(--ink);
    outline-offset:3px;
    border-radius:4px;
  }
  /* `div.page`, а не `.page`: WordPress через body_class() добавляет класс
     `page` на любой странице-Page, и голый `.page` цеплял <body> тоже —
     тот получал max-width и паддинги обёртки, давая двойной отступ.
     Тег в селекторе исключает body, не меняя ничего для самой обёртки. */
  div.page{max-width:1320px;margin:0 auto;padding:34px 28px 60px;}


.case-photo{
    overflow:hidden;
}
.case-photo img {
   width: 100%;
  max-width: 400px;
  height: auto;
}

.case-modal-photo img{
       width: 100%;
  max-width: max-content;
  height: auto;
}
  /* ---- section shell: big rounded outlined frame ---- */
  .frame{
    position:relative;
    border-radius:30px;
    background:transparent;
    padding:26px 0 48px;
    overflow:hidden;
  }
  /* Real 8-column grid, proportions taken from the reference's px ruler:
     60 / 205 / 250 / 280 / 450 / 650 / 280 / 60 (of a 2235px reference canvas).
     Cols 1 and 8 are the outer gutters; content lives in cols 2-7. */
  .cols{
    display:grid;
    grid-template-columns: 2.68fr 9.17fr 11.19fr 12.53fr 20.13fr 29.08fr 12.53fr 2.68fr;
  }
  .frame > *{position:relative;z-index:1;}
  /* place content in cols 2-7 (skip the col-1 / col-8 outer gutters) */
  .col-content{
    grid-column:2 / 8;padding:0 2px 22px;
    /* grid items default to min-width:auto = their content's min-content
       size. The cases carousel's non-shrinking cards give it a huge
       min-content width that otherwise wins out over the explicit 1fr/etc
       track size, making this item render wider than its own grid track
       instead of clipping/scrolling its oversized child internally. */
    min-width:0;
  }
  .col-full{grid-column:1 / 9;}

  /* section wrapper holds the overlapping tag outside the clipped frame */
  .sec{
    position:relative;
  }
  .sec + .sec{margin-top:26px;}
  /* varied rhythm instead of one uniform gap everywhere — bigger pauses at
     chapter turns (human element, social proof, closing CTA), tighter where
     sections continue the same thought */
  .sec#doctor, .sec#reviews{margin-top:64px;}
  .sec#contact{margin-top:56px;}
  .sec#stay{margin-top:18px;}
  @media(max-width:880px){
    .sec#doctor, .sec#reviews, .sec#contact{margin-top:36px;}
  }
  .sec-tag{
      display: none;
    position:absolute;top:8px;right:6px;z-index:3;text-align:right;
    font-size:0.9375rem;line-height:1.2;color:var(--grey-2);
  }
  .sec-tag b{display:block;color:var(--ink);font-weight:600;}

  /* top px ruler (grid annotation) */
  .ruler{
    display:none;
    }

  /* ---- nav ---- */
  .nav{
    display:flex;align-items:center;justify-content:space-between;gap:24px;
    padding:6px 4px 0;
  }
  .brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);}
  .brand .mark{
    width:34px;height:34px;border-radius:9px;border:1px solid var(--line);
    display:flex;align-items:center;justify-content:center;
  }
  .brand .mark span{width:11px;height:11px;border-radius:50%;background:var(--ink);}
  .brand b{font-size:0.8125rem;font-weight:700;letter-spacing:0.14em;line-height:1.1;}
  .brand b small{display:block;font-size:0.5938rem;font-weight:500;color:var(--grey-2);letter-spacing:0.22em;}
  .nav-links{display:flex;gap:6px;}
  .nav-links a{
    text-decoration:none;color:var(--grey-2);font-size:0.875rem;font-weight:500;
    padding:9px 16px;border-radius:100px;transition:background .2s var(--ease),color .2s var(--ease);
  }
  .nav-links a:hover{color:var(--ink);}
  .nav-links a.active{background:var(--white);color:var(--ink);box-shadow:0 2px 10px rgba(33,33,33,0.05);}
  .nav-right{display:flex;align-items:center;gap:12px;}
  .nav-loc{display:flex;align-items:center;gap:7px;font-size:0.8125rem;color:var(--grey-2);font-weight:500;}
  .nav-loc svg{width:14px;height:14px;}
  .nav-menu{
    display:none;
    background:var(--white);border:1px solid var(--line);
    font-size:0.875rem;font-weight:600;color:var(--ink);cursor:pointer;
    padding:11px 22px;border-radius:100px;
    transition:background .2s var(--ease),transform .15s var(--ease);
  }
  .nav-menu:hover{background:var(--ink);color:var(--white);}
  .nav-menu:active{transform:scale(.94);transition-duration:.1s;}
  .nav-right{position:relative;}
  /* always rendered; open/closed is opacity+transform+pointer-events so the
     entrance can transition instead of snapping via display:none */
  .mobile-drop{
    position:absolute;top:calc(100% + 10px);right:0;z-index:60;
    background:var(--white);border:1px solid var(--line);border-radius:16px;
    padding:8px;min-width:200px;
    box-shadow:0 16px 40px rgba(33,33,33,0.12);
    display:flex;flex-direction:column;gap:2px;
    opacity:0;transform:translateY(-6px) scale(.97);pointer-events:none;
    transform-origin:top right;
    transition:opacity .2s var(--ease),transform .2s var(--ease);
  }
  .mobile-drop.open{opacity:1;transform:translateY(0) scale(1);pointer-events:auto;}
  .mobile-drop a{
    text-decoration:none;color:var(--ink);font-size:0.9062rem;font-weight:500;
    padding:11px 14px;border-radius:10px;transition:background .15s var(--ease);
  }
  .mobile-drop a:hover{background:var(--bg);}
  @media (prefers-reduced-motion:reduce){.mobile-drop{transition:none;}}

  /* ---- scattered two-tone headline ---- */
  .hero-type{
    position:relative;
    min-height:46vh;padding:64px 0 30px;
    display:flex;flex-direction:column;
  }
  .htxt{
    font-size:clamp(1.75rem,5.4vw,3.75rem);line-height:1.1;font-weight:300;
    letter-spacing:-0.03em;color:var(--grey);
    text-wrap:balance;overflow-wrap:break-word;
  }
  .htxt b{font-weight:700;color:var(--ink);}
  /* Headline blocks sit on the SAME 6 column tracks as cols 2-7 of the
     outer ruler grid (9.17/11.19/12.53/20.13/29.08/12.53 fr) — identical
     proportions distributed over the identical total width, so the
     boundaries land on the exact same pixel lines, not an approximation. */
  .htxt-grid{
    display:grid;
    grid-template-columns: 9.17fr 11.19fr 12.53fr 20.13fr 29.08fr 12.53fr;
  }
  .block-a{grid-column:1 / 5;}
  .block-b{grid-column:5 / 7;align-self:end;text-align:left;margin-top:38px;font-size:1.9rem;}

  .hero-foot{
    display:flex;align-items:flex-end;justify-content:space-between;gap:30px;
    margin-top:auto;padding-top:44px;
  }
  .hero-sub{font-size:0.9375rem;line-height:1.6;color:var(--grey-2);max-width:330px;}
  .cta{
    display:inline-flex;align-items:center;gap:11px;
    background:var(--ink);color:var(--white);text-decoration:none;
    font-size:0.9375rem;font-weight:600;padding:16px 28px;border-radius:100px;
    transition:transform .2s var(--ease),background .2s var(--ease);white-space:nowrap;
  }
  .cta:hover{background:var(--ink-hover);transform:translateY(-2px);}
  .cta:active{transform:translateY(-2px) scale(.96);transition-duration:.1s;}
  .cta svg{width:18px;height:18px;}

  /* ---- second section: robot + big numbers ---- */
  .band{margin-top:22px;}
  /* robot card | copy split on ruler line 4 (content tracks 1-3 | 4-6).
     gap:0 keeps the track edge exactly on the drawn guide line; the gutter
     lives inside via the copy's padding-left. */
  .band-grid{
    display:grid;grid-template-columns:32.89fr 61.74fr;align-items:center;
  }
  .band-copy{padding-left:34px;}
  .robot-card{
    background:var(--white);border:1px solid var(--line);border-radius:24px;
    aspect-ratio:5/4;display:flex;align-items:flex-end;justify-content:center;
    overflow:hidden;position:relative;
  }
  .robot-card img{height:96%;width:auto;object-fit:contain;object-position:bottom center;
    filter:grayscale(1) contrast(1.02);}
  .band-copy h2{
    font-size:clamp(1.625rem,3.4vw,2.75rem);font-weight:300;line-height:1.08;
    letter-spacing:-0.02em;color:var(--grey);margin-bottom:22px;
  }
  .band-copy h2 b{font-weight:700;color:var(--ink);}
  .band-nums{display:flex;gap:34px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:24px;}
  .band-nums .n{font-size:clamp(2.875rem,6vw,5.25rem);font-weight:300;letter-spacing:-0.04em;line-height:.88;color:var(--ink);font-variant-numeric:tabular-nums;}
  .band-nums .n span{display:block;font-size:0.8125rem;font-weight:500;color:var(--grey-2);margin-top:10px;letter-spacing:0;max-width:130px;}

  /* shared section heading (two-tone) */
  .sec-h{
    font-size:clamp(1.75rem,4.6vw,3.625rem);font-weight:300;line-height:1.04;
    letter-spacing:-0.025em;color:var(--grey);margin-bottom:38px;max-width:86.76%;
    text-wrap:balance;
  }
  .sec-h b{font-weight:800;color:var(--ink);}

  /* ---- 03 operations ---- */
  /* two-up cards split on ruler line 5 (tracks 1-4 | 5-6); 18px gutter
     straddles the line via 9px margins each side, so card edges stay on-grid */
  .ops-grid{display:grid;grid-template-columns:53.02fr 41.61fr;}
  .ops-grid > :first-child{margin-right:9px;}
  .ops-grid > :last-child{margin-left:9px;}
  .op-card{
    background:var(--white);border:1px solid var(--line);border-radius:22px;
    padding:34px 32px;display:flex;flex-direction:column;
    transition:transform .25s var(--ease),box-shadow .25s var(--ease);
  }
  .op-card:hover{transform:translateY(-3px);box-shadow:0 16px 40px rgba(33,33,33,0.08);}
  .op-tag{display:inline-block;font-size:0.75rem;font-weight:600;letter-spacing:0.04em;color:var(--grey-2);
    border:1px solid var(--line);border-radius:100px;padding:5px 13px;align-self:flex-start;margin-bottom:22px;}
  .op-card h3{font-size:1.4375rem;font-weight:600;letter-spacing:-0.01em;margin-bottom:12px;}
  .op-card p{font-size:0.9062rem;line-height:1.6;color:var(--grey-2);margin-bottom:26px;}
  .op-link{margin-top:auto;display:inline-flex;align-items:center;gap:9px;
    font-size:0.875rem;font-weight:600;color:var(--ink);text-decoration:none;}
  .op-link svg{width:17px;height:17px;transition:transform .2s var(--ease);}
  .op-card:hover .op-link svg{transform:translateX(4px);}

  /* ---- 04 method steps ---- */
  .steps{display:flex;flex-direction:column;}
  /* step number | body split on ruler line 2 (track 1 | tracks 2-6); gutter inside body */
  .step{
    display:grid;grid-template-columns:9.17fr 85.46fr;align-items:start;
    padding:30px 0;border-top:1px solid var(--line);
    transition:background .25s var(--ease);
  }
  .step:hover{background:var(--bg);}
  .step > :last-child{padding-left:30px;}
  .step:first-child{border-top:none;}
  .step-n{font-size:clamp(3.25rem,7vw,6.5rem);font-weight:300;line-height:.82;letter-spacing:-0.04em;color:var(--ink);font-variant-numeric:tabular-nums;}
  .step h3{font-size:1.25rem;font-weight:600;margin-bottom:9px;letter-spacing:-0.01em;}
  .step p{font-size:0.9062rem;line-height:1.65;color:var(--grey-2);max-width:560px;}

  /* ---- 05 reviews ---- */
  .rev-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
  .rev{background:var(--white);border:1px solid var(--line);border-radius:20px;
    padding:26px 24px;display:flex;flex-direction:column;}
  .rev-stars{letter-spacing:2px;font-size:0.8125rem;color:var(--ink);margin-bottom:14px;}
  .rev-text{font-size:0.875rem;line-height:1.6;color:var(--ink);margin-bottom:20px;}
  .rev-meta{border-top:1px solid var(--line);padding-top:14px;margin-top:auto;}
  .rev-author{font-size:0.8125rem;color:var(--ink);font-weight:500;margin-bottom:8px;display:block;}
  .rev-foot{display:flex;align-items:center;gap:11px;flex-wrap:wrap;}
  .rev-src{display:inline-flex;align-items:center;gap:6px;font-size:0.7188rem;font-weight:600;
    color:var(--ink);background:var(--bg);border:1px solid var(--line);padding:4px 10px;border-radius:100px;text-decoration:none;}
  .rev-src svg{width:11px;height:11px;}
  .rev-date{font-size:0.7188rem;color:var(--grey-2);}
  .rev-text.full{display:none;}
  .rev.expanded .rev-text.full{display:block;}
  .rev.expanded .rev-text.short{display:none;}
  .rev-toggle{
    background:none;border:none;cursor:pointer;padding:8px 0;margin:-8px 0 8px;
    font-size:0.8125rem;font-weight:600;color:var(--ink);text-decoration:underline;
  }
  .rev-toggle:hover{color:var(--grey-2);}
  .rev-links{
    display:flex;gap:24px;flex-wrap:wrap;justify-content:center;
    margin-top:34px;padding-top:28px;border-top:1px solid var(--line);
  }
  .rev-links a{
    display:inline-flex;align-items:center;gap:8px;
    font-size:0.875rem;font-weight:600;color:var(--ink);text-decoration:none;
  }
  .rev-links a svg{width:16px;height:16px;transition:transform .2s var(--ease);}
  .rev-links a:hover svg{transform:translateX(3px);}
  .rev-note{text-align:center;margin-top:16px;font-size:0.7812rem;color:var(--grey-2);}

  /* ---- 06 contacts ---- */
  /* info | form split on ruler line 5 (tracks 1-4 | 5-6); gutter inside info */
  .contacts{display:grid;grid-template-columns:53.02fr 41.61fr;}
  .contacts > :first-child{padding-right:40px;}
  .ct-list{display:flex;flex-direction:column;gap:2px;}
  .ct-row{display:flex;flex-direction:column;gap:3px;padding:18px 0;border-top:1px solid var(--line);}
  .ct-row:first-child{border-top:none;}
  .ct-row .lbl{font-size:0.75rem;color:var(--grey-2);font-weight:500;}
  .ct-row a,.ct-row span.val{font-size:1.1875rem;font-weight:600;color:var(--ink);text-decoration:none;letter-spacing:-0.01em;}
  .ct-msgs{display:flex;gap:10px;margin-top:18px;}
  .ct-msg{display:inline-flex;align-items:center;gap:8px;background:var(--ink);color:var(--white);
    text-decoration:none;font-size:0.8125rem;font-weight:600;padding:11px 18px;border-radius:100px;transition:background .2s var(--ease),transform .15s var(--ease);}
  .ct-msg:hover{background:var(--ink-hover);}
  .ct-msg:active{transform:scale(.94);transition-duration:.1s;}
  .ct-msg svg{width:15px;height:15px;}
  .ct-form{background:var(--white);border:1px solid var(--line);border-radius:24px;padding:34px 32px;}
  .ct-form .fld{margin-bottom:14px;}
  .ct-form label{display:block;font-size:0.7812rem;color:var(--grey-2);font-weight:500;margin-bottom:7px;}
  .ct-form input,.ct-form textarea{
    width:100%;font-family:inherit;font-size:0.9375rem;color:var(--ink);
    background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:13px 15px;transition:border-color .2s var(--ease);}
  .ct-form input:focus,.ct-form textarea:focus{outline:none;border-color:var(--ink);}
  /* «Ваш вопрос»: тянется только по вертикали (горизонтальный ресайз ломал бы
     сетку формы), display:block убирает inline-baseline зазор под полем */
  .ct-form textarea{resize:vertical;min-height:104px;line-height:1.5;display:block;}
  .ct-form button{width:100%;margin-top:8px;background:var(--ink);color:var(--white);border:none;cursor:pointer;
    font-family:inherit;font-size:0.9375rem;font-weight:600;padding:16px;border-radius:100px;
    transition:background .2s var(--ease),transform .15s var(--ease),opacity .2s var(--ease);}
  .ct-form button:hover{background:var(--ink-hover);}
  .ct-form button:active{transform:scale(.97);transition-duration:.1s;}
  .ct-form button[data-state="sending"]{opacity:.6;cursor:default;}
  .ct-form button[data-state="sent"]{background:var(--grey-2);cursor:default;}
  @media (prefers-reduced-motion:reduce){.ct-form button{transition:background .2s var(--ease),opacity .2s var(--ease);}}
  /* status text for the AJAX submit result — distinguished by copy, not
     color, so it stays inside the Zero-Accent Rule (success and error
     read the same neutral grey; the message itself carries the meaning) */
  .ct-form-msg{font-size:0.8125rem;line-height:1.5;color:var(--grey-2);margin-top:10px;min-height:1.5em;}

  .wordmark{
    font-size:clamp(7.5rem,21vw,18.75rem);font-weight:800;letter-spacing:-0.05em;line-height:.8;
    color:var(--ink);text-align:center;margin:30px 0 -8px;
  }
  .foot-bottom{display:flex;justify-content:space-between;flex-wrap:wrap;gap:14px;
    font-size:0.8125rem;color:var(--grey-2);padding:24px 4px 0;border-top:1px solid var(--line);margin-top:24px;}

  /* ---- footer: brand + nav columns + social ---- */
  .foot-top{
    display:flex;justify-content:space-between;align-items:flex-start;
    flex-wrap:wrap;gap:40px;margin-top:56px;padding:36px 0 36px;
    border-top:1px solid var(--line);
  }
  .foot-brand{max-width:300px;}
  .foot-brand .logo-word{font-size:1.3125rem;font-weight:700;letter-spacing:-0.01em;color:var(--ink);text-decoration:none;}
  .foot-brand p{font-size:0.875rem;line-height:1.6;color:var(--grey-2);margin-top:14px;}
  .foot-cols{display:flex;gap:56px;flex-wrap:wrap;}
  .foot-col h4{font-size:0.7812rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--grey-2);margin-bottom:16px;}
  .foot-col{display:flex;flex-direction:column;gap:10px;}
  .foot-col a{font-size:0.9062rem;color:var(--ink);text-decoration:none;transition:color .2s var(--ease);}
  .foot-col a:hover{color:var(--grey-2);}
  .foot-social{display:flex;gap:10px;}
  .foot-social a{
    width:40px;height:40px;border-radius:50%;
    background:var(--white);border:1px solid var(--line);
    display:flex;align-items:center;justify-content:center;color:var(--ink);
    transition:background .2s var(--ease),color .2s var(--ease);
  }
  .foot-social a:hover{background:var(--ink);color:var(--white);}
  .foot-social svg{width:18px;height:18px;}

  /* ---- pillars: featured numeral (Точность) + two quieter stacked cards.
     Weight contrast instead of three identical cards; split on ruler line 5. */
  .pillars-hero{display:grid;grid-template-columns:53.02fr 41.61fr;gap:0;align-items:stretch;}
  .pillar-feature{
    background:var(--white);border:1px solid var(--line);border-radius:24px;
    padding:48px 44px;margin-right:9px;display:flex;flex-direction:column;
  }
  .pillar-num{
    font-size:clamp(4.5rem,11vw,10rem);font-weight:300;line-height:.82;
    letter-spacing:-0.04em;color:var(--ink);margin-bottom:18px;font-variant-numeric:tabular-nums;
  }
  .pillar-num .unit{font-size:0.32em;font-weight:600;letter-spacing:0;margin-left:6px;color:var(--grey-2);}
  .pillar-feature h3{font-size:clamp(1.25rem,2.2vw,1.625rem);font-weight:600;letter-spacing:-0.01em;margin-bottom:12px;max-width:420px;}
  .pillar-feature p{font-size:0.9062rem;line-height:1.6;color:var(--grey-2);max-width:380px;margin-top:auto;}
  .pillar-stack{display:flex;flex-direction:column;gap:14px;margin-left:9px;}
  .pillar-card{
    background:var(--white);border:1px solid var(--line);border-radius:22px;
    padding:26px 26px;flex:1;display:flex;flex-direction:column;justify-content:center;
    transition:transform .25s var(--ease),box-shadow .25s var(--ease);
  }
  .pillar-card:hover{transform:translateY(-3px);box-shadow:0 16px 40px rgba(33,33,33,0.08);}
  .pillar-icon{
    width:40px;height:40px;border-radius:11px;background:var(--bg);
    display:flex;align-items:center;justify-content:center;color:var(--ink);margin-bottom:14px;
  }
  .pillar-icon svg{width:19px;height:19px;}
  .pillar-card h3{font-size:1.125rem;font-weight:600;margin-bottom:6px;letter-spacing:-0.01em;}
  .pillar-card p{font-size:0.8438rem;line-height:1.5;color:var(--grey-2);}

  /* ---- about: image + checklist ---- */
  /* photo | text split on ruler line 4 (tracks 1-3 | 4-6); gutter inside text */
  .about-grid{display:grid;grid-template-columns:32.89fr 61.74fr;align-items:center;}
  .about-grid > :last-child{padding-left:36px;}
  .about-photo-card{
    background:var(--white);border:1px solid var(--line);border-radius:24px;overflow:hidden;
    aspect-ratio:4/5;
  }
  .about-photo-card img{width:100%;height:100%;object-fit:cover;filter:grayscale(1) contrast(1.02);}
  .check-list{display:flex;flex-direction:column;gap:16px;margin-top:26px;}
  .check-list li{display:flex;gap:13px;align-items:flex-start;font-size:0.9062rem;line-height:1.55;color:var(--ink);}
  .check-list svg{width:19px;height:19px;flex-shrink:0;margin-top:2px;color:var(--ink);}
  .check-list b{font-weight:600;}

  /* ---- implants: infinite marquee strip ---- */
  .implants-marquee{
    position:relative;width:100%;overflow:hidden;
    -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
            mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
  }
  .implants-marquee + .implants-marquee{margin-top:12px;}
  /* no `gap` here on purpose — gap adds one extra inter-set seam that isn't
     duplicated, so -50% lands half a gap short of the real seam between the
     two halves (visible jump). Each pill carries its own trailing margin
     instead, so every item (including the seam) is a uniform repeating unit
     and -50% always lands exactly on it. */
  .implants-track{
    display:flex;width:max-content;
    animation:implants-scroll 26s linear infinite;
  }
  /* dedicated reversed keyframe instead of animation-direction:reverse —
     reverse direction on a longhand override can paint the wrong frame on
     first load/reload in some engines until the next repaint */
  .implants-track--rev{animation-name:implants-scroll-rev;animation-duration:30s;}
  .implants-marquee:hover .implants-track{animation-play-state:paused;}
  @keyframes implants-scroll{from{transform:translateX(0);}to{transform:translateX(-50%);}}
  @keyframes implants-scroll-rev{from{transform:translateX(-50%);}to{transform:translateX(0);}}
  .implant-pill{
    background:var(--white);border:1px solid var(--line);border-radius:100px;
    padding:13px 24px;font-size:0.875rem;font-weight:600;color:var(--ink);
    white-space:nowrap;flex-shrink:0;margin-right:12px;
    transition:background .2s var(--ease),color .2s var(--ease);
  }
  .implant-pill:hover{background:var(--ink);color:var(--white);}
  @media (prefers-reduced-motion:reduce){
    .implants-track{animation:none;}
    .implants-marquee{overflow-x:auto;-webkit-mask-image:none;mask-image:none;}
  }

  /* ---- scroll-driven numeral reveal ----
     The big numerals (1мм, step numbers, doctor/robot stats) scrub into
     focus tied directly to scroll position via animation-timeline:view(),
     instead of the binary IntersectionObserver toggle used elsewhere.
     Gated behind @supports so the hidden starting keyframe only ever
     applies where the browser can also drive it from scroll position.
     Firefox (no support yet) never sees the @supports block at all, so
     the numerals simply stay at their normal, always-visible state —
     no JS fallback needed, no risk of content shipping blank. */
  @supports (animation-timeline: view()) {
    .pillar-num, .step-n, .band-nums .n, .doc-nums .n b{
      animation: numeral-scrub linear;
      animation-timeline: view();
      animation-range: entry 10% entry 65%;
    }
    @keyframes numeral-scrub{
      from{opacity:0;transform:translateY(28px) scale(.94);filter:blur(5px);}
      to{opacity:1;transform:translateY(0) scale(1);filter:blur(0);}
    }
    @media (prefers-reduced-motion:reduce){
      .pillar-num, .step-n, .band-nums .n, .doc-nums .n b{
        animation:none;opacity:1;transform:none;filter:none;
      }
    }
  }

  /* ---- doctor card ---- */
  .doc-card{
    background:var(--white);border:1px solid var(--line);border-radius:24px;
    padding:40px 40px 36px;
  }
  /* photo | content split on ruler line 4 (tracks 1-3 | 4-6); gutter inside content */
  .doc-card-grid{display:grid;grid-template-columns:32.89fr 61.74fr;align-items:start;}
  .doc-card-grid > :last-child{padding-left:36px;}
  .doc-photo-frame{
    border-radius:20px;overflow:hidden;aspect-ratio:3/4;
    background:var(--bg);border:1px solid var(--line);
  }
  .doc-photo{width:100%;height:100%;object-fit:cover;display:block;}
  .doc-photo-mono{
    width:100%;height:100%;
    display:flex;align-items:center;justify-content:center;
    font-size:3.5rem;font-weight:600;color:var(--grey-2);letter-spacing:0;
  }
  .doc-card-h{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;flex-wrap:wrap;}
  .doc-card h3{font-size:clamp(1.5rem,2.8vw,2rem);font-weight:600;letter-spacing:-0.01em;margin-bottom:6px;}
  .doc-card-h .role{font-size:0.8438rem;color:var(--grey-2);}
  .doc-pills2{display:flex;flex-wrap:wrap;gap:7px;}
  .doc-pills2 span{
    font-size:0.7188rem;font-weight:600;padding:5px 13px;border-radius:100px;
    background:var(--bg);color:var(--ink);
  }
  .doc-bio{font-size:0.9375rem;line-height:1.7;color:var(--grey-2);max-width:680px;margin:22px 0 28px;}
  .doc-nums{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--line);padding-top:24px;}
  .doc-nums .n{padding:0 18px;border-left:1px solid var(--line);}
  .doc-nums .n:first-child{border-left:none;padding-left:0;}
  .doc-nums .n b{display:block;font-size:clamp(2.125rem,4vw,3.25rem);font-weight:300;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;}
  .doc-nums .n span{display:block;font-size:0.75rem;color:var(--grey-2);margin-top:4px;line-height:1.3;}

  /* ---- doctor: expand toggle + detail panel ---- */
  .doc-expand-toggle{
    display:inline-flex;align-items:center;gap:8px;margin:18px 0 0;
    background:none;border:none;cursor:pointer;
    font-size:0.875rem;font-weight:600;color:var(--ink);padding:10px 0;
  }
  .doc-expand-toggle svg{width:16px;height:16px;transition:transform .3s var(--ease);}
  .doc-expand-toggle[aria-expanded="true"] svg{transform:rotate(180deg);}
  /* wrapper animates open/close via grid-template-rows (0fr -> 1fr); avoids
     animating height directly and keeps the inner grid's own layout intact */
  .doc-detail-wrap{
    display:grid;grid-template-rows:0fr;overflow:hidden;
    transition:grid-template-rows .4s var(--ease);
  }
  .doc-detail-wrap.open{grid-template-rows:1fr;}
  .doc-detail-wrap > .doc-detail-grid{min-height:0;}
  .doc-detail-grid{
    display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:24px;
  }
  @media (prefers-reduced-motion:reduce){.doc-detail-wrap{transition:none;}}
  .doc-detail-card{background:var(--bg);border:1px solid var(--line);border-radius:18px;padding:26px 26px;}
  .doc-detail-card h4{
    font-size:0.75rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
    color:var(--grey-2);margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid var(--line);
  }
  .doc-direction{display:flex;gap:13px;align-items:flex-start;margin-bottom:18px;}
  .doc-direction:last-child{margin-bottom:0;}
  .doc-direction .di{
    width:36px;height:36px;border-radius:10px;background:var(--white);border:1px solid var(--line);
    display:flex;align-items:center;justify-content:center;color:var(--ink);flex-shrink:0;
  }
  .doc-direction .di svg{width:18px;height:18px;}
  .doc-direction b{display:block;font-size:0.9062rem;font-weight:600;margin-bottom:3px;}
  .doc-direction p{font-size:0.8125rem;line-height:1.5;color:var(--grey-2);}
  .doc-tl-item{display:grid;grid-template-columns:84px 1fr;gap:14px;margin-bottom:15px;}
  .doc-tl-item:last-child{margin-bottom:0;}
  .doc-tl-item .yr{font-size:0.7812rem;font-weight:700;color:var(--ink);}
  .doc-tl-item .yr.intl{color:var(--grey-2);font-weight:600;}
  .doc-tl-item div p{font-size:0.8125rem;line-height:1.5;color:var(--grey-2);}
  .doc-tl-item div p b{color:var(--ink);font-weight:600;}
  .doc-awards{display:flex;flex-direction:column;gap:11px;margin-top:20px;}
  .doc-award{display:flex;gap:10px;align-items:flex-start;font-size:0.8125rem;line-height:1.45;color:var(--grey-2);}
  .doc-award svg{width:16px;height:16px;flex-shrink:0;margin-top:1px;color:var(--ink);}
  .doc-conf-card{background:var(--bg);border:1px solid var(--line);border-radius:18px;padding:26px 26px;margin-top:16px;}
  .doc-conf-card h4{font-size:0.9062rem;font-weight:600;margin-bottom:16px;}
  .doc-conf-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;}
  .doc-conf-list span{
    background:var(--white);border:1px solid var(--line);border-radius:100px;
    padding:6px 14px;font-size:0.7812rem;color:var(--ink);
  }
  .doc-conf-note{font-size:0.7812rem;line-height:1.55;color:var(--grey-2);border-top:1px solid var(--line);padding-top:14px;}

  /* ---- approaches: compare cards ---- */
  /* compare cards split on ruler line 5 (tracks 1-4 | 5-6) */
  .appr-grid{display:grid;grid-template-columns:53.02fr 41.61fr;}
  .appr-grid > :first-child{margin-right:9px;}
  .appr-grid > :last-child{margin-left:9px;}
  .appr-card{background:var(--white);border:1px solid var(--line);border-radius:22px;padding:32px 30px;}
  .appr-card .op-tag{margin-bottom:16px;}
  .appr-card h3{font-size:1.3125rem;font-weight:600;margin-bottom:18px;letter-spacing:-0.01em;}
  .appr-list{display:flex;flex-direction:column;gap:11px;margin-bottom:20px;}
  .appr-list li{display:flex;gap:10px;font-size:0.875rem;line-height:1.5;color:var(--grey-2);}
  .appr-list li svg{width:16px;height:16px;flex-shrink:0;margin-top:3px;color:var(--ink);}
  .appr-list li b{color:var(--ink);font-weight:600;}
  .appr-vs{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding-top:18px;font-size:0.7812rem;color:var(--grey-2);}
  .appr-vs b{color:var(--ink);}

  /* ---- indications: yes/no ---- */
  /* yes/no cards split on ruler line 5 (tracks 1-4 | 5-6); "yes" gets the wider side */
  .ind-grid2{display:grid;grid-template-columns:53.02fr 41.61fr;}
  .ind-grid2 > :first-child{margin-right:9px;}
  .ind-grid2 > :last-child{margin-left:9px;}
  .ind-card2{background:var(--white);border:1px solid var(--line);border-radius:22px;padding:32px 30px;}
  .ind-card2 h3{font-size:1.1875rem;font-weight:600;margin-bottom:18px;}
  .ind-card2 ul{display:flex;flex-direction:column;gap:13px;}
  .ind-card2 li{display:flex;gap:10px;font-size:0.875rem;line-height:1.5;color:var(--grey-2);}
  .ind-card2 li svg{width:16px;height:16px;flex-shrink:0;margin-top:3px;}
  .ind-card2.yes li svg{color:var(--ink);}
  .ind-card2.no li svg{color:var(--grey);}
  .ind-note2{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);font-size:0.8125rem;color:var(--grey-2);font-style:italic;}

  /* ---- stay gallery (bento) ---- */
  .stay-bento{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:160px;gap:12px;}
  .stay-cell{background:var(--white);border:1px solid var(--line);border-radius:18px;overflow:hidden;position:relative;}
  .stay-cell img{width:100%;height:100%;object-fit:cover;cursor:zoom-in;}
  .stay-cell--lg{grid-column:span 2;grid-row:span 2;}
  .stay-cell--wide{grid-column:span 2;}
  .stay-cell.stay-empty{display:flex;align-items:center;justify-content:center;}
  .stay-cell.stay-empty img{display:none;}
  .stay-cell.stay-empty::after{content:'Фото палаты';font-family:'Inter';font-size:0.6562rem;letter-spacing:.1em;text-transform:uppercase;color:var(--grey);}

  /* ---- patient cases: scrollable carousel + click-to-open modal ----
     Before/after slots are honest placeholders (same pattern as the
     stay-empty room photos) until real, consented, anonymised X-rays are
     dropped in — never fabricate "patient" imagery for medical content. */
  .cases-track{
    display:flex;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;
    padding-bottom:10px;margin:0 -2px;scrollbar-width:thin;
    cursor:grab;-webkit-user-select:none;user-select:none;
    min-width:0;
  }
  .cases-track.dragging{cursor:grabbing;scroll-snap-type:none;}
  .case-card{
    display:flex;flex-direction:column;
    scroll-snap-align:start;flex:0 0 auto;width:360px;text-align:left;
    background:var(--white);border:1px solid var(--line);border-radius:22px;
    overflow:hidden;cursor:pointer;font-family:inherit;padding:0;
    transition:transform .25s var(--ease);
  }
  /* .case-ba's own aspect-ratio box must not be asked to flex-stretch/shrink
     beyond its ratio — without this, mixing flex-stretch (from .cases-track)
     with an aspect-ratio box in plain block flow produces inconsistent
     resolved heights across siblings in Chromium (reproduced: identical
     markup, identical computed styles, yet different rendered offsets) */
  .case-ba{flex:0 0 auto;}
  .case-card:hover,.case-card:focus-visible{transform:translateY(-3px);}
  .case-ba{
    display:grid;grid-template-columns:1fr 1fr;aspect-ratio:4/3;position:relative;
    transition:transform .4s var(--ease);
  }
  .case-card:hover .case-ba{transform:scale(1.04);}
  .case-ba-half{
    display:flex;align-items:center;justify-content:center;background:var(--bg);
    font-size:0.6875rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
    color:var(--grey);
  }
  .case-ba-half.case-before{border-right:1px solid var(--line);}
  /* zoom affordance: signals the before/after slot can be opened larger */
  .case-zoom{
    position:absolute;top:50%;left:50%;z-index:1;
    width:42px;height:42px;border-radius:50%;
    background:rgba(255,255,255,0.92);color:var(--ink);
    display:flex;align-items:center;justify-content:center;
    transform:translate(-50%,-50%) scale(.7);opacity:0;
    transition:opacity .25s var(--ease),transform .25s var(--ease);
    pointer-events:none;
  }
  .case-zoom svg{width:19px;height:19px;}
  .case-card:hover .case-zoom,.case-card:focus-visible .case-zoom{opacity:1;transform:translate(-50%,-50%) scale(1);}
  .case-card-body{padding:22px 22px 24px;}
  .case-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px;}
  .case-tags .op-tag{margin-bottom:0;}
  .case-card-body h3{font-size:1.0625rem;font-weight:600;letter-spacing:-0.01em;margin-bottom:8px;}
  .case-card-body p{font-size:0.8438rem;line-height:1.55;color:var(--grey-2);}
  .cases-nav{display:flex;gap:10px;justify-content:flex-end;margin:-12px 0 18px;}
  .cases-nav button{
    width:40px;height:40px;border-radius:50%;background:var(--white);
    border:1px solid var(--line);color:var(--ink);cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    transition:background .2s var(--ease),color .2s var(--ease);
  }
  .cases-nav button:hover{background:var(--ink);color:var(--white);}
  .cases-nav button svg{width:18px;height:18px;}

  /* ---- patient case modal (native <dialog>) ---- */
  /* the page's global *{margin:0} reset kills the UA stylesheet's default
     dialog{margin:auto} centering for the modal (top-layer) state — pin it
     explicitly instead of relying on that interplay across browsers */
  .case-modal{
      width:100%;
    position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);margin:0;
    border:none;padding:0;border-radius:24px;max-width:min(680px,92vw);
    max-height:88vh;overflow-y:auto;background:var(--white);
  }
  .case-modal::backdrop{background:rgba(20,22,25,0.6);}
  .case-modal-close{
    position:absolute;top:16px;right:16px;width:40px;height:40px;border-radius:50%;
    background:var(--white);border:1px solid var(--line);color:var(--ink);cursor:pointer;
    display:flex;align-items:center;justify-content:center;z-index:1;
    transition:background .2s var(--ease),color .2s var(--ease);
  }
  .case-modal-close:hover{background:var(--ink);color:var(--white);}
  .case-modal-close svg{width:18px;height:18px;}
  .case-modal-ba{display:grid;grid-template-columns:1fr 1fr;}
  .case-modal-ba figure{margin:0;}
  .case-modal-ba .case-ba-half{aspect-ratio:1/1;font-size:0.75rem;}
  .case-modal-ba figcaption{
    text-align:center;padding:8px 0;font-size:0.7188rem;color:var(--grey-2);
    background:var(--bg);
  }
  .case-modal-body{padding:28px 28px 30px;}
  .case-modal-body h3{font-size:1.375rem;font-weight:600;letter-spacing:-0.01em;margin-bottom:12px;}
  .case-modal-body p{font-size:0.9375rem;line-height:1.65;color:var(--grey-2);}
  @media(max-width:560px){
    .case-modal-ba{grid-template-columns:1fr;}
    .case-modal-ba .case-ba-half{aspect-ratio:16/9;}
  }
  @media (prefers-reduced-motion:reduce){
    .case-card,.case-ba,.case-zoom{transition:none;}
    .case-card:hover .case-ba{transform:none;}
  }


  /* ---- faq accordion ---- */
  .faq-list2{max-width:100%;}
  .faq-row{border-top:1px solid var(--line);}
  .faq-row:last-child{border-bottom:1px solid var(--line);}
  .faq-row summary{
    list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:20px;
    padding:22px 2px;font-size:1rem;font-weight:600;color:var(--ink);
  }
  .faq-row summary::-webkit-details-marker{display:none;}
  .faq-row .ic{width:22px;height:22px;flex-shrink:0;color:var(--ink);transition:transform .3s var(--ease);}
  .faq-row[open] .ic{transform:rotate(45deg);}
  .faq-row summary{transition:color .2s var(--ease);}
  .faq-row:hover summary{color:var(--grey-2);}
  /* height + fade driven by JS (faq-anim below); overflow hidden while animating */
  .faq-a{padding:0 2px 22px;font-size:0.9062rem;line-height:1.65;color:var(--grey-2);max-width:680px;overflow:hidden;}
  @media (prefers-reduced-motion:reduce){.faq-a{transition:none !important;}}

  @media(max-width:880px){
    /* collapse the proportional 8-col grid to a single readable column */
    .cols{grid-template-columns:1fr;}
    .col-content{grid-column:1/2;padding:0 22px 20px;}
    .ruler{display:none;}

    .ops-grid,.rev-grid,.contacts{grid-template-columns:1fr;}
    .rev-grid{gap:14px;}
    .contacts{gap:28px;}
    .ops-grid{gap:14px;}
    .appr-grid,.ind-grid2{gap:14px;}
    /* drop the on-grid inner gutters once everything collapses to one column.
       Must match :first-child/:last-child, not just *, to actually win — the
       desktop gutter rules below have higher specificity than a bare `*` reset. */
    .ops-grid > :first-child, .ops-grid > :last-child,
    .appr-grid > :first-child, .appr-grid > :last-child,
    .ind-grid2 > :first-child, .ind-grid2 > :last-child{margin:0;}
    .band-copy,
    .about-grid > :last-child,
    .doc-card-grid > :last-child,
    .step > :last-child{padding-left:0;}
    .contacts > :first-child{padding-right:0;}
    .step{grid-template-columns:70px 1fr;gap:18px;}
    .pillars-hero{grid-template-columns:1fr;gap:16px;}
    .pillar-feature{margin-right:0;padding:36px 28px;}
    .pillar-num{font-size:clamp(4rem,22vw,6.875rem);}
    .pillar-stack{margin-left:0;}
    .about-grid{grid-template-columns:1fr;}
    .appr-grid,.ind-grid2{grid-template-columns:1fr;}
    .doc-nums{grid-template-columns:repeat(2,1fr);gap:18px 0;}
    .doc-nums .n:nth-child(3){border-left:none;padding-left:0;}
    .doc-detail-grid{grid-template-columns:1fr;}
    .doc-card-h{flex-direction:column;}
    .doc-card-grid{grid-template-columns:1fr;gap:22px;}
    .doc-photo-frame{max-width:280px;margin:0 auto;}
    .doc-tl-item{grid-template-columns:1fr;gap:3px;}
    .stay-bento{grid-template-columns:repeat(2,1fr);grid-auto-rows:140px;}
    .stay-cell--lg{grid-column:span 2;grid-row:span 1;}
    .nav-links,.nav-loc{display:none;}
    .nav-menu{display:block;}
    .htxt-grid{grid-template-columns:1fr;}
    .block-a,.block-b{grid-column:1;}
    .block-b{align-self:flex-start;margin-top:18px;}
    .hero-foot{flex-direction:column;align-items:flex-start;gap:22px;}
    .band-grid{grid-template-columns:1fr;}
    .sec{padding-top:36px;}
    .sec-tag{font-size:0.8125rem;}
    /* the desktop clamp's 21vw growth rate overflows the viewport between
       this breakpoint and 520px (e.g. 21vw at 700px = 147px — wider than
       the word's own container); the ≤520px tier below tames it further,
       but that tier alone left this range with no override at all */
    .wordmark{font-size:clamp(4.5rem,16vw,8rem);}
    .case-card{width:300px;}
  }
  @media(max-width:520px){
    div.page{padding:24px 16px 48px;}
    .case-card{width:78vw;}
    .col-content{padding:0 16px 18px;}
    .nav{padding:8px 6px 8px 12px;gap:10px;}
    .brand{gap:7px;}
    .brand .mark{width:28px;height:28px;}
    .brand b{font-size:0.625rem;}
    .brand b small{font-size:0.5rem;}
    .nav-menu{padding:9px 14px;font-size:0.7812rem;}
    .htxt{font-size:clamp(1.625rem,7.5vw,2.125rem);}
    .cta{padding:14px 22px;font-size:0.875rem;}
    .wordmark{font-size:clamp(3.375rem,17vw,5.625rem);}
    .foot-bottom{flex-direction:column;gap:6px;}
    .foot-top{flex-direction:column;gap:28px;}
    .foot-cols{gap:32px;width:100%;}

    /* card padding: desktop values are too heavy on small screens */
    .doc-card{padding:24px 20px 22px;}
    .op-card{padding:24px 20px;}
    .pillar-card{padding:22px 18px;}
    .appr-card{padding:22px 18px;}
    .ind-card2{padding:22px 18px;}
    .rev{padding:20px 18px;}
    .doc-detail-card{padding:20px 18px;}
    .doc-conf-card{padding:20px 18px;}
  }
  /* ---- lightbox (patient-stay gallery) ---- */
  .lightbox{
    position:fixed;inset:0;z-index:200;
    display:none;align-items:center;justify-content:center;
    background:rgba(20,22,25,0.92);padding:24px;
    opacity:0;transition:opacity .25s var(--ease);
  }
  .lightbox.open{display:flex;}
  .lightbox.visible{opacity:1;}
  .lightbox-img{
    max-width:min(1100px,92vw);max-height:86vh;object-fit:contain;border-radius:8px;
    box-shadow:0 24px 64px rgba(0,0,0,0.5);
    transform:scale(.98);transition:transform .3s var(--ease);
  }
  .lightbox.visible .lightbox-img{transform:scale(1);}
  .lightbox-btn{
    position:absolute;top:50%;transform:translateY(-50%);
    width:52px;height:52px;border-radius:50%;
    background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.2);
    color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;
    transition:background .2s var(--ease);
  }
  .lightbox-btn:hover{background:rgba(255,255,255,0.2);}
  .lightbox-btn svg{width:22px;height:22px;}
  .lb-prev{left:max(16px,3vw);}
  .lb-next{right:max(16px,3vw);}
  .lb-close{top:max(16px,3vw);right:max(16px,3vw);transform:none;width:46px;height:46px;}
  .lb-counter{
    position:absolute;bottom:max(16px,3vw);left:50%;transform:translateX(-50%);
    font-size:0.8125rem;letter-spacing:.04em;color:rgba(255,255,255,0.7);
  }
  @media(max-width:560px){.lightbox-btn{width:44px;height:44px;}.lb-prev{left:8px;}.lb-next{right:8px;}}
  @media (prefers-reduced-motion:reduce){.lightbox,.lightbox-img{transition:none;}.lightbox.visible .lightbox-img{transform:none;}}

  @media (prefers-reduced-motion:reduce){*{transition:none!important;}}

  /* ---- scroll-triggered text reveal ----
     Content is visible by default; the entrance is added only when JS runs
     and motion is allowed (html.reveal-on), so no-JS / reduced-motion users
     always see the page fully rendered. */
  .txt-reveal{transition:opacity .8s var(--ease), transform .8s var(--ease), filter .7s var(--ease);}
  html.reveal-on .txt-reveal{opacity:0;transform:translateY(26px);filter:blur(7px);}
  html.reveal-on .txt-reveal.in{opacity:1;transform:translateY(0);filter:blur(0);}
  html.reveal-on .txt-reveal.d1{transition-delay:.08s;}
  html.reveal-on .txt-reveal.d2{transition-delay:.16s;}
  html.reveal-on .txt-reveal.d3{transition-delay:.24s;}

  /* ---- scroll-triggered card reveal (grids of cards, staggered) ---- */
  .card-reveal{
    transition:opacity .6s var(--ease), transform .6s var(--ease);
    transition-delay:calc(var(--i,0)*70ms);
  }
  html.reveal-on .card-reveal{opacity:0;transform:translateY(22px);}
  html.reveal-on .card-reveal.in{opacity:1;transform:translateY(0);}
  /* method steps read top-to-bottom as a sequence, not a grid of cards — a
     sideways entrance reads as "falling into line" instead of the generic
     fade-up every other section already uses */
  html.reveal-on .steps > .card-reveal{transform:translateX(-22px);}
  html.reveal-on .steps > .card-reveal.in{transform:translateX(0);}

  /* ---- magnetic tilt: small buttons follow the cursor in 3D + pop ---- */
  .tilt-btn{
    transform:translate3d(0,0,0) scale3d(1,1,1) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    transform-style:preserve-3d;
    transition:transform .35s var(--ease);
    will-change:transform;
  }
  .tilt-btn.tilt-active{transition:transform .08s linear;}
  @media (prefers-reduced-motion:reduce){
    .tilt-btn{transition:none!important;transform:none!important;}
  }
