/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #fdfdfd;
  --dark:      #222222;
  --muted:     #909090;
  --divider:   #dcdcdc;
  --chip-bg:   #eaeaea;
  --item-bg:   #f7f7f7;
  --white:     #ffffff;
  --cta-bg:    rgba(142,255,142,0.4);
  --link-deco: rgba(34,34,34,0.4);
  --card-back: #dbdbdb;
  --card-glow:       rgba(255,132,230,0.04);
  --card-glow-hover: rgba(255,132,230,0.09);

  --font: 'PP Neue Montreal', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --text-sm:   18px;
  --text-md:   20px;
  --text-lg:   32px;
  --line-t:    1.2;
  --line-n:    1.6;

  --pad:       40px;
  --col-left:  427px;
  --gap:       40px;
  --max-w:     1440px;
}

/* ── Dark theme overrides ────────────────────── */
html.dark {
  --bg:        #111111;
  --dark:      #ebebeb;
  --muted:     #909090;
  --divider:   #4a4a4a;
  --chip-bg:   #1e1e1e;
  --item-bg:   #1a1a1a;
  --white:     #1a1a1a;
  --cta-bg:    rgba(50,83,50,0.4);
  --link-deco: rgba(235,235,235,0.4);
  --card-back: #272727;
  --card-glow:       rgba(255,132,230,0.07);
  --card-glow-hover: rgba(255,132,230,0.13);
}

body {
  background: var(--bg);
  font-family: var(--font);
  font-weight: 500;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}

/* ── Page sections — start hidden, JS animates in ── */
.section, .skills, .footer {
  opacity: 0;
  transform: translateY(80px);
  will-change: opacity, transform;
}

/* Smooth theme transition — applied only during toggle */
html.theme-switching,
html.theme-switching * {
  transition:
    color .25s ease,
    background-color .25s ease,
    border-color .25s ease,
    box-shadow .25s ease,
    opacity .25s ease !important;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── Wrapper ─────────────────────────────────── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}


/* ── Header ─────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  display: flex; gap: var(--gap); align-items: center;
  padding: 20px var(--pad);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background .3s;
  will-change: transform;
}

.header__title {
  flex-shrink: 0;
  width: var(--col-left);
  display: flex;
  gap: var(--gap);
  font-size: var(--text-sm);
  line-height: var(--line-n);
}

.header__name { color: var(--dark); }

.header__info {
  display: flex; flex-direction: column;
  color: var(--dark);
}
.header__info span:last-child { color: var(--muted); }


.header__nav {
  flex: 1;
  display: flex; align-items: center; justify-content: flex-start;
  font-size: var(--text-sm);
  line-height: var(--line-n);
}

.header__links {
  display: flex; gap: 12px; align-items: center;
  text-transform: uppercase;
}

.header__cta {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  transition: opacity 0.5s cubic-bezier(.23,1,.32,1), visibility 0.5s cubic-bezier(.23,1,.32,1);
}
.header__cta.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.header__links a { color: var(--dark); transition: color .2s, opacity .2s; }
.header__links a:hover { color: var(--muted); opacity: 0.6; }

.theme-toggle {
  background: none; border: none; padding: 0;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  opacity: .8; transition: opacity .2s;
  position: relative;
  color: var(--dark);
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.theme-toggle:hover { opacity: 1; }
.theme-icon {
  position: absolute;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.8s cubic-bezier(.16,1,.3,1), opacity 0.6s cubic-bezier(.16,1,.3,1);
}
.theme-icon svg { width: 24px; height: 24px; display: block; }
.theme-icon--sun  { transform: rotate(0deg) scale(1); opacity: 1; }
.theme-icon--moon { transform: rotate(60deg) scale(0.3); opacity: 0; }
html.dark .theme-icon--sun  { transform: rotate(-60deg) scale(0.3); opacity: 0; }
html.dark .theme-icon--moon { transform: rotate(0deg) scale(1); opacity: 1; }

/* ── Hero section ────────────────────────────── */
.hero {
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + 120px);
  min-height: 100vh;
  box-sizing: border-box;
}

