/* ==========================================================================
   style.css — читаемая типографика, светлая тема, адаптив.
   ========================================================================== */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eef1f6;
  --text: #16181d;
  --text-muted: #545a66;
  --border: #d9dee7;
  --accent: #1f5fd0;
  --accent-hover: #17489e;
  --accent-soft: #e8effc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);

  --measure: 72ch;
  --radius: 14px;
  --gap: 1.5rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-hover); }

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.25;
}
.brand strong { font-size: 1.06rem; letter-spacing: -.01em; }
.brand span { font-size: .82rem; color: var(--text-muted); }

.nav { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .5rem .7rem;
  border-radius: 9px;
}
.nav a:hover { background: var(--surface-alt); color: var(--accent); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-hover); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: .7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* ---------- Layout blocks ---------- */
main { display: block; }

.section { padding: 3.25rem 0; }
.section--tight { padding: 2rem 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: var(--measure); margin-bottom: 1.75rem; }
.section-head h2 { margin: 0 0 .5rem; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin: 0 0 .75rem; }
h3 { font-size: 1.18rem; margin: 0 0 .5rem; }
h4 { font-size: 1rem; margin: 0 0 .35rem; }

p { margin: 0 0 1rem; max-width: var(--measure); }
.lead { font-size: 1.12rem; color: var(--text-muted); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: var(--accent-soft);
  padding: .3rem .7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 2.5rem; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.hero p { font-size: 1.1rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .97rem; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list a { font-weight: 600; word-break: break-word; }
.contact-list .label {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

/* ---------- Stats ---------- */
.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-align: center;
}
.stats b { display: block; font-size: 1.7rem; line-height: 1.2; color: var(--accent); }
.stats span { font-size: .9rem; color: var(--text-muted); }

/* ---------- Filter ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filters button {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filters button:hover { border-color: var(--accent); color: var(--accent-hover); }
.filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Project grid ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(16,24,40,.12); }

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  overflow: hidden;
}
.project-card__media img { width: 100%; height: 100%; object-fit: cover; }

.project-card__body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.project-card__body h3 { margin-bottom: .35rem; }
.project-card__body h3 a { color: var(--text); text-decoration: none; }
.project-card__body h3 a:hover { color: var(--accent); text-decoration: underline; }
.project-card__genre { font-size: .92rem; color: var(--text-muted); margin: 0 0 .75rem; }
.project-card__desc { font-size: .97rem; margin: 0 0 1rem; }

.platforms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1rem;
  padding: 0;
}
.platforms li {
  font-size: .79rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .2rem .6rem;
}

.project-card__links { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.link-pill:hover { background: var(--accent); color: #fff; }

/* ---------- Project detail ---------- */
.project-hero { padding: 2.5rem 0 1.5rem; }
.breadcrumbs { font-size: .92rem; margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li::after { content: "/"; margin-left: .4rem; color: var(--text-muted); }
.breadcrumbs li:last-child::after { content: ""; }

.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 600; }

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.25rem;
  align-items: start;
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0d12;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #0b0d12;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.video-play img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .55;
}
.video-play__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--accent-hover);
  font-size: 1.6rem;
  padding-left: 5px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  transition: transform .15s ease;
}
.video-play:hover .video-play__icon { transform: scale(1.08); }
.video-play__label {
  position: absolute;
  bottom: 1rem;
  color: #fff;
  font-size: .92rem;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.gallery figure { margin: 0; }
.gallery img {
  border-radius: 12px;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  cursor: zoom-in;
}
.gallery figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .4rem; }

