/* ==========================================================================
   Portfolio and services (/portfolio/) — client-facing section.
   Loaded after system.css: keeps its reset, image protection and strips,
   replaces the type and colour with a neutral black/white theme set in
   Inter Display. Sections alternate .is-dark / .is-light; colour comes
   from the work itself.
   ========================================================================== */

@font-face {
    font-family: 'Inter Display';
    src: url('../fonts/InterDisplay-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter Display';
    src: url('../fonts/InterDisplay-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter Display';
    src: url('../fonts/InterDisplay-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* --- Palette and roles ---------------------------------------------------- */

.theme-portfolio {
    --pf-ink:    #000000;
    --pf-paper:  #FFFFFF;
    --pf-grey:   #696969;
    --pf-mist:   #F7F7F7;
    --pf-night:  #111112;
    --pf-shade:  rgba(0, 0, 0, 0.55);
    --pf-veil:   rgba(0, 0, 0, 0.72);

    --font-pf: 'Inter Display', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Type scale of the section. */
    --pf-hero:  clamp(44px, 11.2vw, 160px);
    --pf-stat:  clamp(58px, 6.3vw, 90px);
    --pf-state: clamp(34px, 5.8vw, 84px);
    --pf-h2:    clamp(34px, 5vw, 72px);
    --pf-h3:    clamp(26px, 3.3vw, 48px);
    --pf-quote: clamp(28px, 2.8vw, 40px);
    --pf-l:     clamp(19px, 1.7vw, 24px);
    --pf-m:     clamp(16px, 1.4vw, 20px);
    --pf-s:     16px;

    --pf-wrap:   1440px;
    --pf-gutter: clamp(16px, 2.8vw, 40px);
    --pf-space:  clamp(80px, 8.3vw, 120px);
    --pf-radius: 16px;
    --pf-radius-sm: 8px;

    background: var(--pf-ink);
    color: var(--pf-paper);
    font-family: var(--font-pf);
    font-weight: 600;
    letter-spacing: -0.03em;
}

/* Every section sets its own pair; descendants read --bg/--text/--line. */
.is-dark {
    --bg: var(--pf-ink);
    --text: var(--pf-mist);
    --text-dim: color-mix(in srgb, var(--pf-mist) 62%, transparent);
    --line: color-mix(in srgb, var(--pf-mist) 24%, transparent);
    --btn-bg: var(--pf-paper);
    --btn-text: var(--pf-ink);
    background: var(--bg);
    color: var(--text);
}
.is-light {
    --bg: var(--pf-paper);
    --text: var(--pf-ink);
    --text-dim: var(--pf-grey);
    --line: color-mix(in srgb, var(--pf-ink) 22%, transparent);
    --btn-bg: var(--pf-ink);
    --btn-text: var(--pf-paper);
    background: var(--bg);
    color: var(--text);
}

.theme-portfolio :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* Solid buttons and the pressed chip have the section background as their text
   colour, so a currentColor outline vanished; use the section's text colour. */
.pf-btn:focus-visible, .pf-filter [aria-pressed="true"]:focus-visible { outline-color: var(--text); }
.theme-portfolio [id] { scroll-margin-top: 72px; }

.pf-wrap {
    width: 100%;
    max-width: var(--pf-wrap);
    margin: 0 auto;
    padding: 0 var(--pf-gutter);
}
.pf-section { padding: calc(var(--pf-space) / 2) 0 var(--pf-space); }

/* Section header row: number · ( name ) · year over a hairline. */
.pf-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: clamp(40px, 4.4vw, 64px);
    border-bottom: 1px solid var(--line);
    font-size: var(--pf-s);
    line-height: 1;
}
.pf-head :last-child { text-align: right; }

.pf-h2 {
    margin: 0;
    text-wrap: balance;
    font-size: var(--pf-h2);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.03em;
}
.pf-lead {
    margin: 20px 0 0;
    max-width: 640px;
    font-size: var(--pf-m);
    line-height: 1.35;
    color: var(--text-dim);
}

/* Buttons: solid (current section's contrast colour) and ghost. */
.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    padding: 12px 28px;
    border-radius: 0;
    border: 1px solid var(--btn-bg);
    background: var(--btn-bg);
    color: var(--btn-text);
    font: inherit;
    font-size: var(--pf-m);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.pf-btn--ghost { background: transparent; color: var(--text); border-color: var(--text); }
.pf-btn .pf-arrow { transition: transform 0.25s ease; }
.pf-btn:hover .pf-arrow { transform: translateX(6px); }
.pf-arrow { display: inline-block; width: 1.2em; text-align: center; }

/* --- Header --------------------------------------------------------------- */

.pf-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    color: var(--pf-paper);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}
/* Over the hero a soft black fade from the top keeps the links readable on the
   bright parts of the photo (forehead, glare); below the hero the solid veil
   takes over and the fade goes. */
.pf-header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 140px;
    z-index: -1;
    background: linear-gradient(color-mix(in srgb, var(--pf-ink) 72%, transparent), color-mix(in srgb, var(--pf-ink) 30%, transparent) 55%, transparent);
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.pf-header.is-solid::before { opacity: 0; }
/* Below the hero, a veil keeps links readable over both dark and light sections. */
.pf-header.is-solid {
    background: var(--pf-veil);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.pf-header__in {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}
.pf-logo {
    flex: 0 0 auto;
    font-size: clamp(18px, 1.7vw, 24px);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
/* Only for visitors who came from the course site (portfolio.js). */
.pf-back {
    flex: 0 0 auto;
    font-size: var(--pf-s);
    color: color-mix(in srgb, var(--pf-paper) 72%, transparent);
    text-decoration: none;
    white-space: nowrap;
}
.pf-back[hidden] { display: none; }
.pf-back:hover { color: inherit; }
.pf-nav { display: flex; gap: 28px; margin: 0 auto; }
.pf-nav a, .pf-header__cta {
    position: relative;
    font-size: var(--pf-s);
    color: inherit;
    text-decoration: none;
}
.pf-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.pf-nav a:hover::after { transform: scaleX(1); }
.pf-header__cta { margin-left: auto; }
/* Phones: "Меню" + a three-line burger that turns into a cross; the items drop
   down under the bar inside the header (not a full-screen sheet). */
.pf-menu-btn {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 10px 0 10px 16px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: var(--pf-s);
    cursor: pointer;
}
.pf-burger { position: relative; width: 20px; height: 14px; }
.pf-burger i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease;
}
.pf-burger i:nth-child(1) { top: 0; }
.pf-burger i:nth-child(2) { top: 6.25px; }
.pf-burger i:nth-child(3) { top: 12.5px; }
.pf-menu-btn[aria-expanded="true"] .pf-burger i:nth-child(1) { transform: translateY(6.25px) rotate(45deg); }
.pf-menu-btn[aria-expanded="true"] .pf-burger i:nth-child(2) { opacity: 0; }
.pf-menu-btn[aria-expanded="true"] .pf-burger i:nth-child(3) { transform: translateY(-6.25px) rotate(-45deg); }

/* Open menu: the header turns solid so the panel reads over any section. */
.pf-header.is-open { background: var(--pf-night); }
.pf-header.is-open::before { opacity: 0; }
.pf-menu { padding: 4px 0 24px; animation: pf-drop 0.25s ease; }
.pf-menu[hidden] { display: none; }
@keyframes pf-drop { from { opacity: 0; transform: translateY(-8px); } }
.pf-menu nav { display: flex; flex-direction: column; }
.pf-menu nav a {
    padding: 14px 0;
    border-top: 1px solid color-mix(in srgb, var(--pf-paper) 14%, transparent);
    font-size: 20px;
    line-height: 1.1;
    color: inherit;
    text-decoration: none;
}
.pf-menu__foot {
    display: flex;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--pf-paper) 14%, transparent);
}
.pf-menu__foot a { color: color-mix(in srgb, var(--pf-paper) 62%, transparent); text-decoration: none; font-size: 14px; letter-spacing: -0.01em; }

@media (max-width: 860px) {
    .pf-nav, .pf-header__cta { display: none; }
    .pf-menu-btn { display: inline-flex; }
    /* Logo + «← До курсів» + «Меню» fit 360 px only with the narrower gaps. */
    .pf-header__in { gap: 16px; }
}
@media (min-width: 861px) { .pf-menu { display: none; } }
@media (prefers-reduced-motion: reduce) { .pf-menu { animation: none; } .pf-burger i { transition: none; } }

/* --- 1. Hero -------------------------------------------------------------- */

.pf-hero {
    position: relative;
    height: min(100svh, 960px);
    min-height: 600px;
    overflow: hidden;
    color: var(--pf-paper);
    background: var(--pf-ink);
}
.pf-hero__photo {
    position: absolute;
    top: 0;
    left: 50%;
    /* Desktop framing: the photo (1069×1471) is as wide as the screen but no wider
       than 1.829 × the hero height (the 1280:700 proportion the hero is laid out
       for); wider, the face would outgrow the hero and sit under the headline. It is
       shown from 27 % of its height down, so the top of the head and the forehead
       stay in frame (the header's dark fade sits over the forehead), and clamped so
       it never leaves a gap at the bottom. 1.376 = photo height / width; 0.372 = 27 % of it. */
    --hero-h: clamp(600px, 100svh, 960px);
    --pw: min(100vw, calc(var(--hero-h) * 1.829));
    width: var(--pw);
    height: 100%;
    transform: translateX(-50%);
    object-fit: cover;
    object-position: 50% clamp(calc(var(--hero-h) - 1.376 * var(--pw)), calc(-0.372 * var(--pw)), 0px);
}
/* Where the photo is narrower than the screen, its edges fade into the dark hero
   (the photo's own sides are the dark night window): a screen wider than 1.829 ×
   its height, or a tall one where the hero stops at 960 px (photo 1756 px wide). */
@media (min-width: 861px) and (min-aspect-ratio: 1829/1000), (min-width: 1757px) and (min-height: 961px) {
    .pf-hero__photo {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
        mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    }
}
/* Bottom fade so the headline stays readable over the light parts of the photo. */
.pf-hero::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(transparent, var(--pf-shade) 55%, var(--pf-ink));
}
.pf-hero__in {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr minmax(0, 340px);
    grid-template-rows: 1fr auto auto;
    padding-top: 120px;
    padding-bottom: clamp(16px, 2vw, 28px);
}
.pf-hero__list {
    /* On short laptop screens the text lands on the window glare or the white
       shirt; a soft shadow keeps it legible without a visible box. */
    text-shadow: 0 1px 14px var(--pf-shade), 0 0 2px var(--pf-shade);
    margin: 0; padding: 0; list-style: none;
    align-self: center;
    font-size: var(--pf-m);
    line-height: 1.05;
}
.pf-hero__tag {
    text-shadow: 0 1px 14px var(--pf-shade), 0 0 2px var(--pf-shade);
    margin: 0;
    align-self: center;
    font-size: var(--pf-m);
    line-height: 1.15;
}
.pf-hero__title {
    grid-column: 1 / -1;
    margin: 0;
    font-size: var(--pf-hero);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.pf-hero__name {
    grid-column: 1 / -1;
    justify-self: end;
    margin: 0.06em 0 0;
    font-size: var(--pf-hero);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    mix-blend-mode: difference;
}

@media (max-width: 860px) {
    .pf-hero { height: 100svh; min-height: 640px; max-height: 920px; }
    /* The photo fits the screen height here, so moving it can't crop the empty
       dark top; it is made 12 % taller and pinned to the bottom instead — the top
       strip goes off-screen and the face sits closer to the header. */
    .pf-hero__photo { top: auto; bottom: 0; left: 0; width: 100%; height: 112%; transform: none; object-position: 58% 100%; }
    /* Text sits over the light shirt on phones: a longer, darker fade keeps it legible. */
    .pf-hero::after { inset: 30% 0 0; background: linear-gradient(transparent, var(--pf-shade) 30%, var(--pf-ink) 85%); }
    .pf-hero__in {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr auto auto auto;
        row-gap: 18px;
        padding-top: 84px;
    }
    .pf-hero__list { grid-column: 2; grid-row: 2; text-align: right; align-self: end; }
    .pf-hero__tag { grid-column: 1 / -1; grid-row: 3; max-width: 30ch; }
    /* The big type is the point of the hero: on phones «INSTAGRAM» spans ~3/4 of
       the width (13.6vw). */
    .pf-hero__title { grid-row: 4; font-size: 13.6vw; }
    /* «ЯНА» tucks in under the end of «DESIGNER» (4.7em wide in Inter Display at
       this size), with no gap: DESIGNER 4.7em + ЯНА 2em fits the width down to 360 px. */
    .pf-hero__name { grid-row: 5; font-size: 13.6vw; justify-self: start; margin: -14px 0 0 4.7em; }
}

/* --- 2. About ------------------------------------------------------------- */

.pf-statement {
    margin: 0;
    max-width: 24ch;
    font-size: var(--pf-state);
    text-wrap: balance;
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.03em;
}
.pf-about__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px 40px;
    margin-top: clamp(48px, 5vw, 80px);
}
.pf-about__photo {
    width: 210px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--pf-radius-sm);
}
.pf-about__row p {
    margin: 0;
    font-size: var(--pf-l);
    line-height: 1.25;
}