.hero__body {
  display: flex; gap: var(--gap); align-items: flex-start;
}

/* Profile frame: sized to the visible card stack */
.profile-frame {
  flex-shrink: 0;
  width: var(--col-left);
  height: 183px;
  border-radius: 16px;
  overflow: visible;
  position: relative;
  perspective: 900px;
  user-select: none;
  -webkit-user-select: none;
}

/* Card shuffle keyframes — vertical depth stack with shuffle animation */

/* Front → Hidden: arc up high, fade out completely */
@keyframes shuffleToHidden {
  0%   { transform: translate(-50%, -50%) scale(1);                                          opacity: 1; }
  22%  { transform: translate(calc(-50% + 36px), calc(-50% - 32px)) scale(1.06);            opacity: 1; }
  60%  { opacity: 0.08; }
  100% { transform: translate(-50%, calc(-50% + 28px)) scale(0.803);                        opacity: 0; }
}

/* Hidden → Back: fade in at back position */
@keyframes shuffleToBack {
  0%   { transform: translate(-50%, calc(-50% + 28px)) scale(0.803); opacity: 0; }
  100% { transform: translate(-50%, calc(-50% + 28px)) scale(0.803); opacity: 1; }
}

/* Middle → Front: rise up and expand */
@keyframes shuffleToFront {
  0%   { transform: translate(-50%, calc(-50% + 16px)) scale(0.897); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Back → Middle: step forward */
@keyframes shuffleToMiddle {
  0%   { transform: translate(-50%, calc(-50% + 28px)) scale(0.803); }
  100% { transform: translate(-50%, calc(-50% + 16px)) scale(0.897); }
}

.photo-card {
  position: absolute;
  width: 134px; height: 183px;
  background: #fff;
  border-radius: 8px;
  top: 50%; left: 50%;
  overflow: hidden;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(.23,1,.32,1), box-shadow 0.25s ease;
}

/* Tint overlay for depth */
.photo-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-tint, transparent);
  pointer-events: none;
  transition: background 0.6s;
}

.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  display: block;
}

/* Initial positions — centered depth stack */
#cardA { transform: translate(-50%, -50%) scale(1);                   z-index: 4; box-shadow: 0 0 40px 0px var(--card-glow); --card-tint: transparent; }
#cardB { transform: translate(-50%, calc(-50% + 16px)) scale(0.897); z-index: 3; --card-tint: rgba(0,0,0,0.45); }
#cardC { transform: translate(-50%, calc(-50% + 28px)) scale(0.803); z-index: 2; --card-tint: rgba(0,0,0,0.65); }
#cardD { transform: translate(-50%, calc(-50% + 28px)) scale(0.803); z-index: 1; --card-tint: rgba(0,0,0,0.65); opacity: 0; }

/* Hero content */
.hero__content {
  flex: 1;
  display: flex; flex-direction: column; gap: var(--gap);
  min-width: 0;
}

.hero__text {
  display: flex; flex-direction: column; gap: 20px;
  font-size: var(--text-lg);
  line-height: var(--line-t);
  color: var(--dark);
}

.hero__cta {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: flex-start;
  padding: 8px 24px;
  background: var(--cta-bg);
  border-radius: 100px;
  font-size: var(--text-sm);
  color: #00b200;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(.23,1,.32,1), background 0.25s ease;
}
.hero__cta:hover {
  transform: scale(1.05);
  background: rgba(142,255,142,0.6);
}
html.dark .hero__cta:hover { background: rgba(50,83,50,0.65); }

.hero__links {
  display: flex; flex-direction: row; gap: 16px; flex-wrap: wrap;
  font-size: var(--text-sm);
  line-height: var(--line-n);
}

