/* Board round S1, part a: sections proposed on docs/relaunch/sections-board. Loaded only when a card is on (site_build.want).
 * Classes start with s1-. Tokens are the --b-* of site-b.css. Everything is complete at rest; scroll motion is armed by the first scroll (site-s1a.js),
 * reduced motion and print show every state without transforms. Scroll-linked sections use overflow: clip, never hidden. */

/* ---------- 01 Reading line by the ToC (recipe tracing-beam): 2px rail, red fill = progress through the text, a dot per item ---------- */
.p-toc[data-s1-trace] { margin-left: -4px; padding-left: 4px; }      /* the box of .p-toc clips what sticks out: the dots need 4px on the left */
.p-toc[data-s1-trace] ul { position: relative; border-left: 0; }
.p-toc[data-s1-trace] ul::before, .p-toc[data-s1-trace] ul::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; }
.p-toc[data-s1-trace] ul::before { background: var(--b-rule); }
.p-toc[data-s1-trace] ul::after { background: var(--b-accent); transform: scaleY(var(--s1-p, 0)); transform-origin: top; }
.p-toc[data-s1-trace] li { position: relative; }
.p-toc[data-s1-trace] li::before { content: ""; position: absolute; z-index: 1; left: -3px; top: calc(0.45rem + 0.5 * 1.35 * var(--b-small) - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--b-bg); border: 2px solid var(--b-rule-strong); box-sizing: border-box; }
.p-toc[data-s1-trace] li.is-reached::before { background: var(--b-accent); border-color: var(--b-accent); }
.p-toc[data-s1-trace] a { margin-left: 0; padding-left: 1.2rem; border-left-width: 0; }
.p-toc[data-s1-trace] a[aria-current] { color: var(--b-ink); border-left-width: 0; }

/* ---------- 02 Photos in the text open from a frame (recipe reveal-image-mask) ---------- */
[data-s1-mask] { overflow: clip; }
@keyframes s1-mask-open { from { clip-path: inset(var(--s1-my, 12%) var(--s1-mx, 9%)); } to { clip-path: inset(0); } }
@keyframes s1-mask-settle { from { transform: scale(1.12); } to { transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .s1-armed [data-s1-mask]:not(.s1-rest) { view-timeline: --s1-mask block; animation: s1-mask-open linear both; animation-timeline: --s1-mask; animation-range: entry 0% cover 35%; }
    .s1-armed [data-s1-mask]:not(.s1-rest) img { animation: s1-mask-settle linear both; animation-timeline: --s1-mask; animation-range: entry 0% cover 35%; }
  }
  @supports not (animation-timeline: view()) {
    .s1-armed [data-s1-mask]:not(.s1-rest) { clip-path: inset(calc((1 - var(--s1-sp, 1)) * var(--s1-my, 12%)) calc((1 - var(--s1-sp, 1)) * var(--s1-mx, 9%))); transition: clip-path 0.25s linear; }
    .s1-armed [data-s1-mask]:not(.s1-rest) img { transform: scale(calc(1 + (1 - var(--s1-sp, 1)) * 0.12)); transition: transform 0.25s linear; }
  }
}
@media print { [data-s1-mask] { clip-path: none !important; animation: none !important; } [data-s1-mask] img { transform: none !important; animation: none !important; } }

