/* ==========================================================================
   Aleksandr Balaev — personal site
   Design language: Apple Human Interface Guidelines for the web.
   One family (SF Pro via the system stack, Inter as the cross-platform
   fallback), generous whitespace, black product stage, Tech Specs résumé.
   ========================================================================== */

/* ---------- Font (used only where SF Pro is not available) ---------- */
@font-face {
  font-family: "InterVariable";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+2605, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --mist: #f5f5f7;
  --ink: #1d1d1f;
  --graphite: #6e6e73;
  --hairline: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --focus: #0071e3;
  --stage: #000000;
  --stage-ink: #f5f5f7;
  --stage-graphite: #86868b;
  --stage-link: #2997ff;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-line: rgba(0, 0, 0, 0.1);
  --card: #ffffff;
  --raised: #ffffff;
  --label-ink: #004f9e;

  --font: -apple-system, BlinkMacSystemFont, "InterVariable", system-ui,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 1120px;
  --gutter: clamp(22px, 4vw, 40px);
  --section-pad: clamp(88px, 11vw, 150px);
  --radius-l: 28px;
  --radius-m: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000000;
    --mist: #161617;
    --ink: #f5f5f7;
    --graphite: #a1a1a6;
    --hairline: #424245;
    --link: #2997ff;
    --focus: #2997ff;
    --nav-bg: rgba(22, 22, 23, 0.72);
    --nav-line: rgba(255, 255, 255, 0.12);
    --card: #000000;
    --raised: #2c2c2e;
    --label-ink: #8cc4ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 64px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.016em;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

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

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 8px;
  text-decoration: none;
}