/* Mobile-only hero elements — hidden on desktop */
.hero__subtext-mobile { display: none; }
.hero__mobile-cta { display: none; }
.hero__cta--inline { display: inline-flex; }
.hero__desktop-note { display: none; }
.hero__links a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--link-deco);
  text-underline-offset: 3px;
  color: var(--dark);
  width: fit-content;
}
.hero__links a { transition: opacity .2s; }
.hero__links a:hover { text-decoration-color: var(--dark); opacity: 0.55; }

/* ── Section wrapper ─────────────────────────── */
.section {
  padding: 80px 0;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Section heading row (Career Path, Side Activity, etc.) */
.section__heading-row {
  display: flex; gap: var(--gap); align-items: center;
  padding: 0 var(--pad) var(--pad);
}

.section__heading-spacer {
  flex-shrink: 0;
  width: var(--col-left);
}

.section__heading {
  flex: 1;
  font-size: var(--text-lg);
  line-height: var(--line-t);
  color: var(--dark);
  font-weight: 500;
}

/* Items list */
.section__items {
  display: flex; flex-direction: column; gap: 80px;
  padding: 0 var(--pad);
}

/* ── Work item ───────────────────────────────── */
.item {
  display: flex; gap: var(--gap); align-items: flex-start;
}

/* Left info column */
.item__info {
  flex-shrink: 0;
  width: var(--col-left);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--pad) 0;
  min-height: 640px;
}

.item__top { display: flex; flex-direction: column; gap: 16px; }

.item__company-row {
  display: flex; gap: 16px; align-items: center;
}

.item__logo {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
}
.item__logo img { max-width: 30px; max-height: 30px; object-fit: contain; }

.item__company-text { display: flex; flex-direction: column; }
.item__company-name {
  font-size: var(--text-md);
  color: var(--dark);
  line-height: var(--line-n);
}
.item__company-sub {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--line-n);
}

.item__desc {
  font-size: var(--text-sm);
  color: var(--dark);
  line-height: var(--line-t);
}

/* Meta rows at bottom */
.item__meta { display: flex; flex-direction: column; gap: 16px; }

.item__meta-row {
  display: flex; gap: 20px; align-items: flex-start;
  font-size: var(--text-sm);
  line-height: var(--line-t);
}
.item__meta-label {
  flex-shrink: 0;
  width: 95px;
  color: var(--muted);
}
.item__meta-value {
  flex: 1;
  color: var(--dark);
  display: flex; flex-wrap: wrap; gap: 8px 12px;
}

