/* ---------- Fonts ---------- */
@font-face {
  font-family: "Gart Serif";
  src: url("/fonts/GartSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gart Serif";
  src: url("/fonts/GartSerif-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gart Serif";
  src: url("/fonts/GartSerif-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* The grotesque is set in Light. The file is the TRIAL build of Gart Sans Light: Cyrillic,
   basic Latin, digits and punctuation only (no $ @ % © № · arrows, no accented Latin). */
@font-face {
  font-family: "Gart Sans";
  src: url("/fonts/GartSansTrial-Light.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Regular (the full font) stays for two things: as the heavier face that bold text is made
   from, and — under a second name, next in the --sans stack — for the glyphs Light lacks. */
@font-face {
  font-family: "Gart Sans";
  src: url("/fonts/GartSans-Regular.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gart Sans Full";
  src: url("/fonts/GartSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (mirror the Figma variables) ---------- */
:root {
  --black: #000;
  --white: #fff;
  --red: #e80000;
  --grey: #ebeaea;
  --grey-dark: #d6d5d5;
  --muted: #707070;
  --rule: #808080;

  --serif: "Gart Serif", "Times New Roman", Times, serif;
  --sans: "Gart Sans", "Gart Sans Full", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad: 30px;
  --gutter: 12px;   /* the one horizontal gap between neighbouring blocks: cards, photo and «Топ» */
  --radius: 12px;   /* panels and large images */
  --radius-s: 6px;  /* chips, small thumbnails and images nested inside a panel */

  --fs-display-l: clamp(38px, 16px + 3.4vw, 64px);
  --fs-display: clamp(30px, 14px + 2.2vw, 44px);
  --fs-title: clamp(19px, 12px + 0.7vw, 22px); /* material titles on cards */
  --fs-body: clamp(18px, 14px + 0.56vw, 22px);
  --fs-meta: clamp(15px, 13px + 0.35vw, 18px);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

/* Gart Serif and Gart Sans have no italic files, so nothing on the site is italic: the browser
   may not slant (or embolden) the upright faces itself, and the tags that are italic by default
   are set upright, which also keeps the fallback fonts from bringing their own italics. */
html { font-synthesis: none; }
em, i, cite, dfn, var, address { font-style: normal; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.04;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; font-weight: 400; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.skip {
  position: absolute;
  left: var(--pad);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--black);
  color: var(--white);
}
.skip:focus { top: 10px; }

.page { max-width: 1680px; margin: 0 auto; }

/* ---------- Type styles (mirror the Figma text styles) ---------- */
.display-l {
  font-family: var(--serif);
  font-size: var(--fs-display-l);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.display {
  font-family: var(--serif);
  font-size: var(--fs-display);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
}
.body { font-family: var(--sans); font-size: var(--fs-body); line-height: 1.04; letter-spacing: 0; }
.ui { font-family: var(--sans); font-size: var(--fs-body); line-height: 1; letter-spacing: 0; }
.meta { font-family: var(--sans); font-size: var(--fs-meta); line-height: 1.1; letter-spacing: 0; color: var(--muted); }

/* ---------- Shared pieces ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 0;
  border-radius: 43px;
  font-size: var(--fs-body);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn--red { background: var(--red); color: var(--white); }
.btn--black { background: var(--black); color: var(--white); }
.btn--white { background: var(--white); color: var(--red); }
.btn--line { box-shadow: inset 0 0 0 1px var(--black); }
/* Red outline that fills with red on hover («Підтримати Теку» on «Про нас») */
.btn--red-line { box-shadow: inset 0 0 0 1px var(--red); color: var(--red); transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease; }
.btn--red-line:hover { background: var(--red); color: var(--white); opacity: 1; }
.btn--small { padding: 8px 16px; font-size: var(--fs-meta); }
.btn[aria-disabled="true"] { opacity: 0.35; cursor: default; pointer-events: none; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

/* Small label: who or what a material is about, «Приклад», etc. */
.chip {
  display: inline-flex;
  padding: 4px 8px 5px;
  border-radius: var(--radius-s);
  background: var(--white);
  color: var(--black);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.chip--line { background: none; box-shadow: inset 0 0 0 1px var(--black); }
/* Grey chips on white: a material's date, rubric, author and views, always in a .chips row */
.chip--grey { background: var(--grey); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
a.chip { transition: color 0.15s ease; }

.stack { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }

/* One rule for «selected» across the site: red. Hover uses the same red (see the hover block). */
.nav a,
.filters a,
.link,
.footer__col a,
.footer__bottom a,
.card__title,
.story__title,
.top-item__title,
.featured__title { transition: color 0.15s ease; }
.nav a[aria-current="page"],
.filters a[aria-current="page"],
.menu__nav a[aria-current="page"] { color: var(--red); }

/* ---------- Header ---------- */
/* Sticky bar. Once stuck it sits 7px above the viewport (top: -7px): that trims the
   25px top padding to 18px, so the row ends up vertically centred in the visible bar
   without anything moving at the top of the page. */
.header {
  --fs-nav: clamp(18px, 1.53vw, 22px);
  --bar-pt: 25px;
  --bar-ch: calc(var(--fs-nav) + 20px); /* height of the button row */
  position: sticky;
  top: -7px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--bar-pt) var(--pad) 18px;
}
/* Light blurred backdrop, shown only after the page has scrolled. It spans the whole window,
   not just the 1680px page column, so on wide screens the bar is not cut off at the sides
   (the few pixels it may reach past a classic scrollbar are clipped on <html>). */
.header::before {
  content: "";
  position: absolute;
  inset: 0 min(0px, calc(50% - 50vw)); /* never narrower than the bar itself */
  z-index: -1;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.header.is-stuck::before { opacity: 1; }

.nav {
  display: flex;
  gap: clamp(18px, 1.67vw, 24px);
  padding-top: 10px;
  font-size: var(--fs-nav);
  line-height: 1;
  white-space: nowrap;
}
.header .btn { font-size: var(--fs-nav); }

/* Logo: stacked «УКР / ТЕК / А» at the top of the page, hanging below the bar;
   one-line «Українська Тека» inside the bar once it is stuck. Both are SVG (src/logo.mjs, made
   by scripts/logo-svg.py), so they sit the same on every system; their sizes are in em of the
   font sizes below, as when they were text. */
.logo {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--serif);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.logo__stack,
.logo__line {
  pointer-events: auto;
  transition: opacity 0.2s ease, transform 0.25s ease, visibility 0.2s;
}
.logo__stack {
  display: block;
  padding-top: 17.5px;
  font-size: 40px;
  line-height: 31.7px;
}
.logo svg { display: block; overflow: visible; }
.logo__stack svg { width: 1.5727em; height: 2.3775em; } /* three lines of 0.7925em */
.logo__line svg { width: 6.486em; height: 1em; }
.logo__line {
  position: absolute;
  left: 50%;
  top: var(--bar-pt);
  display: flex;
  align-items: center;
  height: var(--bar-ch);
  transform: translate(-50%, 8px);
  font-size: clamp(27px, 2.36vw, 34px);
  line-height: 1;
  opacity: 0;
  visibility: hidden;
}
.header.is-stuck .logo__stack { opacity: 0; visibility: hidden; transform: translateY(-10px); }
/* -0.12em: Gart Serif sits low in its line box, so nudge it up to look centred next to the sans text */
.header.is-stuck .logo__line { opacity: 1; visibility: visible; transform: translate(-50%, -0.12em); }

.actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

/* ---------- Hero ---------- */
/* Three columns: the tagline panel and «Топ» run the full height of the block, the featured
   story sits between them — photo, then title and lead, then chips (a subgrid over the hero's
   three rows). Below 1041px everything goes into one column. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr) minmax(360px, 1fr);
  grid-template-rows: auto auto auto; /* photo | title and lead | chips */
  gap: 18px var(--gutter);
  padding: 72px var(--pad) 0; /* the logo hangs 28px below the header: this leaves 44px of air under it */
}

/* Tagline panel: «Українська тека — / інді-медіа про дизайн», a grey subtitle (site.json →
   home.subtitle) and «Про нас» at the bottom. The tagline's second line is 9.44em wide, so the
   size follows the panel's width (container units) and both lines fit; in a narrow panel it
   stops at 28px and the lines wrap instead. */
.intro {
  /* the same paddings as the «Топ» panel: 20px top, 26px sides, 18px bottom */
  --intro-px: 26px;
  grid-column: 1;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  container-type: inline-size;
  border-radius: var(--radius);
  background: var(--grey);
}
.intro__text { display: flex; flex-direction: column; gap: 24px; padding: 20px var(--intro-px) 0; }
.intro__tagline {
  font-family: var(--serif);
  font-size: clamp(28px, calc((100cqi - 2 * var(--intro-px)) / 9.7), 48px);
  line-height: 1;
  letter-spacing: -0.01em;
}
.intro__sub {
  font-size: clamp(16px, calc((100cqi - 2 * var(--intro-px)) / 16.25), 28.8px); /* 0.8 of the earlier 20–36px */
  line-height: 1.1;
  color: var(--muted);
  text-wrap: pretty;
}
/* Desktop (three columns): under the tagline, what the media is for (site.json → home.mission)
   in the size of the featured story's lead, instead of the subtitle; one column keeps the subtitle */
.intro__mission { display: none; font-size: var(--fs-meta); line-height: 1.2; letter-spacing: 0; color: var(--muted); text-wrap: pretty; }
@media (min-width: 1041px) {
  .intro__sub { display: none; }
  .intro__mission { display: block; }
}
/* «Про нас»: the size of «Уся стрічка» in «Топ» (btn--small), as an outline */
.intro__about { margin: 0 var(--intro-px) 18px; }

.featured { grid-column: 2; grid-row: 1 / span 3; display: grid; grid-template-rows: subgrid; }
/* photo, title and lead are one link (the first two rows); the chips sit under it, so the rubric chip can be a link too */
.featured__link { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; }
/* The ::before spacer sets the photo's height, and with it the height of the whole row of panels:
   1.62:1 as in the layout, but at least 420px and no more than the
   window minus 444px (header, title, lead, chips and a margin), so the whole block fits the first
   screen. (aspect-ratio on the box made it overflow the column on narrower desktops.) */
.featured__media { position: relative; min-width: 0; overflow: hidden; border-radius: var(--radius); background: var(--grey); }
.featured__media::before { content: ""; display: block; padding-top: max(240px, min(max(100% / 1.62, 420px), calc(100svh - 444px))); }
.featured__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.featured__text { display: flex; flex-direction: column; gap: 16px; }
.featured__lead { font-size: var(--fs-meta); line-height: 1.2; letter-spacing: 0; color: var(--muted); text-wrap: pretty; }
.featured__meta { margin-top: -4px; } /* a little closer to the lead than the grid gap */

/* The «Топ» column takes the block's height and never adds to it (contain: size): the photo,
   title and chips set the height. It shows as many whole items as fit; the rest wrap into a second, clipped column. */
.sidebar { grid-column: 3; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 18px; contain: size; min-height: 0; }
.sidebar .top { min-height: 0; }
.sidebar .top__list {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  column-gap: 200px;
  overflow: hidden;
}
.sidebar .top__list > li { width: 100%; }

/* «Топ»: titles with a chip, no pictures */
.top {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 26px 18px;
  border-radius: var(--radius);
  background: var(--grey);
}
.top > .link { margin-top: auto; }
.top__list { align-self: stretch; }
.top__list li + li { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--rule); }
.top-item { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.top-item__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(18px, 12px + 0.56vw, 20px);
  line-height: 1.08;
  letter-spacing: 0;
}
.top-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; } /* chips sit 3px apart, as in .chips */
.top-item__meta time { margin-left: 7px; }

/* ---------- Sections ---------- */
.section { display: flex; flex-direction: column; gap: 22px; padding: 64px var(--pad) 0; scroll-margin-top: 24px; }
.section--lead { padding-top: 56px; } /* the section right under the hero */
.section--first { padding-top: 40px; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
/* «Усі кейси», «Усі інтервʼю», «Усі статті» and «Уся стрічка» in «Топ»: the link that opens the
   whole list is a button, so it is a round pill like the other buttons (chips are labels and
   stay squarer) — grey on the page, white on the grey «Топ» panel */
.section__head .link,
.top > .link,
.pill { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 43px; background: var(--grey); font-size: var(--fs-meta); line-height: 1; white-space: nowrap; transition: color 0.15s ease; }
/* «Уся стрічка» in «Топ» and the «Усі …» buttons in section heads are black with white text,
   like «Подати проєкт» in the header. On hover they fade like the other filled buttons
   instead of turning their text red. */
.section__head .link,
.top > .link { background: var(--black); color: var(--white); transition: opacity 0.15s ease; }
.section__head .link:hover,
.top > .link:hover { color: var(--white); opacity: 0.85; }

/* Cards: small enough that eight fit on one screen */
.grid { display: grid; gap: 28px var(--gutter); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px var(--gutter); }

.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card__link { display: flex; flex-direction: column; gap: 12px; }
/* The frame crops the cover and clips its hover zoom */
.card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--grey); }
.card__image,
.story__media img,
.story__media video { width: 100%; height: 100%; object-fit: cover; }
/* No cover (materials that came from Instagram carousels): a grey tile with the rubric at the
   top and who or what the material is about in the serif at the bottom, like a vacancy's tile */
.tile { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; height: 100%; padding: 14px 16px 16px; container-type: inline-size; background: var(--grey); }
.tile__rubric { font-size: var(--fs-meta); line-height: 1; color: var(--muted); }
.tile__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-family: var(--serif); font-size: clamp(20px, 9cqi, 34px); line-height: 1.02; text-wrap: balance; padding-bottom: 0.14em; margin-bottom: -0.14em; /* room for the descenders the clamp would cut */ }
/* Video covers (see coverMedia in templates.mjs) sit exactly where an image would */
video[data-cover] { display: block; pointer-events: none; }
video.article__cover { object-fit: cover; }
/* Slight zoom of a cover when its link is hovered (enabled in the hover block below) */
.card__image,
.story__media img,
.story__media video,
.featured__image { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
/* Every material title is set in the serif, whatever the list */
.card__title { font-family: var(--serif); font-size: var(--fs-title); line-height: 1.06; letter-spacing: 0; text-wrap: pretty; }
/* In grids a title takes three lines at most, so two full rows of cards fit on one screen */
.grid .card__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
/* Clamped serif titles: the line box is shorter than the font (line-height ~1.06 against 1.2 of
   ascent + descent), so `overflow: hidden` cut the tails of «у», «р», «g» in the last line.
   A sliver of bottom padding shows them; the negative margin keeps the spacing as it was.
   Gart Serif's tails reach 0.18em below the baseline and the line box ends at 0.10em, so 0.08em
   is exactly enough; any more and the top of a cut-off next line (the breve of «Й») shows. */
.grid .card__title,
.top-item__title { padding-bottom: 0.08em; margin-bottom: -0.08em; }
/* Lead: one or two sentences under the title, on every card and row. It sits closer to
   its title than the title sits to the cover (hence the negative margin against the gap). */
.card__lead,
.story__lead { font-size: var(--fs-meta); line-height: 1.2; letter-spacing: 0; color: var(--muted); text-wrap: pretty; }
.card__lead { margin-top: -5px; }
.grid .card__lead { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.card__meta { margin-top: 2px; }
/* View count: eye icon + number */
.views { align-items: center; gap: 0.3em; }
.views[hidden] { display: none; }
.views__icon { flex: none; width: 1.05em; height: 1.05em; }

/* Listing pages */
.page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding: 68px var(--pad) 0; }
.page-head__lead { max-width: 620px; }
/* a long word («конфіденційності») may not fit a 320px phone: let it break with a hyphen */
.page-head h1 { max-width: 100%; overflow-wrap: break-word; hyphens: auto; }
/* «Стрічка»: a compact head — title and filters on one line — to leave the screen to the cards */
.page-head--feed { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px 30px; padding-top: 44px; }
.page-head--feed + .section--first { padding-top: 24px; }
/* Author's page: a grey panel with the name and a short bio before the materials —
   as wide as two of the cards under it, the bio under the name; the same air above and below it */
.page-head--feed + .author-bio { padding-top: 32px; }
.author-bio + .section { padding-top: 32px; }
.author-bio__panel { display: flex; flex-direction: column; gap: 16px; width: calc(50% - var(--gutter) / 2); padding: 20px 26px 22px; border-radius: var(--radius); background: var(--grey); }
.author-bio__name { text-wrap: balance; }
.author-bio__text { line-height: 1.15; }
/* Rubric filters, right-aligned next to the title; under them, when the list is narrowed
   to one author, a chip with the author's name that clears that choice */
.filters-group { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 26px; line-height: 1; }
.filters__n { margin-left: 2px; font-size: var(--fs-meta); color: var(--muted); }
/* An option with no materials in the current selection: visible, but not a link */
.filters__off { color: var(--muted); }
.filters__author { gap: 0.45em; }

/* Round arrow buttons (the interviews reel on the home page) */
.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--black);
  border-radius: 20px;
  background: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.arrow img { filter: brightness(0); }
.arrow:hover { background: var(--grey); }
/* White on a photo; on hover it fades like the other filled buttons */
.arrow--light { border-color: var(--white); background: var(--white); transition: opacity 0.15s ease; }
.arrow--light:hover { background: var(--white); opacity: 0.85; }

/* Interviews on the home page: a reel — one slide at a time that changes by itself, like stories.
   A slide is two halves: the portrait on the left, a grey
   panel with the name, the title, a short intro and «Читати далі» on the right; the arrows sit
   on the portrait. The slides are stacked
   and cross-fade. Over the portrait, a row of bars: past slides are filled, the current one fills
   up while it is on. main.js sets .is-active / .is-done and pauses the fill with .is-paused.
   Up to 860px wide the halves sit side by side; below that the quote goes under the portrait. */
.reel {
  --reel-time: 6s;
  --reel-photo: 52%; /* the portrait's share of the width */
  position: relative;
  /* 1.72:1 of the page width, but never taller than the window minus its heading (and never under
     440px). Set as a height, not aspect-ratio + max-height: with those two Safari narrows the reel
     to keep the ratio instead of only capping its height. */
  width: 100%;
  height: clamp(440px, calc((min(100vw, 1680px) - 2 * var(--pad)) / 1.72), max(440px, calc(100svh - 140px)));
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  border-radius: var(--radius);
  background: var(--grey);
  touch-action: pan-y; /* a sideways swipe changes the slide, the page still scrolls up and down */
}
.reel__slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--reel-photo) minmax(0, 1fr);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}
.reel__slide.is-active { z-index: 1; opacity: 1; visibility: visible; transition: opacity 0.5s ease, visibility 0s; }
.reel__slide:focus-visible { outline-offset: -5px; }
.reel__media { position: relative; min-height: 0; overflow: hidden; background: var(--grey-dark); }
/* a light shade at the bottom of the portrait, just enough for the white bars */
.reel__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 16%);
}
.reel__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
/* Square and portrait covers carry a face in the upper half and their own caption below it */
.reel__image--tall { object-position: 50% 38%; }
.reel__text { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 24px; min-width: 0; padding: 20px 26px 18px; } /* the paddings of the first screen's panels (.intro, .top) */
/* The panel: the name, the title without it, the intro in grey (the sizes of the page: a section
   heading, the first screen's display line, the meta line) and «Читати далі» at the bottom, an outline button like «Про нас» */
.reel__head { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.reel__who { font-family: var(--serif); font-size: calc(var(--fs-display) * 0.8); line-height: 1; letter-spacing: 0; }
.reel__title + .reel__intro { margin-top: 10px; } /* a little more air under the title than above it */
.reel__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-family: var(--serif);
  font-size: var(--fs-display-l);
  line-height: 0.86;
  letter-spacing: -0.01em;
  text-wrap: balance;
  padding-bottom: 0.2em; margin-bottom: -0.2em; /* room for the descenders the clamp would cut */
  transition: color 0.15s ease;
}
.reel__intro {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
  font-size: var(--fs-meta);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--muted);
  text-wrap: pretty;
}
/* The arrows sit on the portrait, at its left and right edges halfway down */
.reel__arrows { position: absolute; inset: 0 auto 0 0; z-index: 2; width: var(--reel-photo); display: flex; justify-content: space-between; align-items: center; padding: 0 16px; pointer-events: none; }
.reel__arrows .arrow { pointer-events: auto; }
/* Each bar is a button with a tall hit area around a thin track */
.reel__bars { position: absolute; inset: auto calc(100% - var(--reel-photo) + 24px) 8px 24px; z-index: 2; display: flex; gap: 6px; } /* over the portrait only */
.reel__bar { flex: 1 1 0; min-width: 0; padding: 10px 0; border: 0; background: none; cursor: pointer; }
.reel__bar span { display: block; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, 0.36); }
.reel__bar span::after { content: ""; display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: 0 50%; }
.reel__bar.is-done span::after { transform: scaleX(1); }
.reel__bar.is-active span::after { animation: reel-fill var(--reel-time) linear forwards; }
.reel.is-paused .reel__bar.is-active span::after { animation-play-state: paused; }
/* Reduced motion: nothing runs by itself, the current bar is simply full */
.reel--still .reel__bar.is-active span::after { animation: none; transform: scaleX(1); }
.reel__bar:focus-visible { outline-offset: -2px; outline-color: var(--white); }
@keyframes reel-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Rows: media-kit formats */
.rows li { border-top: 1px solid var(--black); }
.rows li:last-child { border-bottom: 1px solid var(--black); }

/* «Статті» on the home page: two stories to a row, split by thin grey lines
   like a magazine's contents (no rule under the heading). In a story the text column (title, lead, chips) sits
   left of the cover; the link spans both columns through a subgrid, the chips go under it. */
.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: auto 1fr;
  gap: 14px 20px;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--grey-dark);
}
.story:nth-child(odd) { padding-right: 24px; border-right: 1px solid var(--grey-dark); }
.story:nth-child(even) { padding-left: 24px; }
.story:last-child,
.story:nth-child(odd):nth-last-child(-n + 2) { border-bottom: 0; }
.story:nth-child(-n + 2) { padding-top: 0; } /* the first row sits right under the heading, like other sections */
.story__link { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; }
.story__text { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 8px; }
.story__title { font-family: var(--serif); font-size: clamp(20px, 12px + 0.9vw, 26px); line-height: 1.06; letter-spacing: 0; text-wrap: pretty; }
.story__media { grid-column: 2; grid-row: 1 / -1; align-self: start; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--grey); }
.story__meta { grid-column: 1; grid-row: 2; align-self: start; position: relative; } /* above the link's area */

