/* ==========================================================================
   /services/corporate/ — «Корпоративные сайты».
   Builds on /nikkalma-2.css (body.nk2.project-preview-cinematic: black /
   graphite / silver tokens, shared header, footer, buttons, focus) and on
   /services.css (contact dialog). Headings use Onest light, as the homepage;
   body text is Onest too.
   Load order: /styles.css → /nikkalma-2.css → /services.css → this file.
   ========================================================================== */

.service-page {
  --svc-serif: "Onest", system-ui, sans-serif;       /* display face: same as the homepage (name kept for the page stylesheets) */
  --svc-ink: var(--nk2-cream);
  --svc-text: rgba(241, 235, 221, .74);
  --svc-label: rgba(241, 235, 221, .64);
  --svc-line: rgba(218, 224, 230, .2);
  --svc-bg: var(--nk2-graphite);                     /* #0e0f0f */
  --svc-bleed: clamp(140px, 14vw, 240px);             /* how far the nebula runs past the hero */
}

main#content.svc-page { display: block; padding: 0; }

.svc-page h1,
.svc-page h2,
.svc-page h3 { overflow-wrap: break-word; }

.svc-label,
.svc-kicker {
  margin: 0;
  color: var(--svc-label);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;                              /* as the homepage labels */
  line-height: 1.3;
  text-transform: uppercase;
}

.svc-display {
  margin: 0;
  color: var(--svc-ink);
  font-family: var(--svc-serif);
  font-size: clamp(2.25rem, 4vw, 3.75rem);            /* 36–60px */
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: 1.04;
}

/* --- 1. Hero: cinematic nebula, slow camera approach -------------------- */
.svc-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(520px, calc(100svh - 66px), 720px);
  padding: clamp(48px, 5vw, 80px) var(--nk2-pad) clamp(96px, 11vw, 160px);
  overflow: visible;                                       /* the nebula bleeds into the next block */
}

/* The image layer is taller than the hero: it runs --svc-bleed into the
   intro below and fades out there with a mask (no hard edge, no colour
   block). It clips its own zoom, so nothing widens the page. */
.svc-hero-media {
  position: absolute;
  z-index: -2;
  inset: 0 0 calc(-1 * var(--svc-bleed)) 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, .55) 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, .55) 80%, transparent 100%);
  pointer-events: none;
}
/* The galaxy spins in the plane of its own disk and slowly comes closer.
   The disk is an inclined ellipse (major axis −27°, axis ratio ≈ .45,
   measured on the artwork), so the spin is: un-tilt → un-squash → rotate →
   squash → tilt. The arms wind around the core while the oval keeps its
   place. picture = a zero-size pivot on the core; the image hangs from it.
   The image is masked to that same ellipse, so its straight borders never
   show while it turns; around it the layer shows the artwork's own black. */
@property --svc-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.svc-hero-media { container-type: size; background: var(--svc-bg); }
.svc-hero-media picture {
  position: absolute;
  left: var(--svc-core-x, 68cqw);
  top: var(--svc-core-y, 42cqh);
  display: block;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  mix-blend-mode: screen;                                  /* artwork black → page graphite (on the layer root, not the img) */
  transform: rotate(-27deg) scaleY(.45) rotate(var(--svc-spin)) scaleY(2.2222) rotate(27deg);
  animation:
    svc-approach 28s cubic-bezier(.25, .1, .25, 1) both,
    svc-spin 240s linear infinite;
  will-change: transform;
}
.svc-hero-media img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--svc-img-w, clamp(860px, 94cqw, 2000px));   /* artwork 1672×941 */
  max-width: none;
  height: auto;
  translate: -50.96% -46.97%;                                /* the galaxy core sits on the pivot */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1672 941' preserveAspectRatio='none'%3E%3Cdefs%3E%3CradialGradient id='g' gradientUnits='userSpaceOnUse' cx='852' cy='442' r='820' gradientTransform='translate(852 442) rotate(-27) scale(1 .45) translate(-852 -442)'%3E%3Cstop offset='.72' stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='1672' height='941' fill='url(%23g)'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1672 941' preserveAspectRatio='none'%3E%3Cdefs%3E%3CradialGradient id='g' gradientUnits='userSpaceOnUse' cx='852' cy='442' r='820' gradientTransform='translate(852 442) rotate(-27) scale(1 .45) translate(-852 -442)'%3E%3Cstop offset='.72' stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='1672' height='941' fill='url(%23g)'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
@keyframes svc-approach {
  from { scale: 1; }
  to   { scale: 1.15; }
}
@keyframes svc-spin {
  to { --svc-spin: -360deg; }                              /* counter-clockwise on screen; one turn in 4 min */
}
.svc-hero.is-offscreen .svc-hero-media picture { animation-play-state: paused; }

/* Readability: shade on the left (hero copy) and over the lower part, where
   the intro text sits on the bleeding nebula. Lives inside the image layer,
   so it covers exactly the same area and fades with the same mask. */
