/* ============================================================== tokens */

:root {
  --bg: #0E0C0A;
  --surface: #17140F;
  --line: #2A241D;
  --ink: #F2EBDF;
  --muted: #A69C8C;
  --amber: #E08A3C;
  --amber-hi: #EDA55F;
  --ember: #B4571F;
  --green: #6FA36B;
  --green-hi: #93CF8D;

  --display: 'Oswald', sans-serif;
  --body: 'Golos Text', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ================================================================ base */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* The project rail is the only horizontal scroller on this page. */
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-feature-settings: "locl" 1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  color: var(--amber-hi);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

img,
video {
  display: block;
  max-width: 100%;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================== grain */

.grain {
  position: fixed;
  inset: -10%;
  width: 120%;
  height: 120%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  animation: grainShift 0.9s steps(4) infinite;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22180%22 height=%22180%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.85%22 numOctaves=%222%22/%3E%3C/filter%3E%3Crect width=%22180%22 height=%22180%22 filter=%22url(%23n)%22/%3E%3C/svg%3E");
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ============================================================ buttons */

.btn {
  display: inline-block;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.btn-primary {
  background: var(--amber);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--amber-hi);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--line);
  background: rgba(14, 12, 10, 0.5);
  color: var(--ink);
  font-weight: 500;
}

.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--ink);
}

.btn-lg {
  font-size: 16px;
  padding: 14px 28px;
}

.btn-nav {
  font-size: 14px;
  padding: 9px 18px;
  /* Flex was squeezing it into two lines next to the logo on narrow phones. */
  white-space: nowrap;
  flex: none;
}

.btn-nav-short {
  display: none;
}

/* ================================================================ nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: linear-gradient(rgba(14, 12, 10, 0.85), rgba(14, 12, 10, 0));
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
  color: var(--ink);
  /* Last line of defence on a narrow phone: the wordmark gives way rather than
     pushing the language pill and the button off the edge of the screen. */
  min-width: 0;
  overflow: hidden;
}

.logo:hover {
  color: var(--ink);
}

.logo-b {
  color: var(--amber);
}

.logo-t {
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-link {
  color: var(--muted);
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--ink);
}

.lang-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.lang-pill:hover {
  color: var(--ink);
  border-color: var(--amber);
}

/* =============================================================== hero */

.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* Mobile browsers hide part of 100vh behind the URL bar; the hero pins content
   to both edges, so it needs the viewport it actually gets. */
@supports (height: 100dvh) {
  .hero {
    height: 100dvh;
  }
}

.hero-video {
  position: absolute;
  inset: 0;
  /* The 16:9 cut fills the hero. Overscanning the width pushes the subject out
     of the left third, so the headline never lands on his face; the surplus is
     clipped by the hero's overflow. */
  width: 128%;
  /* Beats the global `img, video { max-width: 100% }`, which would otherwise
     cap the overscan back to the viewport width. */
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    /* Centred on the subject, not the viewport — it keeps him lit and buries the
       letterbox seams of the portrait video in the falloff. */
    radial-gradient(120% 90% at 70% 45%, rgba(14, 12, 10, 0) 30%, rgba(14, 12, 10, 0.55) 72%, rgba(14, 12, 10, 0.92) 100%),
    linear-gradient(rgba(14, 12, 10, 0.35), rgba(14, 12, 10, 0.15) 40%, rgba(14, 12, 10, 0.75));
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 14vh;
  animation: heroIn 0.9s var(--ease) 0.15s both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* Still used by the availability line in the contact section. */
.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.hero-h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 5.4vw, 84px);
  line-height: 1.06;
  letter-spacing: 0.005em;
  margin: 0 0 10px;
  max-width: 18ch;
  text-wrap: pretty;
}

.hero-amber {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 38px);
  color: var(--amber);
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 30px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  animation: fadeScroll 2.2s ease-in-out infinite;
}

@keyframes fadeScroll {
  0%, 100% { opacity: 0.5; transform: translate(-50%, 0); }
  50%      { opacity: 1; transform: translate(-50%, 6px); }
}

/* ============================================================ pillars */