/* Vacancy card: where a material has its cover, a grey tile with the company's name or logo */
.vacancy__tile { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px 16px; }
.vacancy__company { margin-top: auto; font-family: var(--serif); font-size: clamp(22px, 12px + 1.3vw, 30px); line-height: 1.02; text-wrap: balance; }
.vacancy__logo { margin-top: auto; max-width: 60%; max-height: 50%; object-fit: contain; object-position: left bottom; }
/* Top vacancy: one card across the whole width, above the grid */
.vacancy-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.vacancy-top__link { display: flex; flex-direction: column; gap: 14px; }
.vacancy-top__tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  aspect-ratio: 16 / 5;
  padding: 20px 24px 24px;
  border-radius: var(--radius);
  background: var(--grey);
}
/* …or the vacancy's own picture: shown whole, in its own proportions, the chips over its corner */
.vacancy-top__tile--image { position: relative; display: block; aspect-ratio: auto; padding: 0; overflow: hidden; }
.vacancy-top__image { display: block; width: 100%; height: auto; }
.vacancy-top__tile--image .chips { position: absolute; top: 20px; left: 24px; }
.vacancy-top__company { font-family: var(--serif); font-size: var(--fs-display-l); line-height: 0.95; letter-spacing: -0.01em; text-wrap: balance; }
.vacancy-top__text { max-width: 760px; margin-top: -4px; font-size: var(--fs-body); line-height: 1.2; color: var(--muted); text-wrap: pretty; }
.vacancy-top__title { transition: color 0.15s ease; }
.chip--red { background: var(--red); color: var(--white); }