@media (max-width: 860px) {
    .pf-about__row { grid-template-columns: 1fr; }
    .pf-about__photo { width: 160px; }
}

/* --- 3. Cases ------------------------------------------------------------- */

/* Every card has the same height, width follows its shape
   (square 37.5 %, tall 4:5 29.4 %, wide 16:10 59 %), so rows form by themselves —
   square + tall, a centred wide, tall + square, a centred wide. The wide card's
   side margins fill its row, so the next card always starts a new one. */
.pf-cases {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    row-gap: clamp(36px, 6vw, 96px);
}
.pf-case--square { width: 37.5%; }
.pf-case--tall   { width: 29.4%; }
.pf-case--wide   { width: 59%; margin-inline: 20.5%; }

.pf-case { display: block; color: inherit; text-decoration: none; }
.pf-case__media {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--pf-radius);
    background: color-mix(in srgb, var(--text) 8%, transparent);
}
/* A hairline along the rounded edge: a cover with a near-black background
   melted into the black section and looked square. */
.pf-case__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 16%, transparent);
    pointer-events: none;
}
.pf-case__media img {
    width: 100%;
    height: auto;
    /* The image is rounded itself: Chrome left some covers square inside the
       rounded overflow clip. Not clip-path on the box: lazy images inside a
       clip-path never load. */
    border-radius: inherit;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}