/* ---------- 03 Main button: the dot grows into the fill (recipe hover-fill-button); pointer devices only, a phone keeps the plain button ---------- */
.s1-hfb { position: relative; isolation: isolate; overflow: clip; }
.s1-hfb .s1-hfb__dot, .s1-hfb .s1-hfb__b { display: none; }
.s1-hfb .ico { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  .s1-hfb { --s1-fill: var(--b-ink); --s1-scale: 100; --s1-dot-x: 1.3rem; }
  .s1-hfb.b-contact__btn { --s1-scale: 45; --s1-dot-x: 0.95rem; }
  .s1-hfb .s1-hfb__dot { display: block; position: absolute; z-index: -1; left: var(--s1-dot-x); top: 50%; width: 0.5rem; height: 0.5rem; margin-top: -0.25rem; border-radius: 50%; background: var(--s1-fill); transition: transform 0.5s var(--b-ease); }
  .s1-hfb .s1-hfb__a { display: inline-block; padding-left: 0.9rem; transition: transform 0.45s var(--b-ease), opacity 0.3s; }
  .s1-hfb .s1-hfb__b { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 0.5rem; color: var(--b-on-accent); transform: translateX(40%); opacity: 0; transition: transform 0.45s var(--b-ease), opacity 0.3s; }
  .s1-hfb.s1-hfb:is(:hover, :focus-visible) { background: var(--b-accent); color: var(--b-on-accent); }
  .s1-hfb:is(:hover, :focus-visible) .s1-hfb__dot { transform: scale(var(--s1-scale)); }
  .s1-hfb:is(:hover, :focus-visible) .s1-hfb__a { transform: translateX(2.5rem); opacity: 0; }
  .s1-hfb:is(:hover, :focus-visible) .s1-hfb__b { transform: none; opacity: 1; }
  .vb .s1-hfb:focus-visible { outline-color: var(--b-ink); }
  .p-cta .s1-hfb { --s1-fill: var(--b-on-dark); }      /* the closing band is dark: the fill is the light surface and the copy turns dark */
  .p-cta .s1-hfb .s1-hfb__b { color: var(--b-ink); }
  .vb .p-cta .s1-hfb:focus-visible { outline-color: #fff; }
}
@media (prefers-reduced-motion: reduce) { .s1-hfb .s1-hfb__dot, .s1-hfb .s1-hfb__a, .s1-hfb .s1-hfb__b { transition: none !important; } }

/* ---------- 04 Menu links: the letters roll (recipe text-roll), desktop with a real hover; the link keeps its name in aria-label ---------- */
.s1-roll { position: relative; display: inline-block; overflow: clip; vertical-align: top; line-height: 1.25; perspective: 20em; }
.s1-roll__a, .s1-roll__b { display: inline-block; white-space: pre; }
.s1-roll__b { position: absolute; left: 0; top: 0; }
.s1-roll__a > span, .s1-roll__b > span { display: inline-block; transition: transform 0.5s var(--b-ease); transition-delay: calc(var(--i, 0) * 22ms); }
.s1-roll__a > span { transform-origin: 50% 100%; }
.s1-roll__b > span { transform: translateY(100%) rotateX(-70deg); transform-origin: 50% 0; }
@media (min-width: 64rem) {
  .b-nav a:focus-visible .s1-roll__a > span { transform: translateY(-100%) rotateX(70deg); }
  .b-nav a:focus-visible .s1-roll__b > span { transform: none; }
}
@media (min-width: 64rem) and (hover: hover) {
  .b-nav a:hover .s1-roll__a > span { transform: translateY(-100%) rotateX(70deg); }
  .b-nav a:hover .s1-roll__b > span { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .s1-roll__a > span, .s1-roll__b > span { transition: none !important; transform: none !important; }
  .s1-roll__b { visibility: hidden; }
  .b-nav a:is(:hover, :focus-visible) .s1-roll { opacity: 0.65; }
}

/* ---------- 05 Implant path with stage prices: the home section reused as is (site-b.css .b-steps, site-b.js); only the spacing after «Коротко» is trimmed ---------- */
#s1-implant { padding-top: clamp(1.5rem, 1rem + 2vw, 3rem); }

/* ---------- 06 Price composition strip (recipe price-strip) and the archive status line; the hairlines are the gap of the grid, the cells have no borders ---------- */
.p-svc-prices .s1-prs { margin-top: 1.25rem; container-type: inline-size; }
.s1-prs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--b-rule); border-block: 1px solid var(--b-rule); border-top-color: var(--b-ink); }
.p-svc-prices .s1-prs__cell { display: grid; align-content: start; gap: 0.5rem; margin: 0; padding: 1.1rem 0.9rem 1.25rem 1rem; background: var(--b-bg); }
.p-svc-prices .s1-prs__cell:nth-child(odd) { padding-left: 0; }
.p-svc-prices .s1-prs__cell.s1-prs__cell--mark { padding-inline: 1rem; background: var(--b-dark); }
.p-svc-prices .s1-prs dt { font-size: var(--b-small); font-weight: 500; letter-spacing: 0.04em; line-height: 1.3; text-transform: uppercase; color: var(--b-ink-3); }
.p-svc-prices .s1-prs__value { margin: 0; font-size: clamp(1.9rem, 5.2cqi, 2.9rem); font-weight: 500; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--b-ink); }
.p-svc-prices .s1-prs__from { font-size: 0.42em; font-weight: 500; letter-spacing: 0; vertical-align: 0.55em; }
.p-svc-prices .s1-prs__hint { margin: 0; font-size: var(--b-small); line-height: 1.4; color: var(--b-ink-3); }
.p-svc-prices .s1-prs__cell--mark dt, .p-svc-prices .s1-prs__cell--mark .s1-prs__hint { color: var(--b-on-dark-2); }
.p-svc-prices .s1-prs__cell--mark .s1-prs__value { color: var(--b-on-dark); }
.p-svc-prices .s1-prs .s1-prs__cell--mark :is(dt, .s1-prs__from, .s1-prs__u) { color: var(--b-on-dark-2); }
@container (min-width: 40rem) {
  .s1-prs__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .p-svc-prices .s1-prs__cell:nth-child(odd) { padding-left: 1rem; }
  .p-svc-prices .s1-prs__cell:first-child { padding-left: 1rem; }
}
@container (max-width: 19rem) { .s1-prs__grid { grid-template-columns: minmax(0, 1fr); } .p-svc-prices .s1-prs__cell:not(.s1-prs__cell--mark) { padding-left: 0; } }