/* One vacancy's page (/vakansii/<slug>/): the material's centred column */
.vacancy-page__back { margin-bottom: 20px; }
.vacancy-page__mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--grey);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}
.vacancy-page__mark img { width: 100%; height: 100%; object-fit: contain; }
.vacancy-page__title { margin-top: 12px; }
.vacancy-page__company { display: block; margin-top: 0.15em; font-size: var(--fs-display); line-height: 1; color: var(--muted); }
/* Terms on the left, buttons on the right, between two rules */
.vacancy-page__summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px 40px;
  margin-top: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--black);
  border-bottom: 1px solid var(--grey-dark);
}
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 32px; font-size: var(--fs-meta); line-height: 1.2; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.vacancy-page__actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 200px; }
.vacancy-page__actions .meta { max-width: 220px; margin-top: 4px; }
/* Section headings at the size of a material's subheadings; lists set with dashes */
/* (.vacancy-page .prose — to outweigh the general .prose rules further down) */
.vacancy-page__cover { margin-top: 28px; }
.vacancy-page .prose { margin-top: 36px; }
.vacancy-page .prose h2 { margin-top: 1.5em; font-size: clamp(24px, 14px + 1.25vw, 32px); line-height: 1.05; }
.vacancy-page .prose > h2:first-child { margin-top: 0; }
.vacancy-page .prose ul { padding-left: 0; list-style: none; }
.vacancy-page .prose li { position: relative; padding-left: 1.5em; }
.vacancy-page .prose li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.vacancy-company .stack { gap: 16px; }
.format { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: baseline; padding: 18px 0; }
.format__title { font-family: var(--serif); font-size: clamp(22px, 12px + 1.3vw, 30px); line-height: 1.02; letter-spacing: 0; text-wrap: pretty; }