.pf-case--square .pf-case__media img { aspect-ratio: 1; }
.pf-case--wide .pf-case__media img { aspect-ratio: 16 / 10; }
.pf-more .pf-case__media img { aspect-ratio: 4 / 3; }
.pf-case:hover .pf-case__media img { transform: scale(1.06); }
.pf-case__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-top: 16px;
    font-size: var(--pf-l);
    line-height: 1.1;
}
.pf-case__kind { text-transform: uppercase; }
/* margin-left: auto keeps "for whom" at the right edge even when it wraps under
   the work type on a narrow card. */
.pf-case__niche { margin-left: auto; color: var(--text-dim); text-align: right; }

@media (max-width: 860px) {
    /* Phones and tablets: no empty space between cards — a pair fills the row
       edge to edge (each grows by its aspect ratio, so both get one height) and a
       wide card takes the full width. Same order of rows as on desktop. */
    .pf-cases { column-gap: 12px; row-gap: 28px; }
    .pf-case--square { width: auto; flex: 1 1 0; }
    .pf-case--tall   { width: auto; flex: 0.8 1 0; }
    .pf-case--wide   { width: 100%; flex: 0 0 100%; margin-inline: 0; }
    .pf-cases .pf-case__meta { gap: 4px 8px; margin-top: 10px; }
    .pf-cases .pf-case__kind { font-size: 14px; letter-spacing: -0.01em; }
    .pf-cases .pf-case__niche { font-size: 13px; letter-spacing: -0.01em; }
}
/* Pair cards are too narrow for type + for whom on one line at any width (a tall
   card is 400 px at 1440, «ВІЗУАЛЬНА КОНЦЕПЦІЯ» alone needs ~300): both cards of a
   pair stack the two parts on the left; wide cards keep one line, type left, for
   whom right. */