.svc-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 15, 15, .88) 0%, rgba(14, 15, 15, .62) 30%, rgba(14, 15, 15, .12) 58%, rgba(14, 15, 15, 0) 72%),
    linear-gradient(180deg, rgba(14, 15, 15, 0) 40%, rgba(14, 15, 15, .62) 62%, rgba(14, 15, 15, .82) 100%);
}

.svc-hero-copy { position: relative; max-width: 760px; }

.svc-kicker { display: flex; align-items: center; gap: 14px; }
.svc-kicker::after {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.svc-hero h1 {
  max-width: 9.5em;
  margin: clamp(18px, 2vw, 26px) 0 0;
  color: var(--svc-ink);
  font-family: var(--svc-serif);
  font-size: clamp(3.25rem, 7vw, 6.75rem);            /* 52–108px, as the homepage h1 */
  font-weight: 300;
  letter-spacing: -.06em;
  line-height: 1;                                     /* Onest: «й» over «р» needs the full line */
}

.svc-lead {
  max-width: 30em;
  margin: clamp(24px, 2.6vw, 36px) 0 0;
  color: var(--svc-text);
  font-size: clamp(1rem, 1.25vw, 1.1875rem);          /* 16–19px */
  line-height: 1.55;
}

.svc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(32px, 3.4vw, 48px);
}
.svc-hero-rule { width: 72px; height: 1px; background: var(--svc-line); }
.svc-hero-price {
  margin: 0;
  color: var(--svc-ink);
  font-size: 1.125rem;
  white-space: nowrap;
}

/* --- 2. Intro: heading left, text right --------------------------------- */
.svc-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(40px, 5vw, 72px) var(--nk2-pad) clamp(72px, 9vw, 136px);
}
.svc-intro-text {
  max-width: 34em;
  padding-left: clamp(24px, 3.4vw, 48px);
  border-left: 1px solid var(--svc-line);
}
.svc-intro-text p {
  margin: 0;
  color: var(--svc-text);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.65;
}
.svc-intro-text p + p { margin-top: 1em; }
/* the nebula runs under this text: a soft dark halo keeps it legible over the bright arms */
.svc-intro-text p { text-shadow: 0 0 16px rgba(14, 15, 15, .9), 0 1px 3px rgba(14, 15, 15, .7); }

/* --- 3. Scope: planet on the left, four directions on the right --------- */
.svc-scope {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: clamp(560px, 54vw, 780px);
  padding: clamp(40px, 5vw, 72px) var(--nk2-pad);
  overflow: visible;                                       /* glow must not be cut; .site-canvas clips x */
}

/* Planet: static artwork (no rotation, no parallax). The box is the planet's
   disc; the image is cropped square around it with 8.25% margin for the lit
   rim, so it overhangs the box by that much. Screen blend turns the artwork's
   black into the page graphite. */
.svc-planet {
  position: absolute;
  top: 50%;
  left: 0;
  width: clamp(420px, 48vw, 760px);
  aspect-ratio: 1;
  transform: translate(-46%, -50%);
  pointer-events: none;
}
.svc-planet { mix-blend-mode: screen; }
.svc-planet picture {
  position: absolute;
  inset: -8.25%;
  display: block;
}
.svc-planet img { display: block; width: 100%; height: 100%; }

.svc-scope-body { grid-column: 2; position: relative; }
.svc-scope-list {
  margin: clamp(24px, 2.6vw, 36px) 0 0;
  padding: 4px 0 4px clamp(24px, 3vw, 40px);
  border-left: 1px solid var(--svc-line);
  list-style: none;
}
.svc-scope-list li + li { margin-top: clamp(24px, 2.6vw, 36px); }
.svc-scope-list h3 {
  margin: 0;
  color: var(--svc-ink);
  font-family: var(--svc-serif);
  font-size: clamp(1.375rem, 1.75vw, 1.75rem);        /* 22–28px */
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.12;
}
.svc-scope-list p {
  max-width: 32em;
  margin: 8px 0 0;
  color: var(--svc-text);
  font-size: .9375rem;
  line-height: 1.55;
}

/* --- 4. Price: large typography, no card --------------------------------- */
.svc-price {
  margin: 0 var(--nk2-pad);
  padding: clamp(48px, 6vw, 88px) 0 clamp(64px, 8vw, 120px);
  border-top: 1px solid var(--svc-line);
}
.svc-price-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(16px, 1.6vw, 24px);
}
.svc-price-value {
  margin: 0;
  color: var(--svc-ink);
  font-family: var(--svc-serif);
  font-size: clamp(3rem, 6vw, 5.5rem);                /* 48–88px */
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}
.svc-price-slash {
  width: 1px;
  height: clamp(72px, 8vw, 116px);
  background: var(--svc-line);
  transform: rotate(24deg);
}
.svc-price-note { max-width: 30em; }
.svc-price-note p {
  margin: 0;
  color: var(--svc-text);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.6;
}
.svc-price-note .button { margin-top: 24px; }