/* Big numbers (media kit, dashboard) and the team list share one look */
.numbers,
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px var(--gutter); }
.numbers li,
.team li { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--black); }

/* ---------- Article ---------- */
/* One 860px column centred on the page; rubric, date, author and views sit under the title */
.article {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: calc(860px + 2 * var(--pad));
  margin: 0 auto;
  padding: 68px var(--pad) 0;
}
.article__title { text-wrap: balance; }
.article__aside { margin-top: 20px; }
.article__cover { width: 100%; height: auto; margin-top: 40px; border-radius: var(--radius); background: var(--grey); }
/* Interviews: who did it, after the text (templates.mjs: article) */
.article__by { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 56px; padding: 20px 26px 22px; border-radius: var(--radius); background: var(--grey); }
.article__by-name { font-family: var(--serif); font-size: var(--fs-display); line-height: 1; letter-spacing: 0; transition: color 0.15s ease; }
.article__by-name:hover { color: var(--red); }
.article__by-bio { max-width: 560px; margin-top: 6px; font-size: var(--fs-meta); line-height: 1.15; } /* a little further from the name than the label is */
.article__by + .article__foot { margin-top: 24px; }
.article__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--black); }
.article__foot .link { margin-left: auto; }

/* Long-form text */
.prose { margin-top: 40px; font-size: var(--fs-body); line-height: 1.38; letter-spacing: 0; overflow-wrap: break-word; }
/* The rhythm of a material, in em of the block that takes the gap: between paragraphs, above a
   section title (h2), above a question (h3 or .q) and between a title or question and what
   follows. As variables, so that css/inter.css can keep its own set. */