.pf-cases .pf-case--square .pf-case__meta,
.pf-cases .pf-case--tall .pf-case__meta { flex-direction: column; align-items: flex-start; gap: 4px; }
.pf-cases .pf-case--square .pf-case__niche,
.pf-cases .pf-case--tall .pf-case__niche { margin-left: 0; text-align: left; }

/* --- 4. All works --------------------------------------------------------- */

.pf-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}
.pf-filter button {
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: var(--pf-s);
    cursor: pointer;
}
.pf-filter button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }

.pf-works {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.pf-work {
    display: block;
    padding: 0;
    border: 0;
    border-radius: var(--pf-radius);
    overflow: hidden;
    background: color-mix(in srgb, var(--text) 8%, transparent);
    cursor: zoom-in;
}
.pf-work[hidden] { display: none; }
.pf-work img {
    width: 100%;
    border-radius: inherit;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}
.pf-work:hover img { transform: scale(1.04); }

@media (min-width: 1100px) { .pf-works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.pf-works__more { display: flex; margin: 32px auto 0; min-width: 280px; }
.pf-works__more[hidden] { display: none; }
/* Only the first rows until "show more" (portfolio.js: 9 at three columns,
   8 at two, 3 on phones). */
.pf-works:not(.is-all) .pf-work.is-extra { display: none; }

/* Phones (the deck breakpoint of site.js, 720 px): one column as a deck — each
   work sticks a little below the previous one, a covered one shrinks and darkens
   (--p, --i from site.js) — and only the first three until "show more". */
@media (max-width: 720px) {
    .pf-works { grid-template-columns: 1fr; gap: 14px; }
    .pf-works__more { width: 100%; margin-top: 24px; }
    .pf-js .pf-works.is-scroll-driven .pf-work {
        position: sticky;
        /* Peeks stop growing after four cards: with all works shown the stack
           otherwise built a band of dark stripes above the last one. */
        top: calc(78px + min(var(--i, 0), 4) * 10px);
        transform: scale(calc(1 - var(--p, 0) * 0.08));
        transform-origin: 50% 0;
        filter: brightness(calc(1 - var(--p, 0) * 0.45));
        /* The reveal's slow transform transition would make the deck lag behind the finger. */
        transition: opacity 0.8s ease;
    }
}

/* Four filter chips fit one row on a phone. */
@media (max-width: 480px) {
    .pf-filter { flex-wrap: nowrap; gap: 6px; }
    .pf-filter button { flex: 1 1 auto; min-height: 40px; padding: 8px 10px; font-size: 14px; }
}

/* --- 5. Services ---------------------------------------------------------- */

.pf-services { margin-top: clamp(40px, 4.4vw, 64px); border-top: 1px solid var(--line); }

/* Each service is a <details>: the row is its summary, the details open below it
   in the same section. Each opens on its own: closing one above while opening
   another shifted the page under the reader. */
.pf-service { border-bottom: 1px solid var(--line); }
.pf-service__row {
    display: grid;
    grid-template-columns: 120px 210px minmax(0, 1fr) minmax(0, 320px);
    gap: 24px 40px;
    align-items: start;
    padding: 32px 0;
    list-style: none;
    cursor: pointer;
}
.pf-service__row::-webkit-details-marker { display: none; }
.pf-service__no { font-size: var(--pf-h3); line-height: 1; }
.pf-service__img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--pf-radius-sm);
}
.pf-service__title { margin: 0; font-size: var(--pf-h3); font-weight: 600; line-height: 1; }
.pf-service__side { display: flex; flex-direction: column; gap: 18px; }
.pf-service__text { margin: 0; font-size: var(--pf-m); line-height: 1.35; color: var(--text-dim); }
.pf-service__price { font-size: var(--pf-l); line-height: 1; }
.pf-service__more { display: inline-flex; align-items: center; gap: 10px; font-size: var(--pf-s); }
/* Only the words are underlined: on the arrow the underline turned with it and
   showed as a stray vertical bar next to "Згорнути". */