.item__meta-pair {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.item__meta-pair .item__meta-row:first-child {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
}

.item__meta-pair .item__meta-row:last-child {
  padding-top: 16px;
}

.item__divider {
  height: 1px;
  background: var(--divider);
  width: 100%;
}

/* Right screenshots panel */
.item__shots {
  flex: 1;
  height: 640px;
  background: var(--item-bg);
  overflow: hidden;
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.item__shots::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.4s ease;
  z-index: 10;
  pointer-events: none;
}

.item__shots:hover::after {
  background: rgba(0, 0, 0, 0.04);
}

html.dark .item__shots:hover::after {
  background: rgba(255, 255, 255, 0.04);
}

.shots-zoom {
  position: absolute;
  inset: 0;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.6s cubic-bezier(.23, 1, .32, 1);
}

.item__shots:hover .shots-zoom {
  transform: scale(1.04);
}

.shots-wrap {
  position: absolute;
  inset: 0;
}

/* Absolute screenshots inside */
.item__shots img {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  object-fit: cover;
  pointer-events: none;
  display: block;
  will-change: transform;
}

/* Sberbank diagonal screenshot layout */
.sber-shot {
  width: 220px;
  height: 475px;
}
.sber-shot--1 { left: 77px;  top: -74px; }
.sber-shot--2 { left: 337px; top: 82px; }
.sber-shot--3 { left: 597px; top: 238px; }

.sber-also-covering {
  position: absolute;
  bottom: 20px; right: 20px;
  background: rgba(34,34,34,0.04);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 8px 16px;
  text-align: right;
  font-size: 12px;
  color: var(--dark);
  line-height: 1.2;
  z-index: 11;
}
html.dark .sber-also-covering {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.sber-also-covering p { margin: 0; }

/* ── Skills section ──────────────────────────── */
.skills {
  padding: 80px 0;
  min-height: 100vh;
  box-sizing: border-box;
}

.skills__chips-row {
  display: flex; gap: var(--gap); align-items: flex-start;
  padding: 0 var(--pad);
}

.skills__chips-spacer {
  flex-shrink: 0;
  width: var(--col-left);
}

.skills__chips {
  flex: 1;
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: var(--pad) 0;
}

.skills__cta-row {
  display: flex; gap: var(--gap);
  padding: 0 var(--pad) var(--pad);
}

.btn-dark {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px;
  background: var(--dark);
  color: var(--bg);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(.23,1,.32,1), opacity 0.25s ease;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 16px 24px;
  background: var(--chip-bg);
  border-radius: 40px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--dark);
  white-space: nowrap;
  line-height: var(--line-t);
}

/* ── Footer ──────────────────────────────────── */
.footer {
  padding: var(--pad);
  display: flex; flex-direction: column; gap: var(--gap);
  box-sizing: border-box;
}

.footer__divider {
  height: 1px;
  background: var(--divider);
}

.footer__body {
  display: flex; gap: var(--gap); align-items: flex-start;
}

.footer__spacer {
  flex-shrink: 0;
  width: var(--col-left);
}

.footer__contact {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: space-between;
  height: 325px;
}

.footer__heading {
  font-size: var(--text-lg);
  color: var(--dark);
  line-height: var(--line-t);
  width: 900px;
  max-width: 100%;
}

.footer__links-grid {
  display: flex; gap: 20px;
  font-size: var(--text-sm);
  line-height: var(--line-n);
  white-space: nowrap;
}

.footer__links-col {
  flex: 1;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.footer__links-col a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--link-deco);
  text-underline-offset: 3px;
  width: fit-content;
  transition: opacity .2s;
}
.footer__links-col a:hover { text-decoration-color: var(--dark); opacity: 0.55; }

.footer__meta {
  display: flex; gap: 12px; align-items: center;
  font-size: var(--text-sm);
  line-height: var(--line-n);
  white-space: nowrap;
}
.footer__meta span { text-transform: uppercase; }
#local-time { display: inline-block; width: 8ch; }
.footer__meta .capitalize { text-transform: capitalize; }



/* ── Reveal ──────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1),
              transform .5s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.btn-dark:hover { transform: translateY(0) scale(1.05); opacity: 0.75; }

/* ── Custom cursor pill ─────────────────────── */
.item__shots { cursor: none; }

.cursor-pill {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  background: #ffffff;
  color: #000000;
  mix-blend-mode: difference;
  padding: 10px 18px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translate(14px, -50%);
  transition: opacity 0.18s ease;
  will-change: left, top;
}

.cursor-pill.visible { opacity: 1; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1100px) {
  :root { --col-left: 320px; }
}