.pillars {
  position: relative;
  background:
    radial-gradient(700px 500px at 18% 20%, rgba(224, 138, 60, 0.09), transparent 70%),
    radial-gradient(600px 500px at 85% 75%, rgba(180, 87, 31, 0.07), transparent 70%);
}

.pillars-inner {
  padding-top: 140px;
  padding-bottom: 120px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  margin: 0 0 60px;
}

.pillar-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.pillar {
  display: grid;
  /* min() so the track can go below its floor instead of pushing the page wider
     than the viewport on a 320px screen. */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px 60px;
  align-items: baseline;
}

.pillar-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

/* The number is a marker, not a headline — it has to stay clearly under the
   title, which is why it is sized in em against the row rather than in vw. */
.pillar-n {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(16px, 1.5vw, 22px);
  line-height: 1;
  color: var(--amber);
  opacity: 0.55;
}

/* All four titles are now within a couple of characters of each other, so they
   share one size — the old xl/lg/md variants were there to offset very
   different lengths and now only make the rows look inconsistent. */
.pillar-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.04;
  text-wrap: balance;
  margin: 0;
}

.pillar-text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 46ch;
  margin: 0;
}

/* Every row's text starts at the same edge — the rows used to alternate, which
   only read as intentional when the titles were huge. */
.pillar-right .pillar-text {
  justify-self: start;
}

/* Fade-up once per row, applied by script.js only when motion is allowed. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-in {
  opacity: 1;
  transform: none;
}

/* =========================================================== projects */

.projects {
  border-top: 1px solid var(--line);
  padding: 110px 0 120px;
}

.projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1;
  margin: 0;
}

.rail-nav {
  display: flex;
  gap: 10px;
}

.rail-btn {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.rail-btn:hover {
  border-color: var(--amber);
}

.rail {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 28px 20px;
  /* Without this the snapport starts at the border edge and mandatory snapping
     swallows the 28px inset — the first card ends up flush with the viewport. */
  scroll-padding: 0 28px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  height: 0;
}

.rail:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}

.pcard {
  flex: 0 0 min(480px, 84vw);
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

.pcard:hover,
.pcard:focus-within {
  border-color: var(--amber);
  transform: translateY(-3px);
}

/* Keeps the last card from snapping flush against the viewport edge. */
.rail-tail {
  flex: 0 0 4px;
}

.pframe {
  position: relative;
}

.pchrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.pdots {
  display: flex;
  gap: 5px;
}

.pdots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.pdomain {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.pshot {
  width: 100%;
  /* height:auto is load-bearing — the width/height attributes on the tag map to
     a presentational height that would otherwise beat the aspect ratio. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
}

.pactions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

/* Green, not amber — this badge says "nothing here is a real patient record",
   so it should read as reassurance rather than as another accent. Tinted
   outline rather than a solid fill, so it never competes with the button. */
.pdemo {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--green-hi);
  background: rgba(147, 207, 141, 0.1);
  border: 1px solid rgba(147, 207, 141, 0.32);
  border-radius: 999px;
  padding: 5px 10px;
}

.pbody {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.pstack {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}

.pname {
  font-family: var(--display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

/* What the product is, in one line, straight under its name. */
.ptag {
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  margin: -4px 0 0;
}

.pcopy {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* The second paragraph takes the slack so the stack line and the button stay
   pinned to the bottom of every card, however long the copy runs. */
.pcopy-last {
  flex: 1;
}

/* Desktop shows the copy in full, so the toggle only exists below 720px. */
.pmore {
  display: none;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--body);
  font-size: 13.5px;
  color: var(--amber);
  cursor: pointer;
}

.popen {
  font-size: 14.5px;
  padding: 11px 20px;
}

/* ============================================================ process */

.process {
  border-top: 1px solid var(--line);
  background: radial-gradient(700px 500px at 80% 15%, rgba(224, 138, 60, 0.07), transparent 70%);
}

.process-inner {
  padding-top: 110px;
  padding-bottom: 120px;
}

/* Sits on .section-title, so it only needs the run-up to the step grid. */
.process-heading {
  margin-bottom: 56px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 36px;
}

.step {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.step-n {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--amber);
  margin: 0 0 12px;
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.step-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.process-note {
  max-width: 68ch;
  margin: 56px 0 0;
  border-left: 2px solid var(--amber);
  padding-left: 20px;
}

.process-note-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
}

.process-note p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 12px;
}

.process-note p:last-child {
  margin-bottom: 0;
}

/* ============================================================== about */

.about {
  border-top: 1px solid var(--line);
}

.about-inner {
  padding-top: 110px;
  padding-bottom: 110px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 64px;
  align-items: center;
}

.about-media {
  justify-self: center;
  width: min(440px, 100%);
}

.about-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.about-role {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--amber);
  margin: 14px 0 24px;
}

.about-p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 16px;
}

.about-p-lead {
  color: var(--ink);
}

.about-p:last-child {
  margin-bottom: 0;
}

/* ============================================================ contact */

.contact {
  border-top: 1px solid var(--line);
  background: radial-gradient(800px 500px at 50% 20%, rgba(224, 138, 60, 0.09), transparent 70%);
}

.contact-inner {
  padding-top: 140px;
  padding-bottom: 130px;
  text-align: center;
}

/* Sized so the two-word heading stays on one line on a desktop viewport — the
   old 180px ceiling was set for "Пиши ми" and broke this one across two lines. */
.contact-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 88px);
  line-height: 1;
  letter-spacing: 0.005em;
  text-wrap: balance;
  margin: 0 0 24px;
}