.pf-service__open, .pf-service__close { text-decoration: underline; text-underline-offset: 4px; }
.pf-service__more .pf-arrow { transition: transform 0.3s ease; }
.pf-service__close { display: none; }
.pf-service[open] .pf-service__open { display: none; }
.pf-service[open] .pf-service__close { display: inline; }
.pf-service__more .pf-arrow { transform: rotate(90deg); }
.pf-service[open] .pf-service__more .pf-arrow { transform: rotate(-90deg); }
.pf-service:not([open]) .pf-service__row:hover .pf-arrow { transform: translateY(4px) rotate(90deg); }

/* Smooth open where supported (Chrome 131+); elsewhere it opens instantly. */
.pf-service::details-content {
    block-size: 0;
    /* clip, not hidden: hidden makes a scroll container and the sticky terms
       column inside would stop sticking. */
    overflow: clip;
    transition: block-size 0.5s cubic-bezier(.2, .7, .2, 1), content-visibility 0.5s allow-discrete;
}
.pf-service[open]::details-content { block-size: auto; }
.theme-portfolio { interpolate-size: allow-keywords; }

/* Details use the row's columns: the terms and the Telegram button continue the
   right column under the price (sticky while the details are read); the details
   take the rest of the width, from the number on. */
.pf-svc {
    display: grid;
    grid-template-columns: 120px 210px minmax(0, 1fr) minmax(0, 320px);
    column-gap: 40px;
    padding: 0 0 56px;
}
.pf-svc__main { grid-column: 1 / 4; grid-row: 1; display: flex; flex-direction: column; }
.pf-svc__aside {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 6px;
}
.pf-svc__terms { padding-top: 22px; }
/* Quieter than the terms: a remark about the price, set off by a thin rule. */
.pf-svc__note {
    margin: 0;
    padding-left: 14px;
    border-left: 1px solid var(--line);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--text-dim);
}
.pf-svc__intro {
    margin: 0;
    max-width: 62ch;
    font-size: var(--pf-l);
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.pf-svc__table { margin-top: 36px; overflow-x: auto; }
.pf-svc table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--pf-s);
    font-weight: 400;
    letter-spacing: -0.01em;
}
.pf-svc th {
    padding: 0 16px 12px 0;
    font-weight: 600;
    text-align: left;
    color: var(--text-dim);
    border-bottom: 1px solid var(--line);
}
.pf-svc td {
    padding: 14px 16px 14px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.35;
}
.pf-svc td:first-child { color: var(--text-dim); }
.pf-svc td:not(:first-child), .pf-svc th:not(:first-child) { white-space: nowrap; }
.pf-svc__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 40px;
    margin-top: 36px;
}
.pf-svc__block { padding: 22px 0 6px; border-top: 1px solid var(--line); }
.pf-svc__block--wide { grid-column: 1 / -1; }
/* Base / Max examples side by side at one height: columns in the grids' own ratios
   (Base 1179:1572 = 0.75, Max 1200:1495 = 0.803), so posts come out the same size
   in both and the captions line up, with nothing cropped. */
