/* Layout: narrow single column, document-like; hero is the thesis alone; highlighter marks carry emphasis. */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --fg: #1c2540;
  --muted: #5f6781;
  --line: #e6dfd2;
  --ink: #007f95;
  --mark: #ffe45c;
  --mark-fg: #1c2540;
  --btn-bg: #76c457;
  --btn-fg: #14340d;
  --head-bg: #1c2540;
  --hover-bg: #fec50c;
  --hover-fg: #4a3300;
  --f-display: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --s-1: .8125rem; --s0: 1rem; --s1: 1.1875rem; --s2: 1.5rem; --s3: 2.125rem; --s4: clamp(2rem, 5.2vw, 3.25rem);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10141f; --surface: #181d2b; --fg: #e8ebf5; --muted: #9aa3bd; --line: #2b3247;
  --ink: #6ad6ea; --mark: #d9b81f; --mark-fg: #0e1217; --btn-bg: #76c457; --btn-fg: #14340d; --head-bg: #0a0d16; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #10141f; --surface: #181d2b; --fg: #e8ebf5; --muted: #9aa3bd; --line: #2b3247;
  --ink: #6ad6ea; --mark: #d9b81f; --mark-fg: #0e1217; --btn-bg: #76c457; --btn-fg: #14340d; --head-bg: #0a0d16; color-scheme: dark }