.contact-title .dot {
  color: var(--amber);
}

.contact-text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 40px;
}

.contact-mail {
  font-family: var(--mono);
  font-size: clamp(17px, 2.8vw, 30px);
  display: inline-block;
  border-bottom: 1px solid var(--amber);
  padding-bottom: 5px;
  word-break: break-word;
}

.contact-meta {
  display: flex;
  justify-content: center;
  gap: 14px 32px;
  flex-wrap: wrap;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.contact-phone {
  color: var(--muted);
  transition: color 0.15s;
}

.contact-phone:hover {
  color: var(--ink);
}

.contact-avail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}

/* ============================================================= footer */

.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  padding-top: 22px;
  padding-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.footer .logo {
  font-size: 11.5px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ================================================================ blog */

/* The blog pages reuse the site's tokens and nav; only the reading column and
   the type inside an article are new. */
.blog-main {
  padding-top: 120px;
  padding-bottom: 90px;
}

.blog-head {
  margin-bottom: 56px;
}

.blog-lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 60ch;
  margin: 14px 0 0;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-item {
  display: block;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.15s;
}

.post-item:last-child {
  border-bottom: 1px solid var(--line);
}

.post-item:hover {
  color: var(--ink);
  border-color: var(--amber);
}

.post-item h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.15;
  margin: 6px 0 8px;
}

.post-item:hover h2 {
  color: var(--amber-hi);
}

.post-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.post-item p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
}

/* ---- a single article ---- */

.post {
  max-width: 720px;
}

.post-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.06;
  margin: 10px 0 18px;
  text-wrap: balance;
}

.post-body {
  font-size: 17.5px;
  line-height: 1.75;
  color: var(--ink);
}

.post-body p {
  margin: 0 0 22px;
}

.post-body h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(23px, 2.4vw, 30px);
  line-height: 1.2;
  margin: 46px 0 14px;
}

.post-body h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 32px 0 10px;
}

.post-body ul {
  margin: 0 0 22px;
  padding-left: 20px;
}

.post-body li {
  margin-bottom: 10px;
}

.post-body strong {
  color: var(--ink);
  font-weight: 600;
}

.post-body .lead {
  font-size: 19px;
  color: var(--muted);
  border-left: 2px solid var(--amber);
  padding-left: 20px;
}

.post-cta {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-cta p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 44ch;
}

/* ============================================================= mobile */