.pf-examples { display: grid; grid-template-columns: minmax(0, 750fr) minmax(0, 803fr); gap: 16px; align-items: start; margin: 20px 0 10px; max-width: 760px; }
.pf-examples figure { margin: 0; }
.pf-examples img { width: 100%; height: auto; border-radius: var(--pf-radius-sm); }
.pf-examples figcaption { margin-top: 8px; font-size: var(--pf-s); color: var(--text-dim); }
.pf-svc h4 {
    margin: 0 0 14px;
    font-size: var(--pf-s);
    font-weight: 600;
    color: var(--text-dim);
}
.pf-svc h4::before { content: "( "; }
.pf-svc h4::after { content: " )"; }
.pf-svc ul { margin: 0; padding: 0; list-style: none; }
.pf-svc li, .pf-svc__block p {
    font-size: var(--pf-s);
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: -0.01em;
}
.pf-svc li { position: relative; padding-left: 20px; }
.pf-svc li + li { margin-top: 6px; }
.pf-svc li::before { content: "—"; position: absolute; left: 0; color: var(--text-dim); }
.pf-svc__block p { margin: 0 0 12px; }
.pf-svc__block ul + p { margin-top: 12px; }
.pf-svc__cta { align-self: flex-start; }

@media (max-width: 960px) {
    .pf-service__row { grid-template-columns: 64px minmax(0, 1fr); }
    /* The whole cover in its own 4:5, as on desktop: a wider cut loses the top
       and bottom of the design. */
    .pf-service__img { grid-column: 1 / -1; grid-row: 2; }
    .pf-service__title { grid-column: 2; grid-row: 1; align-self: center; }
    .pf-service__side { grid-column: 1 / -1; }
    .pf-svc { grid-template-columns: 1fr; padding-bottom: 40px; }
    .pf-svc__main { grid-column: 1; grid-row: 1; }
    /* Phones: terms and the button come after the details. */
    .pf-svc__aside { grid-column: 1; grid-row: 2; position: static; margin-top: 28px; }
    .pf-svc__grid { grid-template-columns: 1fr; }
    .pf-svc td:not(:first-child), .pf-svc th:not(:first-child) { white-space: normal; }
    /* The row label gets almost half the width; the values are short. */
    .pf-svc table { table-layout: fixed; }
    .pf-svc th:first-child, .pf-svc td:first-child { width: 34%; }
    /* 14 px: «нестандартний» fits its column on a 360–390 px phone instead of
       being cut mid-word (Chrome doesn't hyphenate Ukrainian). */
    .pf-svc table { font-size: 14px; }
    .pf-svc th, .pf-svc td { padding-right: 8px; hyphens: auto; overflow-wrap: break-word; }
}