@media (max-width: 800px) {
  :root {
    --pad:      20px;
    --gap:      24px;
    --col-left: 100%;
    --text-lg:  24px;  /* section headings, footer heading */
    --text-md:  20px;  /* company names */
    --text-sm:  18px;  /* body / descriptions / links */
  }

  /* ── Header ── */
  .header { padding: 16px var(--pad); gap: 12px; }
  .header__title { width: auto; flex: 1; gap: 12px; }
  .header__info { display: none; }
  .header__name { white-space: nowrap; }
  .header__nav { flex: 0 0 auto; }
  .header__links a { display: none; }
  .header__cta { display: none; }

  /* ── Hero — centered mobile landing ── */
  .hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    min-height: calc(100vh - 52px);
    padding: 40px var(--pad);
  }
  .hero__body { flex-direction: column; align-items: center; gap: 40px; width: 100%; }
  .profile-frame { width: 100px; height: 138px; flex-shrink: 0; border-radius: 4px; overflow: visible; }
  .photo-card { width: 88px; height: 120px; border-radius: 5px; }
  #cardA { transform: translate(-50%, -50%) scale(1); }
  #cardB { transform: translate(-50%, calc(-50% + 10px)) scale(0.897); --card-tint: rgba(0,0,0,0.45); }
  #cardC { transform: translate(-50%, calc(-50% + 18px)) scale(0.803); --card-tint: rgba(0,0,0,0.65); display: block; }
  #cardD { transform: translate(-50%, calc(-50% + 18px)) scale(0.803); --card-tint: rgba(0,0,0,0.65); display: block; opacity: 0; }
  .hero__content { flex: none; width: 100%; display: flex; flex-direction: column; gap: 20px; align-items: center; }
  .hero__text { font-size: 18px; gap: 8px; text-align: center; align-items: center; }
  .hero__subtext-desktop { display: none; }
  .hero__subtext-mobile { display: block; }
  .hero__links { flex-direction: row; flex-wrap: nowrap; gap: 16px; justify-content: center; }
  .hero__links a { font-size: 16px; white-space: nowrap; }
  .hero__mobile-cta { display: flex; width: 100%; align-self: stretch; justify-content: center; }
  .hero__cta--inline { display: none; }
  .hero__desktop-note {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
  }

  /* ── Hide all sections below hero on mobile — one-page design ── */
  .section--career { display: none; }
  .section { display: none; }
  .skills { display: none; }
  .footer { display: none; }

  /* ── Work sections ── */
  .section__items { gap: 80px; }
  .item { flex-direction: column; gap: 16px; }
  .item__info { min-height: unset; width: 100%; gap: 16px; padding: 0; }
  .item__top { gap: 12px; }
  .item__shots { width: 100%; height: 235px; flex: 0 0 235px; order: -1; }
  .shots-wrap { transform: scale(0.367); transform-origin: top left; }
  .sber-shots .shots-zoom { transform: scale(0.367); transform-origin: top left; }
  .sber-shots:hover .shots-zoom { transform: scale(0.367); }

  /* Item font sizes */
  .item__company-name { font-size: 16px; }
  .item__company-sub { font-size: 14px; }
  .item__desc { font-size: 16px; }
  .item__meta { gap: 8px; }
  .item__meta-row { font-size: 16px; }
  .item__meta-label { font-size: 14px; width: auto; }

  /* Period+Role side by side */
  .item__meta-pair { display: flex; gap: 17px; align-items: flex-start; width: 100%; }
  .item__meta-pair .item__meta-row { flex: 1 0 0; flex-direction: column; gap: 4px; }
  .item__meta-pair .item__meta-label { width: auto; }

  /* Scope row stacked */
  .item__meta-scope { flex-direction: column; gap: 4px; }
  .item__meta-scope .item__meta-value { gap: 0 8px; }

  /* ── Section heading ── */
  .section__heading-spacer { display: none; }

  /* ── Skills ── */
  .skills { padding: 40px 0; min-height: unset; }
  .skills .section__heading-row { padding: 16px var(--pad) 40px !important; }
  .skills__chips-spacer { display: none; }
  .skills__cta-row { justify-content: flex-start; }
  .chip { font-size: 14px; padding: 8px 16px; }
  .skills__chips { gap: 8px; padding: 0; }

  /* ── Footer ── */
  .footer__contact { height: auto; gap: 28px; }
  .footer__heading { width: 100%; font-size: var(--text-lg); }
  .footer__links-grid { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
  .footer__links-col { display: contents; }
  .footer__links-col--nav { display: contents; }
  .footer__links-col--nav a:not(:last-child) { display: none; }
  .footer__meta { flex-wrap: wrap; gap: 8px; font-size: 16px; }
}