/* Portrait (phone) store screenshots: show the whole frame, not a 16:9 crop */
.gallery--portrait { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery--portrait img { aspect-ratio: 9 / 19; object-fit: cover; object-position: top; }
.project-card__media--portrait img { object-fit: cover; object-position: center 30%; }

.feature-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.feature-list li { position: relative; padding: .45rem 0 .45rem 1.9rem; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: .35rem;
  top: 1.05rem;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar { display: grid; gap: 1.25rem; }
.sidebar .card h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.meta-list { list-style: none; margin: 0; padding: 0; font-size: .96rem; }
.meta-list li { padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.meta-list li:last-child { border-bottom: 0; }
.meta-list b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.link-list a { font-weight: 600; }

/* ---------- CV ---------- */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.timeline > li {
  position: relative;
  padding: 0 0 2rem 1.6rem;
  border-left: 2px solid var(--border);
}
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: .45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}
.timeline .period { font-size: .88rem; font-weight: 700; color: var(--accent-hover); }
.timeline .role { margin: .1rem 0 .15rem; }
.timeline .company { font-weight: 700; color: var(--text); margin: 0 0 .5rem; }
.timeline ul.bullets { list-style: none; margin: 0; padding: 0; }
.timeline ul.bullets li { position: relative; padding: .3rem 0 .3rem 1.5rem; max-width: var(--measure); }
.timeline ul.bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.timeline .note { font-size: .95rem; color: var(--text-muted); margin: .35rem 0 0; }

.skill-tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.skill-tags li {
  font-size: .92rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .75rem;
}

.cv-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.25rem; align-items: start; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.info-block { max-width: var(--measure); }
.info-block h3 { margin-top: 1.75rem; }
.info-block h3:first-child { margin-top: 0; }

/* ---------- Value proposition ---------- */
.value-head { max-width: var(--measure); margin-bottom: 1.5rem; }
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
}
.value-card h3 { font-size: 1.08rem; margin-bottom: .5rem; }
.value-card p { margin: 0; font-size: .97rem; color: var(--text); }

.track-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.track-tabs button {
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: .6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.track-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Skill groups ---------- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
}
.skill-group h3 {
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .75rem;
}
.skill-group .skill-tags li { font-size: .88rem; padding: .3rem .6rem; }

/* ---------- Project detail extras ---------- */
.detail-section { margin-top: 2.5rem; }
.project-context { font-size: .95rem; color: var(--text-muted); margin-top: -.5rem; }
.video-fallback { font-size: .9rem; color: var(--text-muted); margin-top: .6rem; }

.project-card__badge {
  position: absolute; top: .75rem; left: .75rem;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: 999px;
}
.link-pill--primary { background: var(--accent); color: #fff; }
.link-pill--primary:hover { background: var(--accent-hover); }

.timeline .job-summary { font-size: .98rem; color: var(--text-muted); margin: 0 0 .6rem; max-width: var(--measure); }

/* ---------- Case study (STAR) ---------- */
.case-study {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: 1.25rem;
}
.case-study__head h3 { font-size: 1.35rem; margin: 0; }
.case-study__head .eyebrow { margin-bottom: .6rem; }
.case-study__body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 1.75rem;
  margin-top: 1.25rem;
  align-items: start;
}
.case-study__media { margin: 0; }
.case-study__media img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b0d12;
  cursor: zoom-in;
}
.case-study__media figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }
.case-study__steps { display: grid; gap: 1rem; }
.case-study__step h4 {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-hover); margin: 0 0 .25rem;
}
.case-study__step p { margin: 0; font-size: .98rem; }

@media (max-width: 800px) {
  .case-study__body { grid-template-columns: 1fr; }
  .case-study__media { max-width: 340px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.25rem 0;
  margin-top: 2rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.footer-inner p { margin: 0; font-size: .93rem; color: var(--text-muted); max-width: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { font-weight: 600; font-size: .93rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, .92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 200;
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 10px; }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
  color: #16181d;
  border: 0;
  border-radius: 999px;
  padding: .5rem 1rem;
  cursor: pointer;
}
.lightbox__caption {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #e9edf4;
  font-size: .95rem;
  padding: 0 1.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero__grid,
  .project-layout,
  .cv-grid,
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .header-inner { flex-wrap: wrap; padding: .6rem 0; min-height: 0; }
  .nav { width: 100%; }
  .nav a { padding: .45rem .55rem; font-size: .9rem; }
  .section { padding: 2.25rem 0; }
  .hero { padding: 2.25rem 0 1.75rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
}

@media print {
  .site-header, .site-footer, .filters, .btn { display: none; }
  body { background: #fff; font-size: 12pt; }
}