.prose { --gap: 0.45em; --gap-h2: 1.2em; --gap-h3: 0.9em; --gap-q: 1.2em; --gap-after: 0.5em; }
.prose > * + * { margin-top: var(--gap); }
.prose h2 { margin-top: var(--gap-h2); font-family: var(--serif); font-size: var(--fs-display); line-height: 1; letter-spacing: 0; text-wrap: balance; }
.prose h3 { margin-top: var(--gap-h3); font-family: var(--serif); font-size: clamp(24px, 14px + 1.25vw, 32px); line-height: 1.05; letter-spacing: 0; text-wrap: balance; }
/* .q — a paragraph that is bold as a whole on Patreon: an interviewer's question */
.prose .q { margin-top: var(--gap-q); font-family: var(--serif); font-weight: 500; font-size: 1.18em; line-height: 1.15; letter-spacing: 0; }
.prose h2 + *, .prose h3 + *, .prose .q + * { margin-top: var(--gap-after); }
.prose h2 + h3, .prose h2 + .q { margin-top: 0.6em; } /* a section title, then its first question */
.prose a { text-decoration: underline; text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--red); }
/* Pull quote: large serif in quotation marks («» in Ukrainian, “” in an English text), no panel;
   under it, in the small grey of a source line, who said it (templates.mjs: withQuotes) */
.prose blockquote { margin: 1.5em 0; quotes: "«" "»"; font-family: var(--serif); font-size: var(--fs-display); line-height: 1.05; letter-spacing: -0.01em; text-wrap: pretty; }
.prose blockquote:lang(en) { quotes: "“" "”"; }
.prose blockquote p:first-of-type::before { content: open-quote; }
.prose blockquote p:last-of-type::after { content: close-quote; }
.prose blockquote p + p { margin-top: 0.5em; }
.prose blockquote cite { display: block; margin-top: 20px; font-family: var(--sans); font-style: normal; font-size: var(--fs-meta); line-height: 1.25; letter-spacing: 0; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--black); }
.prose figure { margin: 1.8em 0; }
.prose figure + figure { margin-top: -0.9em; }
.prose figure img { width: 100%; height: auto; border-radius: var(--radius); background: var(--grey); }
/* No player interface on a clip that plays by itself: they are silent autoplaying loops (main.js).
   Where the browser refuses autoplay, main.js gives the clip `controls`, and Safari's own
   play button then shows and works. */
video:not([controls])::-webkit-media-controls,
video:not([controls])::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
video[data-cover][controls] { pointer-events: auto; }
/* Video fills the column like an image, whatever its orientation */
.prose figure.video video { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--grey); }
.prose figure.video--tall { max-width: 420px; margin-left: auto; margin-right: auto; } /* a 9:16 clip would otherwise be a screen and a half tall */
/* Portrait pictures and clips side by side: <div class="figures figures--2"> (or --3) around the figures */
.prose .figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; margin: 1.8em 0; }
.prose .figures--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prose .figures figure { margin: 0; }
.prose figure + .figures, .prose .figures + .figures, .prose .figures + figure { margin-top: -0.9em; } /* media in a row sit as close as two figures do */
.prose figcaption,
.prose .note { margin-top: 8px; font-size: var(--fs-meta); line-height: 1.25; color: var(--muted); }
.prose .note { margin-top: 2em; }
.prose .media-note { margin: 1.6em 0; padding: 16px 20px; border-radius: var(--radius-s); background: var(--grey); font-size: var(--fs-meta); line-height: 1.25; }

/* Privacy policy: the text column of an article, under an ordinary page head */
.legal { max-width: 860px; margin-top: 0; }
.legal h2 { font-size: clamp(24px, 14px + 1.25vw, 32px); }

.product { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.product__image { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--white); }
.product__buy { display: flex; flex-wrap: wrap; gap: 8px; }
.price-old { opacity: 0.55; text-decoration-thickness: 1px; } /* the regular price during a sale */
.chip[hidden] { display: none; } /* a sale chip after the sale has ended */