/* --- 6. Process ----------------------------------------------------------- */

.pf-process { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr); gap: 40px; }
.pf-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pf-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 28px;
    gap: 16px 40px;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}
.pf-step__title { margin: 0; font-size: var(--pf-l); font-weight: 600; line-height: 1.1; }
.pf-step__title span { margin-right: 10px; }
.pf-step p { margin: 0; font-size: var(--pf-s); line-height: 1.45; color: var(--text-dim); letter-spacing: -0.01em; }
.pf-step__dash { align-self: center; height: 1px; background: currentColor; }

@media (max-width: 860px) {
    .pf-process { grid-template-columns: 1fr; }
    .pf-step { grid-template-columns: 1fr; }
    .pf-step__dash { display: none; }
}

/* --- 7. Reviews ----------------------------------------------------------- */

/* The chat screenshots were taken at different zoom levels (text line spacing
   38–80 px), so scaling them by width made short ones huge. --rw is each
   screenshot's width at which its text lines are 28 px apart: all reviews read
   at the same text size. */
.pf-reviews { --rk: 0.8; }
.pf-reviews .strip { gap: 20px; align-items: flex-start; }
.pf-reviews .strip img {
    flex: 0 0 auto;
    width: min(calc(var(--rw) * var(--rk) * 1px), 86vw);
    height: auto;
    aspect-ratio: auto;
    border-radius: 0;
    object-fit: contain;
}

/* Phones: the widest review just fits (572 x 0.58 = 332 px), so none hits the
   86vw cap and the text stays the same size across all of them. */
@media (max-width: 640px) { .pf-reviews { --rk: 0.58; } }

/* --- 8. Facts ------------------------------------------------------------- */

.pf-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; }
.pf-fact__num {
    display: block;
    font-size: var(--pf-stat);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.06em;
    font-variant-numeric: tabular-nums;
}
.pf-fact__label { display: block; margin-top: 18px; font-size: var(--pf-l); line-height: 1.1; }
.pf-fact p { margin: 10px 0 0; max-width: 320px; font-size: var(--pf-s); line-height: 1.4; color: var(--text-dim); letter-spacing: -0.01em; }

@media (max-width: 960px) { .pf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pf-facts { grid-template-columns: 1fr; } }

/* --- 9. Call to action ---------------------------------------------------- */

.pf-cta { text-align: center; }
.pf-cta__title {
    margin: 0 auto;
    max-width: 22ch;
    text-wrap: balance;
    font-size: var(--pf-h2);
    font-weight: 600;
    line-height: 0.95;
    text-transform: uppercase;
}
.pf-cta .pf-btn { margin-top: 40px; }

/* --- Footer --------------------------------------------------------------- */