* { box-sizing: border-box; }
body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--bg); color: var(--fg); font: 400 var(--s0)/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
html[data-l="ru"] .en, html[data-l="en"] .ru { display: none !important; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
.nowrap { white-space: nowrap; }
.mark { background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 88%, transparent 88%); color: var(--mark-fg); padding: 0 .15em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: background-color .2s ease, box-shadow .2s ease; }
header.top.scrolled { --bg: var(--head-bg); --fg: #f3f5fb; --muted: #aeb7d1; --ink: #6ad6ea; --line: rgba(255, 255, 255, .16); --surface: rgba(255, 255, 255, .08); background: color-mix(in srgb, var(--head-bg) 94%, transparent); border-bottom-color: transparent; box-shadow: 0 2px 14px rgba(20, 26, 40, .18); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.logo { font: 500 var(--s0)/1 var(--f-mono); color: var(--fg); text-decoration: none; letter-spacing: -.01em; padding: 4px 6px; margin: -4px -6px; border-radius: 3px; background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 0% 100%; transition: background-size .35s cubic-bezier(.6, 0, .2, 1), color .2s ease; }
.logo::after { content: "_"; opacity: 0; }
.logo:hover, .logo:focus-visible { background-size: 100% 100%; color: var(--mark-fg); }
.logo:hover::after, .logo:focus-visible::after { animation: caret 1s steps(1) .35s infinite; }
@keyframes caret { 0% { opacity: 1; } 50% { opacity: 0; } }
.logo b { color: var(--ink); font-weight: 500; }

/* Sections */
section { padding-block: clamp(56px, 9vw, 96px); border-bottom: 1px solid var(--line); }
main > section:first-child { padding-top: clamp(32px, 5vw, 56px); }
h2 { font: 700 var(--s3)/1.15 var(--f-display); letter-spacing: -.02em; }
.sec-head { display: grid; gap: 14px; margin-bottom: 40px; max-width: 40rem; }
.lead { font-size: var(--s1); color: var(--muted); max-width: 36rem; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 88px) clamp(56px, 9vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 72px); align-items: center; }
.portrait { width: clamp(220px, 26vw, 300px); aspect-ratio: 1; max-width: 100%; border-radius: 50%; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
@media (max-width: 760px) {
  /* Photo stays on the right next to the name; lead and buttons run full width below */
  .hero .wrap { gap: 22px 16px; align-items: start; }
  .hero .hero-text { display: contents; }
  .hero h1 { grid-column: 1; grid-row: 1; align-self: center; }
  .portrait { grid-column: 2; grid-row: 1; width: clamp(96px, 28vw, 200px); }
  .hero .lead, .hero .ctas { grid-column: 1 / -1; }
}
.hero-text { display: grid; gap: 22px; min-width: 0; max-width: 46rem; }
h1 { display: grid; gap: 14px; }
h1 .name { font: 700 var(--s4)/1.05 var(--f-display); letter-spacing: -.03em; }
h1 .role { font: 500 clamp(1.25rem, 2.8vw, 1.875rem)/1.3 var(--f-display); letter-spacing: -.015em; max-width: 30ch; }
.hero .lead { color: var(--fg); opacity: .82; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 10px; font: 500 var(--s0)/1 var(--f-body); padding: 15px 22px; border-radius: 10px; text-decoration: none; background: var(--btn-bg); color: var(--btn-fg); position: relative; isolation: isolate; overflow: hidden; transition: transform .2s ease, box-shadow .25s ease; }
.btn .ico { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn.ghost { background: #a2cb8b; color: var(--btn-fg); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .25s ease; background: radial-gradient(circle 140px at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, .95), rgba(255, 255, 255, .35) 45%, rgba(255, 255, 255, 0) 75%); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(74, 148, 62, .6); }
  .btn:hover::before { opacity: 1; }
  .btn:active { transform: scale(.98); }
}


/* Services */
.services { display: grid; gap: 0; border-top: 1px solid var(--line); }
.svc { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px 32px; padding-block: 24px; border-bottom: 1px solid var(--line); align-items: baseline; }
.svc h3 { font: 600 var(--s1)/1.3 var(--f-body); }
.svc p { color: var(--muted); max-width: 36rem; }
@media (max-width: 760px) { .svc { grid-template-columns: 1fr; } }

/* About */
.about-body { display: grid; gap: 18px; font-size: var(--s1); max-width: 38rem; min-width: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }


/* Contact */
.contact { border-bottom: 0; }
.contact .wrap { display: grid; gap: 22px; }
.contact h2 { font-size: var(--s2); max-width: 24ch; }

footer { border-top: 1px solid var(--line); }
footer .wrap { padding-block: 26px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font: 400 var(--s-1)/1.4 var(--f-mono); }
footer a { color: inherit; text-decoration: none; transition: color .2s ease; }
footer a:hover { color: var(--ink); }

/* Header links: one segmented capsule. The current page wears the yellow marker;
   with JS (site.js) a single marker slides to the hovered item and back. */
.links { position: relative; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.links a { position: relative; z-index: 1; color: var(--fg); text-decoration: none; font-size: .9375rem; font-weight: 500; padding: 6px 14px; border-radius: 999px; white-space: nowrap; text-align: center; transition: color .25s ease; }
.links a[aria-current="page"] { background: var(--mark); color: var(--mark-fg); }
.links-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: var(--w, 0); border-radius: 999px; background: var(--mark); opacity: 0; transform: translateX(var(--x, 0)); transition: transform .35s cubic-bezier(.3, .7, .2, 1), width .35s cubic-bezier(.3, .7, .2, 1), opacity .2s ease; pointer-events: none; }
.links.has-ind .links-ind.on { opacity: 1; }
.links.has-ind a[aria-current="page"] { background: none; color: var(--fg); }
.links.has-ind a.is-on { color: var(--mark-fg); }

@media (max-width: 600px) {
  header.top .wrap { flex-wrap: wrap; row-gap: 10px; padding-block: 12px; }
  .links { order: 3; flex: 0 0 100%; }
  .links a { flex: 1; padding-inline: 8px; }
}

/* Inner pages */
.page-title { font: 700 var(--s3)/1.15 var(--f-display); letter-spacing: -.02em; text-wrap: balance; margin: 0; }
.svc h3 a { color: inherit; text-decoration: none; }
.svc h3 a::after { content: " \2192"; color: var(--ink); }
.svc h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.more { margin-top: 28px; font-size: var(--s1); }

/* Language switch (footer) */
.lang { display: inline-flex; gap: 16px; }
.lang button { font: inherit; letter-spacing: .02em; border: 0; background: transparent; color: var(--muted); padding: 0; cursor: pointer; }
.lang button[aria-pressed="true"] { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.lang button:hover { color: var(--ink); }

/* Quick contact icons: appear in the header once the page is scrolled */
.quick { display: flex; gap: 8px; opacity: 0; visibility: hidden; transform: translateX(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
header.top.scrolled .quick { opacity: 1; visibility: visible; transform: none; }
.quick a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.quick .ico { width: 18px; height: 18px; fill: currentColor; }
@media (hover: hover) { .quick a:hover { background: var(--hover-bg); border-color: var(--hover-bg); color: var(--hover-fg); } }
@media (max-width: 600px) { .quick { order: 2; } }

/* Dark band to separate blocks on the home page (same navy as the scrolled header) */
.band { --bg: var(--head-bg); --fg: #f3f5fb; --muted: #aeb7d1; --ink: #6ad6ea; --line: rgba(255, 255, 255, .16); background: var(--bg); color: var(--fg); border-bottom-color: transparent; }
.band { padding-block: clamp(32px, 5vw, 48px); }
.band .ctas { display: grid; grid-template-columns: minmax(0, 320px); }
.band .btn { justify-content: center; }
.band .cards { grid-template-columns: minmax(0, 420px); }
.cards .btn { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 8px; padding: 18px 22px; }
.cards .btn b { font-weight: 600; }
.cards .btn small { font: 400 var(--s-1)/1.35 var(--f-body); opacity: .8; }
.contacts h2 { font-size: var(--s2); margin-bottom: 24px; }
.contacts .ctas { grid-template-columns: minmax(0, 180px); }
.contacts .btn { justify-content: center; padding-block: 11px; font-size: .9375rem; font-weight: 400; }

/* Timeline (About page) */
.history { border-bottom: 0; }
.history h2 { font-size: var(--s2); margin-bottom: 32px; }
.timeline, .tl-sub { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px; max-width: 40rem; }
.timeline > li { position: relative; padding-left: 28px; display: grid; gap: 8px; }
.timeline > li::before { content: ""; position: absolute; left: 0; top: .45em; width: 11px; height: 11px; border-radius: 50%; background: var(--btn-bg); }
.timeline > li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 1.6em; bottom: -32px; width: 1px; background: var(--line); }
.tl-date { font: 500 var(--s-1)/1.4 var(--f-mono); color: var(--muted); }
.timeline h3 { font: 600 var(--s1)/1.3 var(--f-display); letter-spacing: -.01em; }
.timeline h4 { font: 600 var(--s0)/1.4 var(--f-body); margin: 0; }
.timeline ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.tl-sub { gap: 20px; margin-top: 6px; }
.tl-sub > li { display: grid; gap: 4px; padding-left: 16px; border-left: 2px solid var(--line); }

/* Client logos: one full-width row. site.js adds .is-moving when the row overflows;
   then the second (duplicate) track is shown and both slide left for a seamless loop. */
.brands { background: #fff; padding-block: clamp(24px, 4vw, 40px); border-top: 1px solid var(--line); }
.marquee { display: flex; justify-content: center; overflow: hidden; }
.marquee-track { list-style: none; margin: 0; padding: 0 8px; display: flex; gap: 16px; flex: none; }
.marquee-track[aria-hidden] { display: none; }
.marquee.is-moving { justify-content: flex-start; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee.is-moving .marquee-track { padding: 0 16px 0 0; animation: marquee var(--dur, 40s) linear infinite; }
.marquee.is-moving .marquee-track[aria-hidden] { display: flex; }
.marquee.is-moving:hover .marquee-track { animation-play-state: paused; }
.marquee-track li { flex: none; width: 180px; height: 90px; overflow: hidden; }
.marquee-track img { display: block; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 0 3px 0); }
@keyframes marquee { to { transform: translateX(-100%); } }