/* ---------- Promo panels ---------- */
.promo { display: flex; flex-direction: column; gap: 18px; padding: 72px var(--pad) 0; }
.promo + .promo { padding-top: 18px; } /* two panels in a row (mockups, then Patreon) sit close together */
.promo--first { padding-top: 40px; }

.mockups {
  display: flex;
  gap: 40px;
  padding: 40px;
  border-radius: var(--radius);
  background: var(--grey);
  scroll-margin-top: 100px;
}
.mockups__text { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-width: 0; }
.mockups__body { max-width: 520px; }
.mockups__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.mockups__actions:not(:has(.link)) { gap: 10px; } /* two buttons sit closer than a button and a text link */
.mockups__image {
  flex: none;
  width: min(620px, 46%);
  height: auto;
  aspect-ratio: 620 / 380;
  object-fit: cover;
  border-radius: var(--radius-s);
  background: var(--grey-dark);
}

.support {
  display: flex;
  gap: 60px;
  padding: 40px;
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
}
/* Heading, text and button are centred in the block */
.support__text { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 40px; min-width: 0; text-align: center; }
.support .stack { align-items: center; }
.support__body { max-width: 560px; }

/* ---------- About, media kit ---------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px 60px;
  padding-top: 26px;
  border-top: 1px solid var(--black);
}
.about__text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.about__text p { max-width: 560px; }
.about__text .body { line-height: 1.3; }
/* A button with a short grey note next to it: «Співпраця →  Реклама, спецпроєкти, медіакіт» */
.about__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 8px; }
.about__text p.body a { text-decoration: underline; text-underline-offset: 0.16em; text-decoration-thickness: 1px; transition: color 0.15s ease; }
.about__text p.body a:hover { color: var(--red); }
.about .team { grid-template-columns: minmax(0, 1fr); gap: 0; }
.about .team li { padding: 16px 0; }
.about .team li:first-child { padding-top: 0; border-top: 0; } /* the row's own rule is above it */

/* ---------- A section that is not in the MVP yet («Вакансії») ---------- */
/* Its content is blurred and cannot be clicked; a white note sits over the top of it */
.is-soon { position: relative; }
.soon__content { filter: blur(9px); opacity: 0.7; user-select: none; pointer-events: none; }
.soon__note {
  position: absolute;
  top: 56px;
  left: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: min(520px, calc(100% - 2 * var(--pad)));
  padding: 28px 28px 26px;
  transform: translateX(-50%);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
}
.soon__note .body { line-height: 1.3; }

/* ---------- Media kit (/mediakit/) ---------- */
/* Coloured labels: the audience. Squarer and smaller than a button, so they do not read as
   more buttons next to «Обговорити співпрацю» (labels are squarer across the site, like chips) */