/* ---------- 15 Archive status beside the numbers ---------- */
.p-prose .s1-status, .s1-status { font-size: var(--b-small); line-height: 1.35; color: var(--b-ink-3); }
.p-svc-prices .s1-status--head, .p-svc-prices .s1-status--strip { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0 0; }
.p-svc-prices .s1-status--head::before, .p-svc-prices .s1-status--strip::before { content: ""; flex: none; width: 0.4rem; height: 0.4rem; background: var(--b-accent); }
.p-svc-prices .s1-status--head { margin-bottom: 0; }
.p-brief dd .s1-status { display: inline-flex; align-items: center; margin-left: 0.25rem; padding: 0.1rem 0.55rem; border: 1px solid var(--b-rule-strong); font-size: var(--b-small); line-height: 1.35; font-weight: 500; letter-spacing: 0; color: var(--b-ink-3); vertical-align: 0.1em; }

/* ---------- 07 Lab band with the drifting year (recipe dark-story-year) ---------- */
.p-prose .s1-lab { position: relative; z-index: 1; box-sizing: border-box; overflow: clip; margin-block: clamp(3rem, 2rem + 3vw, 5rem); padding: clamp(3.5rem, 2rem + 6vw, 7rem) 1.5rem; background: var(--b-dark); color: var(--b-on-dark); }
.p-prose .s1-lab.is-bleed { width: var(--s1-w); margin-left: calc(var(--s1-l) * -1); padding-left: var(--s1-l); padding-right: var(--b-gutter); }
.s1-lab__in { position: relative; max-width: var(--s1-cw, none); }
.p-prose .s1-lab .s1-lab__year { position: absolute; right: var(--b-gutter); top: clamp(1.5rem, 4vw, 4rem); margin: 0; font-size: clamp(7rem, 1rem + 24vw, 20rem); font-weight: 500; letter-spacing: -0.07em; line-height: 0.8; color: color-mix(in srgb, var(--b-on-dark) 10%, var(--b-dark)); pointer-events: none; user-select: none; }
.p-prose .s1-lab .b-kicker { margin: 0; color: var(--b-on-dark-2); }
.p-prose .s1-lab h2 { margin: 0.9rem 0 0; padding: 0; border: 0; max-width: 13ch; font-size: clamp(2.25rem, 1.2rem + 4vw, 4.5rem); line-height: 0.98; color: var(--b-on-dark); }
.p-prose .s1-lab .s1-lab__text { margin: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0 0; max-width: 24em; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; color: var(--b-on-dark); }
.p-prose .s1-lab .s1-lab__link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; margin-top: 1.25rem; color: var(--b-on-dark); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.p-prose .s1-lab .s1-lab__link:hover { text-decoration-thickness: 2px; }
.s1-lab__link .ico { width: 1.1rem; height: 1.1rem; flex: none; transition: transform 220ms var(--b-ease); }
.vb .s1-lab :focus-visible { outline-color: #fff; }
@media (hover: hover) and (pointer: fine) { .s1-lab__link:hover .ico { transform: translateX(3px); } }
@keyframes s1-drift { from { translate: 0 2rem; } to { translate: 0 -2rem; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .s1-lab { view-timeline: --s1-lab block; }
    .s1-lab__year { animation: s1-drift linear both; animation-timeline: --s1-lab; }
  }
}
@media (prefers-reduced-motion: reduce) { .s1-lab__link .ico { transition: none; } }
@media print { .s1-lab__year { animation: none !important; translate: none !important; } .p-prose .s1-lab.is-bleed { width: auto; margin-left: 0; padding-left: 1.5rem; } }

/* ---------- 08 Service hero with a photo (recipe hero-lines-photo): a black and white photo instead of the icon; the H1 keeps the word masks of site-b.js ---------- */
.s1-hp .p-head__wrap { grid-template-areas: "crumbs crumbs" "kicker kicker" "title title" "photo photo" "lead lead" "meta meta" "cta cta" "fig fig"; }
.s1-hp__photo { grid-area: photo; margin: 1.25rem 0 0; min-width: 0; }
.s1-hp__frame { aspect-ratio: 4 / 3; overflow: clip; background: var(--b-placeholder); outline: 1px solid var(--b-img-outline); outline-offset: -1px; }
.s1-hp__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s1-hp__photo figcaption { margin-top: 0.6rem; font-size: 0.8125rem; line-height: 1.4; color: var(--b-ink-3); }
@media (min-width: 48rem) {
  .s1-hp .p-head__grid { grid-template-columns: minmax(0, 1fr) minmax(0, clamp(18rem, 38vw, 34rem)); }
  .s1-hp .s1-hp__photo { grid-area: auto; margin: 0; }
}

/* ---------- 09 Other services as rows (recipe service-index): the rows of the home list "З чим до нас звертаються" (.c-svc in site-b.css) ---------- */
.s1-svc a.c-svc__row { text-decoration: none; color: inherit; }
.s1-svc .c-svc__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.s1-svc__all { margin-top: 1rem; }
@media (min-width: 48rem) { .s1-svc .c-svc__desc { grid-row: 1 / span 2; align-self: center; -webkit-line-clamp: 2; } }

/* ---------- 10 FAQ: the open question stands out (idea of glow-accordion, no glow): light surface and a 2px red rule on the left ---------- */
.p-faq[data-s1-faq] details[open] { margin-inline: -1rem; padding-inline: 1rem; background: var(--b-surface); box-shadow: inset 2px 0 0 var(--b-accent); }

/* ---------- 11 Pages without a ToC: the text and the booking card spread over the same container as on pages with one ---------- */
@media (min-width: 64rem) { .p-body.s1-solo { justify-content: space-between; } }
@media (min-width: 80rem) { .p-body.s1-solo { grid-template-columns: minmax(0, 44rem) minmax(0, 18rem); } }