/* --- Next row ------------------------------------------------------------ */
.svc-next-row { margin: 0 var(--nk2-pad); border-top: 1px solid var(--svc-line); }
.svc-next-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 72px;
  color: var(--svc-text);
  font-size: .9375rem;
  text-decoration: none;
  transition: color .2s ease;
}
.svc-next-row-link:hover { color: var(--svc-ink); }

/* --- Tablet -------------------------------------------------------------- */
@media (max-width: 960px) {
  .svc-intro { grid-template-columns: minmax(0, 1fr); }
  .svc-scope { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: clamp(380px, 66vw, 520px); }
  .svc-scope-body { grid-column: 1; }
  .svc-planet { top: 24px; width: clamp(340px, 60vw, 480px); transform: translate(-36%, 0); }
  .svc-price-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .svc-price-slash { display: none; }
}

/* Keep the copy readable where the tablet galaxy crosses the text. */
@media (min-width: 681px) and (max-width: 1100px) {
  .svc-hero-copy { isolation: isolate; }
  .svc-hero-copy::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -20px -24px;
    border-radius: 40px;
    background: rgba(14, 15, 15, .72);
    filter: blur(24px);
    pointer-events: none;
  }
}

/* --- Mobile -------------------------------------------------------------- */
@media (max-width: 680px) {
  .svc-hero {
    align-items: flex-end;
    min-height: 0;
    padding: clamp(260px, 72vw, 340px) 20px 56px;
  }
  /* phone: a smaller galaxy above the copy, not behind it */
  .service-page { --svc-core-x: 56cqw; --svc-core-y: 22cqh; --svc-img-w: 150cqw; }
  .service-page { --svc-bleed: 120px; }
  .svc-hero-media::after {
    background: linear-gradient(180deg, rgba(14, 15, 15, .1) 0%, rgba(14, 15, 15, .35) 30%, rgba(14, 15, 15, .82) 56%, rgba(14, 15, 15, .82) 100%);
  }
  .svc-hero-copy { min-width: 0; }
  .svc-hero-actions { gap: 16px 20px; }
  .svc-hero-actions .button { flex: 1 1 100%; }
  .svc-hero-rule { width: 40px; }
  .svc-intro { padding: 32px 20px 64px; }
  .svc-intro-text { padding-left: 20px; }
  .svc-scope { padding: 360px 20px 56px; }
  .svc-planet { top: 16px; width: 320px; transform: translate(-38%, 0); }
  .svc-scope-list { padding-left: 20px; }
  .svc-price { margin: 0 20px; padding: 48px 0 64px; }
  .svc-price-note .button { width: 100%; }
  .svc-next-row { margin: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .svc-hero-media picture { animation: none; will-change: auto; }
  .svc-next-row-link { transition: none; }
}

/* ==========================================================================
   Overlapping rhythm (2026-11-04): sections are pulled into each other —
   the intro rises into the fading nebula, the planet rises behind the intro,
   the price rises over the planet's lower edge. Text always sits above.
   ========================================================================== */
.svc-hero { padding-bottom: clamp(150px, 16vw, 250px); }

.svc-intro,
.svc-price,
.svc-next-row { position: relative; z-index: 1; }

.svc-intro {
  margin-top: calc(-1 * clamp(110px, 11.5vw, 190px));
  padding-top: 0;
  padding-bottom: clamp(16px, 2vw, 32px);
}

.svc-scope {
  z-index: auto;                                           /* no own layer: the planet blends with the page */
  min-height: clamp(520px, 50vw, 720px);
  margin-top: calc(-1 * clamp(24px, 3vw, 56px));
  padding-top: 0;
  padding-bottom: 0;
}

.svc-price {
  margin-top: calc(-1 * clamp(24px, 3.4vw, 64px));
  padding-top: clamp(40px, 4.4vw, 64px);
}

@media (max-width: 960px) {
  .svc-hero { padding-bottom: 120px; }
  .svc-intro { margin-top: -72px; }
  .svc-scope { min-height: 0; margin-top: -24px; padding-top: clamp(330px, 58vw, 460px); padding-bottom: 24px; }
  .svc-price { margin-top: 0; }
}

@media (max-width: 680px) {
  .svc-hero { padding-bottom: 72px; }
  .svc-intro { margin-top: -32px; padding: 0 20px 8px; }
  .svc-scope { margin-top: -16px; padding: 300px 20px 16px; }
  .svc-planet { top: 0; }
  .svc-price { padding-top: 40px; }
}

/* ==========================================================================
   Block reveal (corporate.js). Each text block below the hero drifts up into
   place as one piece — slow, long ease-out, no per-line sequence. Classes are
   added by the script only, so without JS or with reduced motion everything
   is simply visible. The hero copy and the planet never move.
   ========================================================================== */
.svc-motion .svc-reveal {
  opacity: 0;
  transform: translate3d(0, 56px, 0);
  transition:
    opacity 1.4s cubic-bezier(.16, 1, .3, 1),
    transform 1.6s cubic-bezier(.16, 1, .3, 1);
}
.svc-motion .svc-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .svc-motion .svc-reveal { opacity: 1; transform: none; transition: none; }
}