.pf-footer { padding: 40px 0; }
.pf-footer__in {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 32px 40px;
    align-items: end;
}
/* Two lines, so the name can be larger and fill the column's height. */
.pf-footer__name { margin: 0; font-size: clamp(48px, 7.4vw, 108px); font-weight: 600; line-height: 0.9; letter-spacing: -0.04em; }
.pf-footer__links { display: flex; flex-direction: column; gap: 6px; font-size: var(--pf-s); }
/* Phones: links big enough to hit with a thumb (≥ 40 px). */
@media (max-width: 860px) {
    .pf-footer__links { gap: 0; }
    .pf-footer__links a, .pf-footer [data-top], .pf-head a, .pf-menu__foot a { display: inline-block; padding: 10px 0; }
    /* The head row aligns to the bottom edge: without this the padded link sits 10 px above its neighbours. */
    .pf-head a { margin: -10px 0; }
    .pf-logo { padding: 10px 0; }
}
.pf-footer a { color: inherit; text-decoration: none; }
.pf-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pf-footer__copy { margin: 24px 0 0; font-size: var(--pf-s); color: var(--text-dim); }
/* In the dim copyright line the link needs its underline to read as a link; it
   wraps as a whole, not mid-phrase, on phones. */
.pf-footer__copy a { white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pf-footer__copy a:hover { color: var(--text); }

@media (max-width: 860px) { .pf-footer__in { grid-template-columns: 1fr; align-items: start; } }

/* --- Case page ------------------------------------------------------------ */

.pf-casehead { padding-top: 140px; }
.pf-casehead__title {
    margin: 0;
    font-size: var(--pf-h2);
    font-weight: 600;
    line-height: 0.95;
    text-transform: uppercase;
}
.pf-casehead__info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 24px 40px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: var(--pf-l);
    line-height: 1.25;
}
.pf-casehead__info dt { color: var(--text-dim); font-size: var(--pf-s); margin-bottom: 6px; }
.pf-casehead__info dd { margin: 0; }
.pf-slides { display: flex; flex-direction: column; gap: clamp(12px, 1.4vw, 20px); padding-top: 40px; }
.pf-slides img { width: 100%; border-radius: var(--pf-radius); }
.pf-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

@media (max-width: 860px) {
    .pf-casehead { padding-top: 100px; }
    .pf-casehead__info { grid-template-columns: 1fr; }
    .pf-more { grid-template-columns: 1fr; }
    .pf-slides img { border-radius: var(--pf-radius-sm); }
}

/* --- Viewer (all works) --------------------------------------------------- */

.pf-viewer {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--pf-ink);
    color: var(--pf-paper);
}
.pf-viewer::backdrop { background: var(--pf-ink); }
/* pan-y lets a horizontal swipe reach the script (otherwise the browser claimed
   it as a pan and cancelled the pointer); pinch zoom stays. */
.pf-viewer { touch-action: pan-y pinch-zoom; overscroll-behavior: contain; }
/* The page behind the open viewer must not scroll. */
html:has(.pf-viewer[open]) { overflow: hidden; }
.pf-viewer__img {
    position: absolute;
    inset: 64px var(--pf-gutter) 72px;
    width: calc(100% - 2 * var(--pf-gutter));
    height: calc(100% - 136px);
    object-fit: contain;
}
.pf-viewer__bar {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px;
}
.pf-viewer button {
    min-width: 52px;
    height: 52px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, var(--pf-paper) 40%, transparent);
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: var(--pf-s);
    cursor: pointer;
}
.pf-viewer__close { position: absolute; top: 8px; right: var(--pf-gutter); }
.pf-viewer__count { align-self: center; min-width: 64px; text-align: center; font-size: var(--pf-s); }

/* --- Reveal --------------------------------------------------------------- */

/* The one signature motion: cards rise and settle as they enter the viewport.
   Hidden only once portfolio.js has marked the page (no JS → everything shows). */
.pf-js .pf-reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1);
}
.pf-js .pf-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .pf-js .pf-reveal { opacity: 1; transform: none; transition: none; }
    .pf-case__media img, .pf-work img, .pf-btn .pf-arrow, .pf-service__more .pf-arrow { transition: none; }
    .pf-service::details-content { transition: none; }
}
@media print { .pf-js .pf-reveal { opacity: 1; transform: none; } }