@media (max-width: 720px) {
  /* The section links go; the language pill stays, or a phone visitor has no
     way to switch language at all. */
  .nav-link {
    display: none;
  }

  .lang-pill {
    font-size: 10.5px;
    padding: 4px 6px;
    flex: none;
  }

  /* "Обсъди проект" no longer fits once the pill is in the row. */
  .btn-nav-long {
    display: none;
  }

  .btn-nav-short {
    display: inline;
  }

  /* The rail arrows stay — on a touch screen they are the only visible sign
     that there is anything to the right of the first card. */
  .rail-btn {
    width: 42px;
    height: 42px;
  }

  /* A narrower card leaves the next one clearly peeking at the edge. */
  .pcard {
    flex: 0 0 78vw;
  }

  .pcard:not(.pcard-open) .pcopy-last {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pmore {
    display: block;
  }

  /* The logo is nowrap mono, so it has to scale for the pill and the button to
     fit beside it all the way down to a 320px screen. */
  .logo {
    font-size: clamp(10px, 3vw, 13px);
  }

  /* 28px each side is a lot of the row on a phone, and this is the one row
     where every pixel is spoken for. */
  .nav-inner {
    padding-left: 18px;
    padding-right: 18px;
    gap: 10px;
  }

  .nav-links {
    gap: 10px;
  }

  .btn-nav {
    font-size: 13px;
    padding: 9px 12px;
  }

  /* "Пиши ми" is already in the header on mobile — one is enough. */
  .hero-cta .btn-secondary {
    display: none;
  }

  .hero-content {
    justify-content: space-between;
    padding-top: 84px;
    padding-bottom: 26px;
  }

  .hero-h1 {
    font-size: 30px;
  }

  .hero-amber {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .hero-sub {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Scrim so the bottom block stays readable over the subject's hands. */
  .hero-bottom {
    background: linear-gradient(rgba(14, 12, 10, 0), rgba(14, 12, 10, 0.55) 30%);
    padding-top: 20px;
  }

  /* Phones get the portrait cut, which needs no overscan. */
  .hero-video {
    width: 100%;
    object-fit: cover;
    object-position: 68% 20%;
  }

  /* With the content pinned to both edges the hint would land on the buttons. */
  .scroll-hint {
    display: none;
  }

  .pillars-inner {
    padding-top: 100px;
    padding-bottom: 90px;
  }

  .pillar-list {
    gap: 52px;
  }

  /* One column here, so the portrait would otherwise run the full width of the
     screen and take up most of a phone viewport on its own. */
  .about-inner {
    padding-top: 80px;
    padding-bottom: 80px;
    gap: 36px;
  }

  .about-media {
    width: min(220px, 62%);
  }
}

/* "приложения" is a single unbreakable word — below ~360px it cannot fit beside
   the row number at the designed size, and pushed the page wider than the
   viewport. Scoped this tight so nothing above 360px shifts. */
@media (max-width: 359px) {
  .pillar-head {
    gap: 14px;
  }

  .pillar-title {
    font-size: 24px;
  }
}

/* ============================================== embedded demo (phone) */

/* The Revenue app is phone-shaped, so it opens inside a phone rather than in a
   new tab. The iframe is only created on open — nobody pays for the demo's
   JavaScript just by scrolling past the card. */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px;
  background: rgba(8, 7, 6, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: demo-in 0.18s var(--ease);
}

@keyframes demo-in {
  from {
    opacity: 0;
  }
}

.demo-phone {
  position: relative;
  width: min(392px, 100%);
  /* 19.5:9, the shape of the phone this app was designed against. */
  aspect-ratio: 9 / 19.5;
  max-height: min(820px, 100%);
  padding: 12px;
  border-radius: 46px;
  background: linear-gradient(160deg, #2A241D, #12100D 40%);
  border: 1px solid #3A322A;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 40px 90px rgba(0, 0, 0, 0.65);
}

.demo-phone iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 34px;
  background: #0b0b0f;
  display: block;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.demo-bar a,
.demo-bar button {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  transition: color 0.15s;
}

.demo-bar a:hover,
.demo-bar button:hover {
  color: var(--ink);
}

.demo-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
}

.demo-close:hover {
  border-color: var(--amber);
}

/* A phone drawn inside a phone is a waste of the screen. */
@media (max-width: 720px) {
  .demo-modal {
    padding: 0;
    gap: 0;
    justify-content: flex-start;
  }

  .demo-phone {
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
    flex: 1;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    padding-top: 56px;
  }

  .demo-phone iframe {
    border-radius: 0;
  }

  .demo-bar {
    order: -1;
    width: 100%;
    justify-content: flex-start;
    padding: 14px 64px 0 18px;
  }

  .demo-close {
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

/* ==================================================== reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