.kit-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-tag { padding: 0.3em 0.55em 0.36em; border-radius: var(--radius-s); background: var(--bg); color: var(--fg, var(--black)); font-size: clamp(18px, 11px + 1.2vw, 30px); line-height: 1; letter-spacing: -0.01em; }
.kit-note { max-width: 760px; line-height: 1.3; }
/* Meta Insights: big serif numbers on tinted cards */
.kit-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.kit-stat { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: clamp(170px, 14vw, 230px); padding: 20px 26px 18px; border-radius: var(--radius); background: #f2f2f2; }
.kit-stat--pink { background: #ffbfd9; }
.kit-stat--green { background: #dcffab; }
.kit-stat__n { font-family: var(--serif); font-size: clamp(52px, 24px + 4.6vw, 104px); line-height: 0.9; letter-spacing: -0.02em; color: var(--red); }
.kit-stat--pink .kit-stat__n,
.kit-stat--green .kit-stat__n { color: var(--black); }
/* Content types: three post covers with a caption under each */
.kit-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.kit-content li { display: flex; flex-direction: column; gap: 14px; }
.kit-content img { width: 100%; height: auto; aspect-ratio: 1000 / 1278; object-fit: cover; }
.kit-content__title { font-family: var(--serif); font-size: var(--fs-display); line-height: 1; }
a.kit-content__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.12em; transition: color 0.15s ease; }
a.kit-content__title:hover { color: var(--red); }
/* Why it works: tinted cards, the last one twice as wide */
.kit-why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.kit-why li { display: flex; align-items: center; justify-content: center; min-height: clamp(150px, 15vw, 250px); padding: 24px; border-radius: var(--radius); background: var(--bg); font-size: clamp(20px, 12px + 1.4vw, 36px); line-height: 1.05; letter-spacing: -0.01em; text-align: center; text-wrap: balance; }
.kit-why li:last-child { grid-column: span 2; }
/* Brands: logos on light grey tiles */
/* Each tile is as wide as its logo and then grows, so every row runs from edge to edge */
.kit-brands { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.kit-brands li { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; height: clamp(84px, 9vw, 140px); padding: 0 clamp(12px, 2vw, 32px); border-radius: var(--radius); background: #f3f3f3; } /* the logo files' own background */
.kit-brands img { width: auto; height: 100%; }
/* Price list: three plans, the middle one tinted */
.kit-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); }
.kit-plan { display: flex; flex-direction: column; padding: 20px 26px 18px; border-radius: var(--radius); background: #f2f2f2; }
.kit-plan--featured { background: #dfe7d5; }
.kit-plan__name { padding-bottom: 14px; border-bottom: 1px solid var(--black); text-align: center; }
.kit-plan__items { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 0 28px; font-size: var(--fs-body); line-height: 1.2; }
.kit-plan__items li { position: relative; padding-left: 1em; }
.kit-plan__items li::before { content: "•"; position: absolute; left: 0; }
.kit-plan__price { padding-top: 14px; border-top: 1px solid var(--black); font-size: var(--fs-display-l); }
.kit-price-note { margin-top: -8px; }
/* Terms and contacts side by side, split by a thin rule */
.kit-terms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 60px; }
.kit-terms__list { display: flex; flex-direction: column; gap: 18px; }
.kit-terms__list li { position: relative; padding-left: 1em; line-height: 1.3; }
.kit-terms__list li::before { content: "•"; position: absolute; left: 0; }
.kit-contacts { display: flex; flex-direction: column; gap: 16px; padding-left: 60px; border-left: 1px solid var(--black); }
.kit-contacts > ul,
.kit-contacts > div { display: flex; flex-direction: column; gap: 6px; padding-top: 16px; border-top: 1px solid var(--black); }
.kit-contacts ul { display: flex; flex-direction: column; gap: 6px; }
.kit-contacts > div ul { margin-top: 10px; }
.kit-contacts a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; transition: color 0.15s ease; }
.kit-contacts a:hover { color: var(--red); }
.kit-closing { align-items: center; padding-top: 96px; text-align: center; }
/* the page's ordinary big heading size and Regular (the oversized 112px read as bold), with more air above the button */
.kit-closing .display-l { max-width: 900px; font-weight: 400; }
.kit-closing .btn { margin-top: 18px; }

/* ---------- Grey page (mockups): the covers have white halves, so the page is not white ---------- */
body.theme-grey { background: var(--grey); }
.theme-grey .header::before { background: rgba(235, 234, 234, 0.78); }
.theme-grey .page .mockups { background: var(--white); }
/* The free-mockup banner: black, so it reads as an offer of its own next to the white panels */
.theme-grey .page .mockups--dark,
.mockups--dark { background: var(--black); color: var(--white); }
.mockups--dark .btn--white { color: var(--black); }

/* ---------- Password form of a locked material ---------- */
/* (The dashboard at /stats/ has its own stylesheet, css/stats.css.) The field and the button are
   stretched to one height; the label sits on their middle line */
.stats__key { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.stats__key label { align-self: center; }
.stats__key[hidden] { display: none; }
.stats__key input { min-width: 260px; padding: 9px 16px; border: 1px solid var(--black); border-radius: 43px; background: var(--white); }

/* ---------- Footer ---------- */
.footer { display: flex; flex-direction: column; gap: 70px; padding: 100px var(--pad) 30px; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; max-width: 100%; } /* never wider than the screen: the tagline's 420px made phones scroll sideways */
.footer__tagline { width: 420px; max-width: 100%; }
.footer__links { display: flex; gap: 90px; white-space: nowrap; }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
/* © and the privacy policy on the left, the e-mail on the right */
.footer__legal { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-top: 70px;
  border-top: 1px solid var(--black);
}

/* Easter egg: a puppy with a heart behind the footer's rule. .egg is a window standing on the
   rule that clips him at it; he waits below (hidden), peeks up to his eyes once the footer is
   on screen (.is-peek), a little more under the cursor, and climbs out on a click (.is-out),
   then goes back by himself. Only the visible part of him takes clicks. */
.footer__bottom { position: relative; }
.egg {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: clamp(116px, 11vw, 168px);
  aspect-ratio: 400 / 446;
  margin-left: calc(clamp(116px, 11vw, 168px) / -2);
  overflow: hidden;
  pointer-events: none;
}
.egg__dog {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.egg__dog img { width: 100%; height: 100%; -webkit-user-drag: none; user-select: none; }
.egg__dog.is-peek { transform: translateY(73%); } /* his head down to the chin; the heart starts at 30.7% of the picture and stays hidden */
.egg__dog.is-out { transform: translateY(7%); } /* his hand stays behind the rule */
.egg__dog:focus-visible { outline-offset: -3px; }

/* ---------- Mobile menu ---------- */
.menu-toggle {
  display: none;
  padding: 0;
  border: 0;
  background: none;
  line-height: calc(var(--fs-body) + 20px); /* same height as .btn */
  cursor: pointer;
}
.menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  animation: menu-in 0.18s ease-out;
}
.menu[hidden] { display: none; }
@keyframes menu-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.menu__nav { display: flex; flex-direction: column; padding: 24px var(--pad) 0; }
.menu__nav a { padding: 15px 0 13px; border-top: 1px solid var(--black); }
.menu__nav a:last-child { border-bottom: 1px solid var(--black); }
.menu__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: auto;
  padding: 40px var(--pad) calc(28px + env(safe-area-inset-bottom));
}
.menu .header { position: relative; top: 0; }
.menu .header::before { display: none; }
.menu-open { overflow: hidden; }

/* ---------- Hover (pointer devices only): the same red as «selected» ---------- */
@media (hover: hover) {
  .egg__dog.is-peek:not(.is-out):hover { transform: translateY(70%); } /* a little more, still without the heart */
  .nav a:hover,
  .filters a:hover,
  .link:hover,
  .menu-toggle:hover,
  .footer__col a:hover,
  .footer__bottom a:hover,
  a.chip:hover,
  a.pill:hover,
  .featured__link:hover .featured__title,
  a.card__link:hover .card__title,
  a.vacancy-top__link:hover .vacancy-top__title,
  .story__link:hover .story__title,
  .reel__slide:hover .reel__title,
  .top-item:hover .top-item__title { color: var(--red); }

  .featured__link:hover .featured__image,
  a.card__link:hover .card__image,
  .story__link:hover .story__media img,
  .story__link:hover .story__media video { transform: scale(1.04); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .footer__links { gap: 56px; }
  .support { gap: 40px; }
  .mockups__image { width: 42%; }
}

/* Narrow desktop windows: five nav items would run into the centred one-line logo of the
   stuck bar, so the bar's type and the gaps between items get a little smaller */
@media (max-width: 1160px) {
  .header { --fs-nav: 16px; }
  .nav { gap: 14px; }
}

@media (max-width: 1040px) {
  /* Hero in one column: tagline panel, photo, title and lead, chips, «Топ» */
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, auto); padding-top: 52px; }
  .intro { grid-row: 1; }
  .featured { grid-column: 1; grid-row: 2 / span 3; }
  /* photo 1.9:1, lower on landscape tablets so the title, lead and chips still fit the first screen */
  .featured__media::before { padding-top: clamp(min(220px, 100% / 1.9), calc(100svh - 550px), calc(100% / 1.9)); }
  .sidebar { grid-column: 1; grid-row: 5; contain: none; }
  .sidebar .top__list { flex: none; display: block; overflow: visible; } /* items at their own height */
  .top__list > li:nth-child(n + 5) { display: none; } /* four of them */
  .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .author-bio__panel { width: calc((100% - 2 * var(--gutter)) * 2 / 3 + var(--gutter)); } /* two of three cards */

  /* Compact header: sections move into the full-screen menu. The logo goes to the left edge;
     on the right, «Підтримати» and then «Меню» (or «Закрити» in the open menu). */
  .header {
    --fs-nav: var(--fs-body);
    --bar-pt: 14px;
    top: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: var(--bar-pt) var(--pad);
  }
  .nav,
  .actions__submit { display: none; } /* «Подати проєкт» lives in the menu here */
  .menu-toggle { display: block; order: 1; }
  .logo { left: var(--pad); transform: none; }
  .logo__stack { padding-top: 10px; font-size: 32px; line-height: 25.4px; }
  .logo__line { left: 0; transform: translateY(8px); font-size: clamp(17px, 5.4vw, 30px); }
  .header.is-stuck .logo__line { transform: translateY(-0.12em); }
  .page-head,
  .article { padding-top: 64px; }
  .page-head--feed { padding-top: 56px; }
  .menu__nav { padding-top: 58px; }
}

@media (max-width: 860px) {
  :root { --pad: 20px; }
  /* Reel: the intro goes under the portrait (a square). The slides share one grid cell, so the
     reel is as tall as its longest intro; the bars stay over the bottom of the portrait. */
  .reel { height: auto; }
  .reel__slides { display: grid; }
  .reel__slide { position: relative; inset: auto; grid-area: 1 / 1; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .reel__media { aspect-ratio: 1 / 1; }
  .reel__text { gap: 18px; padding: 20px 26px 18px; }
  .reel__head { gap: 10px; }
  .reel__who { font-size: calc(var(--fs-title) * 0.8); }
  .reel__title + .reel__intro { margin-top: 6px; }
  .reel__title { font-size: var(--fs-display); }
  /* six lines at most; a longer intro fades out into the grey (main.js adds .is-cut when it does not fit) */
  .reel__intro { display: block; -webkit-line-clamp: none; max-height: calc(6 * 1.2em); }
  .reel__intro.is-cut { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent); }
  .reel__bars { inset: calc(100cqi - 30px) 14px auto; gap: 4px; }
  .reel__arrows { display: none; } /* no arrows here: taps on the portrait's left and right thirds flip the slide, like stories (main.js) */
  .section { padding-top: 52px; }
  .section--lead { padding-top: 48px; }
  .section--first { padding-top: 32px; }
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px var(--gutter); }
  .author-bio__panel { width: auto; }
  /* Stories one under another, each still text | cover */
  .stories { grid-template-columns: minmax(0, 1fr); }
  .stories > .story:nth-child(n) { padding: 20px 0 22px; border-right: 0; border-bottom: 1px solid var(--grey-dark); }
  .stories > .story:first-child { padding-top: 0; }
  .stories > .story:last-child { border-bottom: 0; }
  .promo { padding-top: 56px; }
  .promo--first { padding-top: 32px; }
  .filters-group { align-items: flex-start; }
  .filters { justify-content: flex-start; }
  .article__cover, .prose { margin-top: 28px; }
  .article__foot .link { margin-left: 0; }
  .about__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .about .team li:first-child { padding-top: 16px; border-top: 1px solid var(--black); } /* under the heading: names start with a rule, as on the media kit */
  .format { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .kit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kit-content, .kit-why, .kit-prices, .kit-terms { grid-template-columns: minmax(0, 1fr); }
  .kit-why li:last-child { grid-column: auto; }
  .kit-content { gap: 32px; }
  .kit-contacts { padding-left: 0; border-left: 0; }
  /* Phones: two equal tiles a row (an odd last one takes the whole row), the logo fitted inside */
  .kit-brands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kit-brands li { height: 60px; padding: 0 10px; border-radius: var(--radius-s); }
  .kit-brands li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kit-brands img { max-width: 100%; height: auto; max-height: 100%; }
  .kit-closing { padding-top: 64px; }
  /* Vacancy page: buttons go under the terms, side by side */
  .vacancy-page__summary { flex-direction: column; }
  .vacancy-page__actions { flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .vacancy-page__actions .meta { flex-basis: 100%; max-width: none; }
  .vacancy-top__tile { aspect-ratio: 16 / 9; padding: 14px 16px 18px; }
  .vacancy-top__tile--image { aspect-ratio: auto; padding: 0; }
  .vacancy-top__tile--image .chips { top: 12px; left: 12px; }
  .mockups { flex-direction: column-reverse; gap: 28px; padding: 24px; }
  .mockups__image { width: 100%; }
  .support { flex-direction: column; gap: 36px; padding: 24px; }
  .support__text { gap: 28px; }
  .footer { padding-top: 72px; gap: 48px; }
  .footer__top { flex-direction: column; }
  .footer__links { flex-wrap: wrap; gap: 36px 56px; }
  .footer__bottom { padding-top: 30px; }
}

@media (max-width: 640px) {
  .header { --bar-ch: calc(var(--fs-nav) + 18px); }
  /* «Підтримати» is longer than the «Patreon» that used to be here: button and the stuck one-line
     logo shrink with the screen so they never meet (checked down to 320px) */
  .header .btn { padding: 8px 12px; font-size: clamp(13px, 4vw, 18px); }
  .logo__line { font-size: clamp(14px, 4.7vw, 30px); }
  .footer__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 20px; width: 100%; }
  .author-bio__panel, .article__by { padding: 20px 20px 22px; }
  /* Phones: the four lines in a 2×2 grid — ©, the privacy policy / the font, the e-mail —
     so the e-mail sits under the policy (the legal paragraph's items join the grid) */
  .footer__bottom { display: grid; grid-template-columns: max-content max-content; justify-content: space-between; align-items: baseline; gap: 10px 16px; white-space: nowrap; }
  .footer__legal { display: contents; }
  .intro { --intro-px: 20px; gap: 20px; } /* as .top here */
  .reel__text { padding: 20px 20px 18px; } /* as .intro and .top here */
  .intro__text { gap: 16px; }
  /* One card per row; in a story the cover becomes a small picture on the right */
  .grid--4, .grid--3 { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .story { grid-template-columns: minmax(0, 1fr) 36%; gap: 12px 14px; }
  .story__media { border-radius: var(--radius-s); }
  .top { padding: 20px 20px 18px; }
  .section__head { align-items: center; }
}

@media (max-width: 374px) {
  .footer__bottom { grid-template-columns: minmax(0, 1fr); white-space: normal; } /* too narrow for two columns: one under another */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .egg__dog { transition: none; }
  .menu { animation: none; }
  .featured__image, .card__image, .story__media img, .story__media video { transform: none !important; }
  * { transition: none !important; }
}