/* ---------- Layout ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.wrap--narrow {
  --max: 760px;
}

.section {
  padding-block: var(--section-pad);
}

.section--mist {
  background: var(--mist);
}

.section--stage {
  --ink: var(--stage-ink);
  --graphite: var(--stage-graphite);
  --link: var(--stage-link);
  --focus: var(--stage-link);
  --hairline: #424245;
  background: var(--stage);
  color: var(--stage-ink);
}

/* ---------- Type ---------- */
.display {
  font-size: clamp(3.25rem, 1.75rem + 6.4vw, 6.5rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.042em;
}

.h2 {
  font-size: clamp(2.5rem, 1.55rem + 3.9vw, 4.5rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h2--sm {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.h3 {
  font-size: 1.3125rem;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.lead {
  max-width: 34em;
  font-size: clamp(1.1875rem, 1.04rem + 0.6vw, 1.5rem);
  line-height: 1.36;
  font-weight: 500;
  letter-spacing: -0.022em;
  color: var(--graphite);
  text-wrap: pretty;
}

.small {
  font-size: 0.875rem;
  line-height: 1.43;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

.section-head .lead {
  margin-top: 20px;
}

.section-head--center {
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

/* ---------- Buttons & links ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 30px;
  margin-top: 36px;
}

.actions--center {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.016em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn:hover {
  background: var(--blue-hover);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--link);
  box-shadow: inset 0 0 0 1px currentColor;
}

.btn--ghost:hover {
  background: color-mix(in srgb, var(--link) 10%, transparent);
}

.more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.0625rem;
  font-weight: 400;
}

.more::after {
  content: "";
  flex: none;
  width: 0.42em;
  height: 0.74em;
  margin-left: 0.32em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1.2 1.2 6.8 7l-5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1.2 1.2 6.8 7l-5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--paper);
  }
}

.nav.is-scrolled {
  box-shadow: 0 1px 0 var(--nav-line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav__brand {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__links {
  display: flex;
  gap: 28px;
}

.nav__links a {
  color: var(--ink);
  opacity: 0.8;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease;
}

.nav__links a:hover {
  opacity: 1;
  text-decoration: none;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 15px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav__cta:hover {
  background: var(--blue-hover);
  text-decoration: none;
}

.nav__toggle {
  display: none;
}

@media (max-width: 767px) {
  .nav__toggle {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin-right: -12px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .nav__toggle span {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 1.5px;
    border-radius: 1px;
    background: var(--ink);
    transition: transform 0.3s ease, top 0.3s ease;
  }

  .nav__toggle span:nth-of-type(1) {
    top: 18px;
  }

  .nav__toggle span:nth-of-type(2) {
    top: 25px;
  }

  .nav.is-open .nav__toggle span:nth-of-type(1) {
    top: 21.5px;
    transform: rotate(45deg);
  }

  .nav.is-open .nav__toggle span:nth-of-type(2) {
    top: 21.5px;
    transform: rotate(-45deg);
  }

  .nav.is-open {
    background: var(--paper);
  }

  .nav__menu {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    height: calc(100dvh - 52px);
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    padding: 12px var(--gutter) 40px;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .nav.is-open .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .nav__links {
    flex-direction: column;
    gap: 0;
  }

  .nav__links a {
    display: block;
    padding: 8px 0;
    opacity: 1;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
  }

  .nav__cta {
    align-self: flex-start;
    min-height: 44px;
    padding: 0 22px;
    font-size: 1.0625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav__menu,
  .nav__toggle span {
    transition: none !important;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(56px, 8vw, 112px) clamp(88px, 10vw, 140px);
}

.hero__grid {
  display: grid;
  gap: 56px;
  align-items: end;
}

.hero__role {
  margin-bottom: 14px;
  color: var(--graphite);
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.024em;
}

.hero .lead {
  margin-top: 32px;
  color: var(--ink);
  font-weight: 400;
}

.hero__meta {
  margin-top: 20px;
  color: var(--graphite);
}

.hero__photo {
  width: min(100%, 420px);
}

.hero__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-l);
}

@media (min-width: 880px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    gap: 64px;
  }

  .hero__photo {
    justify-self: end;
  }
}

/* ---------- Product stage: live deal demo ---------- */
.stage__head {
  text-align: center;
}

.stage__head .lead {
  margin: 18px auto 0;
  text-wrap: balance;
}

.demo {
  display: grid;
  justify-items: center;
  gap: 28px;
  margin-top: clamp(56px, 7vw, 88px);
}

.demo__caption {
  display: grid;
  justify-items: center;
  gap: 4px;
  max-width: 30em;
  padding-inline: var(--gutter);
  text-align: center;
}

.phone {
  /* The demo keeps adding and removing messages. Without this, the browser's
     scroll anchoring can latch onto a message and scroll the page along with
     the chat, so the phone seems to follow the reader. */
  overflow-anchor: none;
  position: relative;
  width: 300px;
  height: 640px;
  padding: 10px;
  border-radius: 56px;
  background: #1c1c1e;
  box-shadow:
    inset 0 0 0 1px #4a4a4d,
    inset 0 0 0 3px #1c1c1e,
    inset 0 0 0 4px #2c2c2e,
    0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

@media (max-width: 359px) {
  .phone {
    width: 272px;
    height: 580px;
  }
}

.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 46px;
  background: #f2f2f7;
  color: #1d1d1f;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.34;
  letter-spacing: -0.012em;
}

.phone__status {
  position: relative;
  flex: none;
  height: 38px;
  background: #fbfbfd;
}

.phone__status::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: #111114;
  box-shadow: inset 0 0 0 2px #26262b;
}

.chat-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 10px;
  background: #fbfbfd;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-head__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0071e3;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.chat-head__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.chat-head__sub {
  color: #8e8e93;
  font-size: 12px;
}

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 0;
  padding: 12px 12px 18px;
  overflow: hidden;
}

.msg {
  align-self: flex-start;
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 18px 18px 18px 6px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.msg--wide {
  width: 84%;
}

.msg--me {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: #0071e3;
  color: #fff;
}

.msg__title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.msg__note {
  margin-top: 6px;
  color: #6e6e73;
  font-size: 12.5px;
}

.offer {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.offer div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.offer dt {
  color: #6e6e73;
}

.offer dd {
  font-weight: 600;
}

.replies {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.replies li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.replies__rating {
  color: #6e6e73;
}

.replies__rate {
  font-weight: 600;
}

.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 7px 6px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.chips--stars {
  grid-template-columns: repeat(5, 1fr);
}

.chips--stars .chip {
  padding-inline: 0;
  font-size: 15px;
  line-height: 1.2;
}

.map {
  position: relative;
  height: 108px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 47%, #fff 47% 51%, transparent 51%),
    linear-gradient(0deg, transparent 56%, #fff 56% 61%, transparent 61%),
    linear-gradient(32deg, transparent 22%, #fff 22% 25%, transparent 25%),
    linear-gradient(-58deg, transparent 70%, #fff 70% 72.5%, transparent 72.5%),
    radial-gradient(ellipse 22% 26% at 80% 24%, #cfe8c6 98%, transparent 100%),
    radial-gradient(ellipse 30% 18% at 18% 86%, #c8e1f2 98%, transparent 100%),
    #e8eaed;
}

.map__pin {
  position: absolute;
  left: 49%;
  top: 58.5%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0071e3;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px #fff, 0 0 0 10px rgba(0, 113, 227, 0.18);
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aeaeb2;
  animation: typing 1.1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.is-hidden {
  display: none !important;
}

.is-entering {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.msg,
.typing {
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: bottom left;
}

.msg--me {
  transform-origin: bottom right;
}

@media (prefers-reduced-motion: reduce) {
  .msg,
  .typing,
  .typing span {
    transition: none;
    animation: none;
  }
}

/* Figures under the phone */
.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 24px;
  margin-top: clamp(72px, 9vw, 112px);
}

@media (min-width: 880px) {
  .figures {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.figure {
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.figure__num {
  font-size: clamp(2.5rem, 1.9rem + 2.2vw, 3.5rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.figure__label {
  margin-top: 8px;
  color: var(--graphite);
}

/* ---------- Feature list (my part) ---------- */
/* ---------- Steps (a real sequence) ---------- */
.steps {
  display: grid;
  gap: 40px;
  margin-top: 64px;
  counter-reset: step;
}

.step {
  position: relative;
  padding-top: 48px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
}

.step p {
  margin-top: 8px;
  color: var(--graphite);
}

@media (min-width: 880px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
  }

  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 44px;
    right: -18px;
    height: 1px;
    background: var(--hairline);
  }
}

/* ---------- About ---------- */
.about {
  display: grid;
  gap: 24px 64px;
  align-items: start;
}

.about__text p {
  max-width: 34em;
  font-size: 1.1875rem;
  line-height: 1.47;
  letter-spacing: -0.02em;
}

.about__text p + p {
  margin-top: 1em;
}

@media (min-width: 880px) {
  .about {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

/* ---------- Résumé as Tech Specs ---------- */
.specs {
  margin-top: 56px;
  border-bottom: 1px solid var(--hairline);
}

.spec {
  display: grid;
  gap: 18px;
  padding-block: 36px;
  border-top: 1px solid var(--hairline);
}

@media (min-width: 760px) {
  .spec {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
  }
}

.spec__label {
  font-size: 1.3125rem;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.entry + .entry {
  margin-top: 32px;
}

.entry__title {
  font-size: 1.1875rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.entry__meta {
  margin-top: 2px;
  color: var(--graphite);
}

.entry__text {
  max-width: 38em;
  margin-top: 10px;
}

.entry__list {
  display: grid;
  gap: 6px;
  max-width: 38em;
  margin-top: 10px;
}

.entry__list li {
  position: relative;
  padding-left: 18px;
}

.entry__list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.66em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--graphite);
}

.edu {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.edu__logo {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--hairline);
}

.edu__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.edu--sub {
  margin-top: 28px;
}

.edu .entry__text {
  margin-top: 6px;
}

.skillset {
  display: grid;
  gap: 28px;
}

/* Each skill row lines up with Experience and Education: 64px logo tile, text after it */
.skillset > div {
  min-height: 64px;
  padding-left: 84px;
}

.skill__logo {
  position: absolute;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-left: -84px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--hairline);
}

.skill__logo svg {
  width: 38px;
  height: 38px;
}

.book__page {
  fill: #e6effc;
  stroke: #2f6fd8;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.book__lines {
  fill: none;
  stroke: #2f6fd8;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}

.skillset dt {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.skillset dd {
  max-width: 40em;
  margin-top: 2px;
  color: var(--graphite);
}

/* AI engineering: Claude hands issues to Claude Code agents and gets results back */
.orch {
  --ok: #248a3d;
  --run: var(--link);
  --claude: #d97757;
  max-width: 400px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: var(--mist);
}

@media (prefers-color-scheme: dark) {
  .orch {
    --ok: #30d158;
  }
}

.skillset .orch {
  max-width: 400px;
  margin-top: 18px;
  -webkit-user-select: none;
  user-select: none; /* its labels shouldn't end up in copied text */
}

/* Phones: the panel uses the full width under the text */
@media (max-width: 759px) {
  .skillset .orch {
    margin-left: -84px;
  }
}

.orch__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.orch__links path {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}

.orch__spark,
.orch__bot,
.orch__go,
.orch__halo {
  fill: var(--claude);
}

.orch__spark,
.orch__halo {
  transform-box: fill-box;
  transform-origin: center;
}

.orch__halo,
.orch__go,
.orch__back {
  opacity: 0;
}

.orch__back {
  fill: var(--ok);
}

.orch__card {
  fill: var(--raised);
  stroke: var(--hairline);
  stroke-width: 1;
}

.orch__name {
  fill: var(--ink);
  font: 600 11.5px/1 var(--font);
  letter-spacing: -0.01em;
}

.orch__state {
  font: 500 10.5px/1 var(--font);
  text-anchor: end;
  opacity: 0;
}

.orch__state--queued { fill: var(--graphite); }
.orch__state--running { fill: var(--run); }
.orch__state--done { fill: var(--ok); }

.orch__track {
  fill: var(--hairline);
  opacity: 0.6;
}

.orch__bar {
  fill: var(--run);
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0);
}

/* Still picture (reduced motion): one agent done, one running, one queued */
.orch__agent--1 .orch__state--done,
.orch__agent--2 .orch__state--running,
.orch__agent--3 .orch__state--queued {
  opacity: 1;
}

.orch__agent--1 .orch__bar {
  fill: var(--ok);
  transform: scaleX(1);
}

.orch__agent--2 .orch__bar {
  transform: scaleX(0.55);
}

/* Learning now: logo chips */
.techs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tech {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 18px 6px 7px;
  border-radius: 980px;
  background: var(--mist);
  color: var(--ink);
}

.tech__logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tech__logo svg {
  width: 21px;
  height: 21px;
  overflow: visible;
}

.tech__logo--sql {
  --db: #2f6fd8;
  --db-fill: #e6effc;
}

@media (prefers-color-scheme: dark) {
  .tech__logo--sql {
    --db: #4c9dff;
    --db-fill: #1b2b44;
  }
}

.db__row,
.db__top {
  fill: var(--db-fill);
  stroke: var(--db);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.db__top {
  fill: var(--raised);
}

.tech__logo--api svg {
  fill: none;
  stroke: var(--graphite);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .orch__spark {
    animation: orch-spin 14s linear infinite;
  }

  .orch__halo {
    animation: orch-pulse 2.333s ease-out infinite;
  }

  .orch__agent * {
    animation-duration: 7s;
    animation-delay: var(--d);
    animation-iteration-count: infinite;
    animation-timing-function: linear;
  }

  .orch__agent .orch__go { animation-name: orch-go; }
  .orch__agent .orch__back { animation-name: orch-back; }
  .orch__agent .orch__bar { animation-name: orch-work; }
  .orch__agent .orch__card { animation-name: orch-card; }
  .orch__agent .orch__state--queued { animation-name: orch-queued; }
  .orch__agent .orch__state--running { animation-name: orch-running; }
  .orch__agent .orch__state--done { animation-name: orch-done; }

  .tech__logo--python svg {
    animation: py-swim 3.2s ease-in-out infinite;
  }

  .tech:hover .tech__logo--python svg {
    animation: py-spin 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .db__row {
    animation: db-scan 2.4s ease-in-out infinite;
  }

  .db__row--2 { animation-delay: 0.25s; }
  .db__row--3 { animation-delay: 0.5s; }

  .api__out { animation: api-out 2.4s ease-in-out infinite; }
  .api__in { animation: api-in 2.4s ease-in-out infinite; }

  /* Decorative motion stops while off screen (class set in main.js) */
  [data-anim].is-offscreen,
  [data-anim].is-offscreen * {
    animation-play-state: paused !important;
  }
}

@keyframes orch-spin {
  to { transform: rotate(360deg); }
}

@keyframes orch-pulse {
  0% { transform: scale(0.9); opacity: 0.22; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}

@keyframes orch-go {
  0% { transform: translate(102px, 92px); opacity: 0; }
  2% { opacity: 1; }
  14% { transform: translate(168px, var(--y)); opacity: 1; }
  15%, 100% { transform: translate(168px, var(--y)); opacity: 0; }
}

@keyframes orch-back {
  0%, 61% { transform: translate(168px, var(--y)); opacity: 0; }
  63% { opacity: 1; }
  75% { transform: translate(102px, 92px); opacity: 1; }
  76%, 100% { transform: translate(102px, 92px); opacity: 0; }
}

@keyframes orch-work {
  0%, 16% { transform: scaleX(0); fill: var(--run); opacity: 1; }
  60% { transform: scaleX(1); fill: var(--run); }
  62%, 90% { transform: scaleX(1); fill: var(--ok); opacity: 1; }
  97%, 100% { transform: scaleX(1); fill: var(--ok); opacity: 0; }
}

@keyframes orch-card {
  0%, 15% { stroke: var(--hairline); stroke-width: 1; }
  17%, 60% { stroke: var(--run); stroke-width: 1.5; }
  62%, 100% { stroke: var(--hairline); stroke-width: 1; }
}

@keyframes orch-queued {
  0%, 15% { opacity: 1; }
  16%, 93% { opacity: 0; }
  94%, 100% { opacity: 1; }
}

@keyframes orch-running {
  0%, 15% { opacity: 0; }
  16%, 60% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

@keyframes orch-done {
  0%, 60% { opacity: 0; }
  61%, 93% { opacity: 1; }
  94%, 100% { opacity: 0; }
}

@keyframes py-swim {
  0%, 100% { transform: translateY(1px) rotate(-10deg); }
  50% { transform: translateY(-1.5px) rotate(10deg); }
}

@keyframes py-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes db-scan {
  0%, 55%, 100% { fill: var(--db-fill); }
  15%, 30% { fill: var(--db); }
}

@keyframes api-out {
  0%, 100% { transform: translateX(-1px); }
  50% { transform: translateX(1.5px); }
}

@keyframes api-in {
  0%, 100% { transform: translateX(1px); }
  50% { transform: translateX(-1.5px); }
}

.langs {
  display: grid;
  gap: 14px;
}

.langs div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
}

.langs dt {
  font-weight: 600;
}

.langs dd {
  color: var(--graphite);
}

/* ---------- Certificates ---------- */
.certs {
  display: grid;
  gap: 20px;
  margin-top: 56px;
}

.cert {
  display: grid;
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 4.5vw, 56px);
  border-radius: var(--radius-l);
  background: var(--card);
}

@media (min-width: 760px) {
  .cert--feature {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 56px;
  }
}

.cert__thumb {
  display: block;
  width: min(100%, 220px);
}

.cert__thumb img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 16px 40px -12px rgba(0, 0, 0, 0.28);
  transition: transform 0.3s ease;
}

.cert__thumb:hover img {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .cert__thumb img {
    transition: none;
  }
}

.cert__title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.cert__text {
  max-width: 34em;
  margin-top: 12px;
  color: var(--graphite);
}

.cert__id {
  margin-top: 12px;
}

.cert .actions {
  margin-top: 20px;
}

.cert--pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: clamp(24px, 3.5vw, 36px);
}

.cert--pending .cert__text {
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 980px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--graphite);
  font-size: 0.875rem;
  font-weight: 500;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff9f0a;
}

/* ---------- Contact ---------- */
.contact {
  text-align: center;
}

.contact .lead {
  margin: 20px auto 0;
  text-wrap: balance;
}

.contact__email {
  margin-top: 20px;
}

/* Contact: Telegram, LinkedIn and GitHub logos, then the CV */
.contact__links {
  gap: 14px 16px;
}

.social {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.social:hover {
  background: var(--mist);
  transform: translateY(-2px);
}

.section--mist .social:hover {
  background: var(--raised);
}

.social img,
.social svg {
  width: 44px;
  height: 44px;
}

.social--github {
  color: var(--ink);
}

.social--github svg {
  fill: currentColor;
}

@media (min-width: 480px) {
  .contact__cv {
    margin-left: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social {
    transition: none;
  }

  .social:hover {
    transform: none;
  }
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 22px 30px;
  background: var(--mist);
  color: var(--graphite);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.footer__about {
  display: grid;
  gap: 4px;
}

/* Ukrainian flag, drawn in CSS: flag emoji don't render on Windows */
.flag-ua {
  display: inline-block;
  width: 16px;
  height: 11px;
  margin-right: 7px;
  border-radius: 2px;
  background: linear-gradient(#0057b7 50%, #ffd700 50%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  vertical-align: -1px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer a {
  color: var(--ink);
}

/* ==========================================================================
   Case study page
   ========================================================================== */
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
}

.back::before {
  content: "";
  width: 0.42em;
  height: 0.74em;
  margin-right: 0.4em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M6.8 1.2 1.2 7l5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M6.8 1.2 1.2 7l5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.cs-hero {
  padding-block: clamp(40px, 6vw, 72px) clamp(88px, 11vw, 150px);
}

.cs-hero .display {
  margin-top: clamp(32px, 5vw, 64px);
  max-width: 9em;
}

.cs-hero .lead {
  margin-top: 28px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  margin-top: clamp(64px, 8vw, 104px);
}

@media (min-width: 880px) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.facts div {
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.facts dt {
  color: var(--graphite);
  font-size: 0.875rem;
}

.facts dd {
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prose {
  max-width: 40em;
}

.prose p,
.prose ul {
  margin-top: 20px;
}

.prose p {
  font-size: 1.1875rem;
  line-height: 1.47;
  letter-spacing: -0.02em;
}

.ticks {
  display: grid;
  gap: 14px;
}

.ticks li {
  position: relative;
  padding-left: 30px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
}

.ticks li::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: calc(0.32em + 4.5px);
  width: 4px;
  height: 7.5px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

.ticks strong {
  font-weight: 600;
}

.ticks span {
  color: var(--graphite);
}

.callout {
  margin-top: 48px;
  padding: 24px 28px;
  border-radius: var(--radius-m);
  background: var(--mist);
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
}

.section--mist .callout {
  background: var(--paper);
}

/* Architecture diagram */
.arch {
  display: grid;
  gap: 14px;
  margin-top: 56px;
  font-size: 0.9375rem;
  line-height: 1.38;
}

.arch__row {
  display: grid;
  gap: 14px;
}

.node {
  padding: 18px 20px;
  border-radius: var(--radius-m);
  background: var(--mist);
}

.node--outline {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.node--accent {
  background: var(--blue);
  color: #fff;
}

.node--accent .node__text {
  color: #fff;
}

.node__title {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.node__text {
  margin-top: 4px;
  color: var(--graphite);
}

.arch__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--graphite);
  font-size: 0.8125rem;
}

.arch__link::before {
  content: "";
  width: 1px;
  height: 22px;
  background: var(--hairline);
}

.arch__host {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: calc(var(--radius-m) + 8px);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.arch__host-label {
  padding: 4px 6px 0;
  color: var(--graphite);
  font-size: 0.8125rem;
}

@media (min-width: 760px) {
  .arch__row--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .arch__row--split {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    align-items: stretch;
  }
}

.notes {
  display: grid;
  gap: 28px;
  margin-top: 56px;
}

@media (min-width: 760px) {
  .notes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
}

.notes p {
  margin-top: 6px;
  color: var(--graphite);
}

/* CI pipeline */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.pipeline li {
  padding: 8px 16px;
  border-radius: 980px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 0.9375rem;
  font-weight: 500;
}

.split {
  display: grid;
  gap: 56px;
  margin-top: 56px;
}

@media (min-width: 880px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 72px;
  }
}

.split .h3 {
  margin-bottom: 20px;
}

.bignum {
  font-size: clamp(4.5rem, 3rem + 7vw, 9rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.bignum__label {
  margin-top: 12px;
  font-size: clamp(1.1875rem, 1.04rem + 0.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.022em;
  color: var(--graphite);
}

/* 404 */
.notfound {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 52px - 80px);
  padding-block: 96px;
  text-align: center;
}

.notfound .lead {
  margin: 20px auto 0;
}

.pipeline__note {
  margin-top: 20px;
}

.arch > .arch__row--split {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

@media (max-width: 759px) {
  .arch > .arch__row--split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.cs-hero .display {
  text-wrap: balance;
}

.pipeline {
  gap: 10px 28px;
}

.pipeline li {
  position: relative;
}

.pipeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -18px;
  width: 6px;
  height: 10px;
  background: var(--graphite);
  transform: translateY(-50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1.2 1.2 6.8 7l-5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'%3E%3Cpath d='M1.2 1.2 6.8 7l-5.6 5.8' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

main:has(> .section--mist:last-child) + .footer {
  box-shadow: inset 0 1px 0 var(--hairline);
}

@media (max-width: 479px) {
  .pipeline {
    gap: 10px 22px;
  }

  .pipeline li {
    padding: 7px 12px;
  }

  .pipeline li:not(:last-child)::after {
    right: -15px;
  }
}

.section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
}

/* ---------- Agent workflow ---------- */
.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 980px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--label-ink);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0;
  white-space: nowrap;
}

.ticks .label {
  padding: 0 7px;
  font-size: 0.8em;
}

/* ==========================================================================
   Case study, visual pass
   ========================================================================== */
.cs-hero__grid {
  display: grid;
  gap: 56px;
  align-items: center;
  margin-top: clamp(24px, 4vw, 48px);
}

.cs-hero__grid .display {
  margin-top: 0;
}

.cs-hero__demo {
  margin-top: 0;
}

@media (min-width: 960px) {
  .cs-hero__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 72px;
  }
}

/* Photo gallery: swipe on phones, three columns on larger screens */
.gallery {
  position: relative; /* slide positions are measured from here */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78%, 320px);
  gap: 16px;
  margin-top: 56px;
  padding-bottom: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

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

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery figure {
  scroll-snap-align: center;
  scroll-snap-stop: always; /* one photo per swipe */
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-l);
}

.gallery .gallery__img--top {
  object-position: 50% 22%;
}


@media (min-width: 760px) {
  .gallery {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    overflow: visible;
  }
}

.section--mist .figures {
  margin-top: clamp(64px, 8vw, 96px);
}

/* Storyboard of a deal */
.story {
  display: grid;
  gap: 40px 20px;
  margin-top: 56px;
  counter-reset: story;
}

@media (min-width: 680px) {
  .story {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .story {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.story__item {
  counter-increment: story;
}

.story__screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  height: 250px;
  padding: 16px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: #f2f2f7;
  color: #1d1d1f;
  font-size: 14px;
  line-height: 1.34;
  letter-spacing: -0.012em;
}

.story__screen .msg--wide {
  width: 100%;
  max-width: 100%;
}

.story__screen .map {
  height: 92px;
}

.story__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.story__title::before {
  content: counter(story);
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.story__item > p {
  margin-top: 8px;
  color: var(--graphite);
}

.msg--relay {
  background: #e9f2fd;
}

.msg__from {
  color: #0066cc;
  font-size: 12.5px;
  font-weight: 600;
}

/* Nodes on a grey section */
.section--mist .node:not(.node--outline):not(.node--accent) {
  background: var(--paper);
}

/* Trust icons */
.icon-grid {
  display: grid;
  gap: 40px 48px;
  margin-top: 56px;
}

@media (min-width: 680px) {
  .icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.icon-grid p {
  margin-top: 6px;
  color: var(--graphite);
}

.icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-color-scheme: dark) {
  .icon {
    stroke: var(--link);
  }
}

/* Quality: big number + CI panel */
.quality {
  display: grid;
  gap: 56px;
  align-items: center;
}

@media (min-width: 900px) {
  .quality {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 72px;
  }
}

.quality__kinds {
  margin-top: 36px;
}

.checks {
  padding: 24px;
  border-radius: 24px;
  background: #1c1c1e;
  box-shadow: inset 0 0 0 1px #2c2c2e;
}

.checks__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
}

.checks__badge,
.checks__ok {
  position: relative;
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: #30d158;
}

.checks__badge {
  width: 36px;
  height: 36px;
}

.checks__ok {
  width: 18px;
  height: 18px;
}

.checks__badge::after,
.checks__ok::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28%;
  height: 50%;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

.checks__title {
  color: #f5f5f7;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.checks__sub {
  color: #86868b;
  font-size: 0.875rem;
}

.checks__list li {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: center;
  gap: 12px;
  padding-block: 13px;
  border-top: 1px solid #2c2c2e;
}

.checks__list b {
  color: #f5f5f7;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.checks__list span:last-child {
  justify-self: end;
  color: #86868b;
  font-size: 0.9375rem;
}

.checks__note {
  padding-top: 16px;
  border-top: 1px solid #2c2c2e;
  color: #86868b;
  font-size: 0.875rem;
}


@media (max-width: 679px) {
  .story__screen {
    height: auto;
  }
}

/* Approach: storyboard frames with mini UI */
@media (min-width: 1000px) {
  .flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px 24px;
  }
}

.frame {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 236px;
  padding: 16px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--mist);
  font-size: 13.5px;
  line-height: 1.38;
  letter-spacing: -0.01em;
}

@media (max-width: 679px) {
  .frame {
    height: auto;
  }
}

.mini {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--raised);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mini--row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.mini__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--graphite);
  font-size: 12.5px;
}

.mini__title {
  margin-top: 5px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.016em;
}

.mini__body {
  margin-top: 6px;
}

.mini .labels {
  margin-top: 10px;
}

.mini .label {
  font-size: 11.5px;
  padding: 2px 8px;
}

.state {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
}

.state--queued {
  background: #c7c7cc;
}

.lanes {
  margin-top: 6px;
}

.lane {
  display: grid;
  grid-template-columns: 8px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-block: 7px;
  border-top: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}

.lane:first-child {
  border-top: 0;
}

.lane span:not(.state) {
  color: var(--graphite);
}

.lane em {
  color: var(--graphite);
  font-size: 12px;
  font-style: normal;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}

.avatar--person {
  background: var(--ink);
  color: var(--paper);
}

.sketch {
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--mist);
  font-variant-numeric: tabular-nums;
}

.sketch div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sketch span {
  color: var(--graphite);
}

.sketch__new,
.sketch__new span {
  color: var(--link);
}

.commits {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.commits li {
  position: relative;
  padding-left: 20px;
}

.commits li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.38em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--blue);
  background: var(--raised);
}

.commits li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(0.38em + 10px);
  bottom: -12px;
  width: 1px;
  background: var(--hairline);
}

.mini-checks li {
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: center;
  gap: 10px;
  padding-block: 6px;
}

.mini-checks b {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.mini-checks em {
  justify-self: end;
  color: var(--graphite);
  font-size: 12px;
  font-style: normal;
}

.flow__caption {
  margin-top: 28px;
}

/* Approach: bento of setup facts */
.bento {
  display: grid;
  gap: 16px;
  margin-top: clamp(56px, 7vw, 88px);
}

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

  .tile--wide {
    grid-column: span 2;
  }
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 210px;
  padding: clamp(24px, 3vw, 32px);
  border-radius: var(--radius-l);
  background: var(--mist);
}

.tile > p:not(.tile__big):not(.tile__title):not(.labels) {
  margin-top: 10px;
  color: var(--graphite);
}

.tile__big {
  font-size: clamp(2.5rem, 1.9rem + 2vw, 3.5rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.tile__title {
  margin-bottom: 4px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.tile .labels {
  margin-top: 12px;
}

.tile .label {
  font-size: 0.8125rem;
  padding: 4px 10px;
}

.tile__big--word {
  font-size: clamp(2rem, 1.6rem + 1.3vw, 2.5rem);
  letter-spacing: -0.04em;
}

@media (max-width: 759px) {
  .tile {
    min-height: 0;
  }
}

/* ---------- Home: hero photo spans the whole text block ---------- */
@media (min-width: 880px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: stretch;
  }

  .hero__photo {
    position: relative;
    width: 100%;
    min-height: 100%;
  }

  .hero__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-position: 50% 30%;
  }
}

/* ---------- Home: small portrait next to the name on phones ----------
   The text wrapper is flattened (display: contents) so the role and the name
   share a two-column grid with the photo; everything else spans both columns.
<<<<<<< Updated upstream
   The photo fills the height of role + name (cropped around the face). */
=======
   The photo fills the height of role + name. Phones load a photo of their own
   (portrait-phone, a square head-and-shoulders shot), zoomed in a little. */
>>>>>>> Stashed changes
@media (max-width: 879.98px) {
  .hero__grid {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 0;
    align-items: start;
  }

  .hero__text {
    display: contents;
  }

  .hero__text > * {
    grid-column: 1 / -1;
  }

  .hero__role {
    grid-column: 1;
    grid-row: 1;
  }

  .hero .display {
    grid-column: 1;
    grid-row: 2;
    font-size: clamp(2.375rem, 1.1rem + 7.2vw, 4.5rem);
  }

  .hero__photo {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
    justify-self: end;
    position: relative;
    width: 100%;
    max-width: 168px;
    overflow: hidden;
    border-radius: 20px;
  }

  .hero__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
<<<<<<< Updated upstream
    object-position: 50% 30%;
=======
    object-position: 52% 30%;
    transform: scale(1.2);
    transform-origin: 52% 30%;
>>>>>>> Stashed changes
  }
}

/* ---------- Home: the problem the bot solves ---------- */
.problem {
  display: grid;
  gap: 36px;
  margin-top: clamp(64px, 8vw, 104px);
}

@media (min-width: 880px) {
  .problem {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
}

.problem__item p {
  margin-top: 8px;
  color: var(--graphite);
}

.problem__answer {
  margin-top: 44px;
  font-size: clamp(1.1875rem, 1.04rem + 0.6vw, 1.5rem);
  line-height: 1.36;
  font-weight: 500;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.section--stage .icon {
  stroke: var(--link);
}

/* A thin gap in the stage colour under a "crossed out" slash, so it reads apart from the sign */
.section--stage .icon .icon__knock {
  stroke: var(--stage);
  stroke-width: 4.4;
}

/* ---------- Home: big photo gallery ---------- */
.gallery--bleed {
  width: 100%;
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
  grid-auto-columns: 82%;
}

/* Page dots under the swipeable gallery (phones only; built in main.js) */
.gallery-dots {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.gallery-dots button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--hairline);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.gallery-dots button[aria-current="true"]::before {
  width: 22px;
  background: var(--ink);
}

.gallery-dots button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: 8px;
}

@media (min-width: 760px) {
  .gallery-dots {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-dots button::before {
    transition: none;
  }
}

@media (min-width: 760px) {
  .gallery--bleed {
    width: min(100% - 2 * var(--gutter), 1400px);
    padding-inline: 0;
    gap: 16px;
  }
}

/* ---------- Case study: before / after ---------- */
.versus {
  display: grid;
  gap: 24px;
  margin-top: 56px;
}

@media (min-width: 760px) {
  .versus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.versus__screen {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  height: 380px;
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: #e9e9ee;
  color: #1d1d1f;
  font-size: 14px;
  line-height: 1.34;
  letter-spacing: -0.012em;
}

.versus__side:last-child .versus__screen {
  justify-content: center;
  background: #f2f2f7;
  box-shadow: inset 0 0 0 2px #0071e3;
}

@media (max-width: 759px) {
  .versus__screen {
    height: auto;
  }
}

.versus__chat-title {
  align-self: center;
  margin-bottom: auto;
  padding: 4px 12px;
  border-radius: 980px;
  background: rgba(0, 0, 0, 0.06);
  color: #4a4a4f;
  font-size: 12px;
  font-weight: 600;
}

.versus__screen .msg--wide {
  width: auto;
  max-width: 88%;
}

.versus__side:last-child .msg--wide {
  width: 100%;
  max-width: 100%;
}

.versus figcaption {
  margin-top: 14px;
  color: var(--graphite);
}

.versus figcaption strong {
  color: var(--ink);
  font-weight: 600;
}

.msg__from--changer {
  color: #c93400;
}

.msg--alert {
  box-shadow: inset 3px 0 0 #ff3b30;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trust__chip {
  padding: 3px 9px;
  border-radius: 980px;
  background: #e3f6e8;
  color: #1a7f37;
  font-size: 12px;
  font-weight: 600;
}

.fixes {
  display: grid;
  gap: 36px;
  margin-top: 64px;
}

@media (min-width: 880px) {
  .fixes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
  }
}

.fixes li {
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.fixes__from {
  margin-bottom: 6px;
  color: var(--graphite);
  font-size: 0.875rem;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--graphite) 60%, transparent);
}

.fixes li > p:last-child {
  margin-top: 8px;
  color: var(--graphite);
}

/* ---------- Detailed bot demo ---------- */
@media (min-width: 880px) {
  .phone {
    width: 320px;
    height: 690px;
  }
}

.chat {
  transition: opacity 0.5s ease;
}

.chat.is-fading {
  opacity: 0;
}

.kb {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.kb--1 { grid-template-columns: minmax(0, 1fr); }
.kb--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kb--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kb--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kb--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.key {
  overflow: hidden;
  padding: 7px 4px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.kb--5 .key {
  padding-inline: 0;
  font-size: 12px;
}

.key.is-pressed {
  transform: scale(0.94);
  background: rgba(0, 113, 227, 0.24);
}

.key.is-chosen,
.key--primary {
  background: #0071e3;
  color: #fff;
}

.key.is-on {
  background: rgba(255, 159, 10, 0.16);
  color: #c45f00;
}

.tap {
  position: absolute;
  z-index: 6;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: rgba(29, 29, 31, 0.24);
  pointer-events: none;
  animation: tap 0.6s ease-out forwards;
}

@keyframes tap {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.5); opacity: 0; }
}

.ok {
  display: inline-block;
  position: relative;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
  border-radius: 50%;
  background: #30d158;
}

.ok::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

/* Message composer at the bottom of the phone */
.composer {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 16px;
  background: #fbfbfd;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.composer__field {
  display: flex;
  flex: 1;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  color: #1d1d1f;
  font-size: 14px;
}

.composer__placeholder {
  color: #aeaeb2;
}

.composer.is-typing .composer__placeholder {
  display: none;
}

.composer.is-typing .composer__text::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -2px;
  background: #0071e3;
  animation: caret 1s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

.composer__send {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0071e3;
  opacity: 0.35;
  transition: opacity 0.2s ease;
}

.composer__send::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: 8px;
  height: 8px;
  border: solid #fff;
  border-width: 2px 0 0 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.composer.is-typing .composer__send {
  opacity: 1;
}

/* ---------- Telegram look inside the phone ---------- */
.phone .chat {
  background-color: #c4d7a4;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.3) 1.1px, transparent 1.6px),
    linear-gradient(165deg, #d9e6b8 0%, #bdd39e 55%, #a7c38c 100%);
  background-size: 22px 22px, 100% 100%;
}

.chat-head__sub.is-typing {
  font-size: 0;
}

.chat-head__sub.is-typing::after {
  content: "typing\2026";
  color: #0071e3;
  font-size: 12px;
}

.chat-head__avatar--coins {
  background: none;
}

.chat-head__avatar--coins svg {
  width: 100%;
  height: 100%;
}

/* A bot message with its inline keyboard */
.post {
  align-self: flex-start;
  max-width: 84%;
  transform-origin: bottom left;
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.post--keys {
  width: 84%;
}

.post--full {
  width: 100%;
  max-width: 100%;
}

.post .msg {
  max-width: 100%;
}

.phone .msg {
  display: flow-root; /* keeps the floated time inside the bubble */
}

.post--keys .msg {
  width: 100%;
}

.msg__time {
  float: right;
  position: relative;
  top: 6px;
  margin-left: 10px;
  color: #a2a2a7;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.phone .msg--me {
  background: #e1ffc7;
  color: #1d1d1f;
}

.phone .msg--me .msg__time {
  color: #5aa55a;
}

.phone .msg--me .msg__time::after {
  content: "\2713\2713";
  margin-left: 3px;
  letter-spacing: -0.35em;
}

.ikb {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.ikb__row {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
}

.ikb .key {
  padding: 7px 3px;
  border-radius: 8px;
  background: rgba(57, 88, 36, 0.42);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

@media (max-width: 359px) {
  .ikb .key {
    padding-inline: 1px;
    font-size: 10.5px;
    letter-spacing: -0.02em;
  }
}

.ikb .key.is-pressed {
  background: rgba(40, 66, 24, 0.62);
  transform: scale(0.96);
}

.ikb .key.is-chosen {
  background: rgba(57, 88, 36, 0.42);
  color: #fff;
}

.ikb .key--ok,
.ikb .key--ok.is-chosen {
  background: rgba(58, 160, 64, 0.9);
}

.ikb .key.is-updated {
  background: rgba(255, 255, 255, 0.75);
  color: #1d1d1f;
  text-shadow: none;
}

.ikb .key.is-on {
  color: #ffd60a;
}

.msg__note {
  transition: background-color 0.4s ease;
}

.msg__note.is-updated {
  background: rgba(255, 214, 10, 0.35);
}

/* Mini App sheet with the map */
.sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.sheet-scrim.is-open {
  opacity: 1;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  height: 76%;
  padding: 8px 14px 18px;
  border-radius: 20px 20px 0 0;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(105%);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet.is-open {
  transform: none;
}

.sheet__grabber {
  align-self: center;
  width: 36px;
  height: 5px;
  margin-bottom: 10px;
  border-radius: 3px;
  background: #d1d1d6;
}

.sheet__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sheet__sub {
  color: #8e8e93;
  font-size: 12px;
}

.sheet__map {
  flex: 1;
  height: auto;
  margin: 12px 0 10px;
}

.sheet .map__pin {
  opacity: 0;
  transform: translate(-50%, -260%);
  transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.2s ease;
}

.sheet.is-pinned .map__pin {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.sheet__place {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.sheet__place span {
  color: #8e8e93;
}

.sheet__times {
  margin-top: 8px;
}

.sheet__btn {
  margin-top: 10px;
  padding: 11px;
  font-size: 15px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .tap,
  .composer.is-typing .composer__text::after {
    animation: none;
  }

  .sheet,
  .sheet-scrim,
  .chat {
    transition: none;
  }
}
