/* ==========================================================================
   Xurshid Istamov — shaxsiy sayt
   Tokens, fonts and components shared by the main page (body.site)
   and the A4 CV page (body.cvp).
   ========================================================================== */

/* ---------- Fonts (self-hosted) ----------
   Latin: Newsreader, Instrument Sans, IBM Plex Mono.
   Cyrillic (Russian pages): Newsreader and Instrument Sans have no Cyrillic, so the same
   family names map Cyrillic code points to Literata and Onest (closest matches);
   browsers download these files only when a page actually contains Cyrillic text. */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2-variations"), url("/assets/fonts/newsreader-var.woff2") format("woff2");
  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+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("/assets/fonts/literata-cyrillic-var.woff2") format("woff2-variations"), url("/assets/fonts/literata-cyrillic-var.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/assets/fonts/instrument-sans-var.woff2") format("woff2-variations"), url("/assets/fonts/instrument-sans-var.woff2") format("woff2");
  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+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/onest-cyrillic-var.woff2") format("woff2-variations"), url("/assets/fonts/onest-cyrillic-var.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  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+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  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+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --soft: #F0EEE8;
  --line: #E6E3DC;
  --ink: #1A1A17;
  --ink2: #66645D;
  --inv: #141413;
  --invInk: #FBFAF7;
  --invInk2: #B5B2AA;
  --accent: #C4410C;
  --head: rgba(251, 250, 247, .86);
  --t1: #EDE6DA;
  --t2: #DFE4DC;
  --t3: #E3E1EA;
  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root.dark {
  --bg: #121211;
  --surface: #1B1B19;
  --soft: #24231F;
  --line: #302F2B;
  --ink: #F2F0EB;
  --ink2: #A3A098;
  --inv: #F2F0EB;
  --invInk: #141413;
  --invInk2: #5A5852;
  --accent: #F0753A;
  --head: rgba(18, 18, 17, .86);
  --t1: #2A2622;
  --t2: #232823;
  --t3: #26252C;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }
h1, h2, h3, p { overflow-wrap: break-word; }
button { font: inherit; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

/* Lenis smooth scroll (styles from lenis/dist/lenis.css) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

.site {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  min-height: 100vh;
  transition: background-color .3s ease, color .3s ease;
}
.site ::selection, .cvp ::selection { background: var(--accent); color: #FFFFFF; }
.site a:focus-visible, .site button:focus-visible,
.cvp a:focus-visible, .cvp button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 12px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px;
}
.skip-link:focus { top: 16px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.serif { font-family: var(--font-serif); font-weight: 400; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--ink2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 12px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { transition: transform .2s ease; }
.btn:hover svg.nudge { transform: translate(2px, -2px); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--ink); color: var(--bg); }

/* Theme toggle: sun in dark mode, moon in light mode */
.theme-toggle .i-sun { display: none; }
:root.dark .theme-toggle .i-sun { display: block; }
:root.dark .theme-toggle .i-moon { display: none; }
/* Menu toggle */
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: block; }
.menu-toggle[aria-expanded="true"] .i-menu { display: none; }

/* Language menu */
.lang { position: relative; }
.lang-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  min-width: 200px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 48px -16px rgba(26, 26, 23, .24), 0 2px 8px rgba(26, 26, 23, .06);
  animation: pop .18s var(--ease-out) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.lang-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; padding: 0 12px; border-radius: 8px;
  font-size: 15px; font-weight: 500; transition: background-color .15s ease;
}
.lang-menu a:hover { background: var(--soft); }
.lang-menu a .code { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--ink2); }
.lang-menu a[aria-current="true"] .code { color: var(--accent); }
.lang-menu a[aria-current="true"] { font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--head);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand {
  display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0;
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
}
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex-shrink: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav { display: flex; gap: 32px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 500; color: var(--ink2); transition: color .2s ease;
}
.nav a:hover, .nav a.on { color: var(--ink); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav a.on::after { transform: scaleX(1); }

.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes grow { to { transform: scaleX(1); } }

.menu-panel { border-top: 1px solid var(--line); background: var(--bg); }
.menu-panel nav { display: flex; flex-direction: column; padding-top: 8px; padding-bottom: 24px; }
.menu-panel a.item {
  display: flex; align-items: center; min-height: 48px;
  font-size: 17px; font-weight: 500; border-bottom: 1px solid var(--line);
}
.menu-panel .btn { margin-top: 24px; }

.only-sm { display: none !important; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 64px; align-items: center; padding: 120px 0 128px;
}
.status {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  border-radius: 8px; background: var(--soft); font-size: 14px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.hero-title { font-size: clamp(48px, 6.4vw, 88px); line-height: 1; letter-spacing: -0.02em; margin: 24px 0 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.hero-sub { font-size: 24px; line-height: 1.4; margin: 0; max-width: 600px; }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 40px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; padding: 24px 0; min-width: 0; }

.tag {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border-radius: 8px; background: var(--soft); font-size: 14px; font-weight: 500;
}
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; transition: border-color .2s ease;
}
.chip:hover { border-color: var(--ink); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }

/* CV preview card */
.cv-card {
  display: block; position: relative; width: 360px; max-width: 100%;
  transform: rotate(3deg); transition: transform .5s var(--ease-out);
}
.cv-card:hover { transform: rotate(0deg) translateY(-8px); }
.cv-card .paper { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.cv-card .badge {
  position: absolute; top: -16px; right: -16px; z-index: 2;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 12px; padding: 8px 12px; border-radius: 8px;
  transform: rotate(-5deg);
}
.cv-card .sheet-mini {
  background: #FFFFFF; color: #1A1A17; border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 32px 64px -24px rgba(26, 26, 23, .28), 0 2px 8px rgba(26, 26, 23, .06);
  padding: 32px 32px 40px;
}
.sheet-mini .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sheet-mini .name { font-size: 30px; line-height: 1.05; }
.sheet-mini .meta { font-size: 13px; color: #66645D; margin-top: 8px; }
.sheet-mini .meta + .meta { margin-top: 4px; }
.sheet-mini img { width: 56px; height: 68px; flex-shrink: 0; border-radius: 4px; object-fit: cover; object-position: 50% 30%; }
.sheet-mini .lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; margin-top: 24px; }
.sheet-mini .lines { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sheet-mini .lines span { display: block; height: 4px; border-radius: 2px; background: #E6E3DC; }

/* ---------- Sections ---------- */
.sec {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px; padding: 64px 0 120px; border-top: 1px solid var(--line);
}
.sec > * { min-width: 0; }
.sec-title { font-size: 40px; line-height: 1.1; letter-spacing: -.01em; margin: 16px 0 0; max-width: 12ch; }
.lead { font-size: 24px; line-height: 1.45; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 40px 0 0; }
.stat { border-top: 1px solid var(--ink); padding-top: 16px; min-width: 0; }
.stat dt { color: var(--ink2); }
.stat dd { font-size: 20px; font-weight: 600; margin: 8px 0 0; }

.rows { margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px 32px;
  padding: 32px 0; border-bottom: 1px solid var(--line);
}
.row:first-child { padding-top: 0; }
.row > * { min-width: 0; }
.row .when { font-family: var(--font-mono); font-size: 12px; color: var(--ink2); padding-top: 4px; }
.row h3 { font-size: 20px; font-weight: 600; margin: 0; line-height: 1.3; }
.row .org { display: flex; gap: 12px; flex-wrap: wrap; font-size: 15px; margin-top: 8px; }
.row .org b { font-weight: 600; }
.row p { font-size: 16px; color: var(--ink2); line-height: 1.5; margin: 12px 0 0; }
.row .tag { margin-top: 16px; }

/* Projects */
.projects {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto auto; gap: 24px;
}
.proj { display: flex; flex-direction: column; min-width: 0; }
.proj.big { grid-row: span 2; }
.proj .shot {
  border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative;
}
.proj .shot > div { transition: transform .5s var(--ease-out); }
.proj:hover .shot > div { transform: translateY(-4px) scale(1.03); }
.proj .title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; margin: 16px 0 0; }
.proj .title svg { transition: transform .2s ease; }
.proj:hover .title svg { transform: translate(2px, -2px); }
.proj p { font-size: 15px; color: var(--ink2); line-height: 1.5; margin: 8px 0 0; }
.proj .tags { margin: 12px 0 0; }
.shot-1 { background: var(--t1); flex: 1; min-height: 320px; }
.shot-2 { background: var(--t2); aspect-ratio: 16 / 10; }
.shot-3 { background: var(--t3); aspect-ratio: 16 / 10; }

/* Abstract product illustrations (decorative) */
.mock-chat {
  width: 68%; max-width: 320px; background: #FFFFFF; border-radius: 12px;
  box-shadow: 0 24px 48px -16px rgba(26, 26, 23, .3);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.mock-chat .top { display: flex; align-items: center; gap: 8px; }
.mock-chat .logo { width: 24px; height: 24px; border-radius: 8px; background: #1A1A17; }
.mock-chat .brandline { height: 8px; width: 40%; background: #1A1A17; border-radius: 4px; }
.mock-chat .bubble { border-radius: 12px; padding: 8px 12px; }
.mock-chat .bubble i { display: block; height: 4px; border-radius: 2px; }
.mock-chat .bubble i + i { margin-top: 4px; }
.mock-chat .me { align-self: flex-end; background: #F0EEE8; width: 56%; }
.mock-chat .me i { background: #CFCBC2; }
.mock-chat .ai { background: #1A1A17; width: 72%; }
.mock-chat .ai i { background: #6B6962; }
.mock-chat .input {
  height: 32px; border: 1px solid #E6E3DC; border-radius: 8px;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 4px;
}
.mock-chat .send { width: 24px; height: 24px; border-radius: 8px; background: #C4410C; }

.mock-chart {
  width: 64%; background: #FFFFFF; border-radius: 12px;
  box-shadow: 0 16px 32px -12px rgba(26, 26, 23, .28); padding: 12px;
}
.mock-chart .t { height: 6px; width: 40%; background: #1A1A17; border-radius: 3px; }
.mock-chart .bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; margin-top: 12px; }
.mock-chart .bars i { flex: 1; background: #C9CFC4; border-radius: 4px; }
.mock-chart .bars i:last-child { background: #1A1A17; }

.mock-phone {
  width: 28%; aspect-ratio: 9 / 18; background: #FFFFFF; border-radius: 16px;
  box-shadow: 0 16px 32px -12px rgba(26, 26, 23, .28); padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.mock-phone .card { height: 32%; background: #1A1A17; border-radius: 8px; }
.mock-phone i { display: block; height: 4px; background: #E6E3DC; border-radius: 2px; }

/* Contact */
.contact {
  background: var(--inv); color: var(--invInk);
  border-radius: 16px; padding: 64px; margin-bottom: 120px;
}
.contact h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -0.01em; margin: 16px 0 0; }
.contact .avail {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 16px; font-weight: 500; color: var(--invInk2);
}
.contact .channels {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px;
  margin: 40px 0 0; padding: 0; list-style: none;
}
.contact .channels li { min-width: 0; }
.contact .channels .mono { color: var(--invInk2); margin-bottom: 8px; }
.contact .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 40px; }
.contact a.big {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-size: 26px; white-space: nowrap;
  color: var(--invInk); border-bottom: 1px solid var(--invInk2); padding-bottom: 4px;
  transition: border-color .2s ease;
}
.contact a.big:hover { border-color: var(--accent); }
.contact a.big svg { transition: transform .2s ease; flex-shrink: 0; }
.contact a.big:hover svg { transform: translate(2px, -2px); }
.contact .btn-light { background: var(--invInk); color: var(--inv); }
.contact .btn-light:hover { background: var(--accent); color: #FFFFFF; }

/* Footer */
.site-footer { padding-bottom: 64px; }
.foot {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.foot small { font-size: 14px; color: var(--ink2); }
.foot-links { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; font-size: 15px; font-weight: 500; }
.foot-links a:not(.icon-btn) { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Motion ---------- */
.rise { animation: rise .8s var(--ease-out) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .hide-md { display: none !important; }
  .only-sm { display: inline-flex !important; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 56px; padding: 72px 0 96px; }
  .sec { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 48px 0 96px; }
  .sec-title { max-width: none; }
  .contact .channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .wrap, .narrow { padding: 0 16px; }
  .hide-sm { display: none !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .projects { grid-template-columns: minmax(0, 1fr); }
  .proj.big { grid-row: auto; }
  .contact { padding: 40px 24px; margin-bottom: 96px; }
  .contact a.big { font-size: 22px; }
  .contact .channels { grid-template-columns: minmax(0, 1fr); }
  .header-actions { gap: 6px; }
  .brand { gap: 10px; font-size: 17px; }
  .sec-title { font-size: 32px; }
  .hero-sub { font-size: 20px; }
  .cv-card { width: 300px; }
  .foot { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 1024px) { .menu-panel { display: none !important; } }
@media (min-width: 2200px) { .site, .cvp { zoom: 1.5; } }
@media (min-width: 3200px) { .site, .cvp { zoom: 2; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site *, .site *::after, .cvp * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   CV page (A4)
   ========================================================================== */
.cvp {
  --accent: #F0753A;
  background: #121211; color: #F2F0EB;
  font-family: var(--font-sans); min-height: 100vh; padding-bottom: 96px;
  color-scheme: dark;
}
.cvp-header { border-bottom: 1px solid #2A2A27; }
.cvp-header .nav-plain { display: flex; gap: 32px; font-size: 15px; font-weight: 500; color: #A3A098; }
.cvp-header .nav-plain a, .cvp-header .tg { display: inline-flex; align-items: center; min-height: 44px; transition: color .2s ease; }
.cvp-header .nav-plain a:hover { color: #F2F0EB; }
.cvp-header .tg { font-size: 15px; font-weight: 500; }
.cvp-header .header-actions { gap: 16px; }
.cvp .icon-btn { background: #1B1B19; border-color: #302F2B; color: #F2F0EB; }
.cvp .icon-btn:hover, .cvp .lang-btn[aria-expanded="true"] { background: #F2F0EB; color: #141413; }
.cvp .lang-menu { background: #1B1B19; color: #F2F0EB; border-color: #302F2B; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6); }
.cvp .lang-menu a:hover { background: #24231F; }
.cvp .lang-menu a .code { color: #A3A098; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px 0 24px; }
.toolbar .right { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 600; color: #F2F0EB; }
.back svg { transition: transform .2s ease; }
.back:hover svg { transform: translateX(-4px); }
.btn-paper { background: #F2F0EB; color: #141413; border: 0; }
.btn-paper:hover { background: var(--accent); color: #FFFFFF; }

.sheet {
  background: #FFFFFF; color: #1A1A17; border-radius: 4px;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .6);
  padding: 64px; animation: sheet-rise .7s var(--ease-out) both;
}
@keyframes sheet-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.sheet .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.sheet .top > div { min-width: 0; padding-top: 8px; }
.cv-name { font-size: 52px; line-height: 1; letter-spacing: -0.02em; margin: 0; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.cv-tags li {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 8px;
  border: 1px solid #D9D6CF; border-radius: 6px; font-size: 13px; font-weight: 500;
}
.cv-photo { width: 96px; height: 120px; border-radius: 4px; object-fit: cover; object-position: 48% 30%; flex-shrink: 0; }

.contacts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin: 24px 0 0; padding-bottom: 24px; border-bottom: 1px solid #1A1A17;
}
.contacts > div { min-width: 0; }
.contacts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: #66645D; }
.contacts dd { font-size: 14px; margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sheet h2.label { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; margin: 40px 0 0; }
.sheet .profile { font-size: 15px; line-height: 1.6; margin: 16px 0 0; }
.cv-list { display: flex; flex-direction: column; gap: 24px; margin: 16px 0 0; padding: 0; list-style: none; }
.cv-list.tight { gap: 16px; }
.item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 32px; }
.item > * { min-width: 0; }
.item .date { font-family: var(--font-mono); font-size: 12px; color: #66645D; padding-top: 4px; }
.item .date.caps { letter-spacing: .08em; }
.item .hl { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.item h3 { font-size: 16px; font-weight: 600; margin: 0; }
.item .co { font-size: 15px; font-weight: 600; }
.item .place { font-size: 14px; color: #66645D; }
.item .desc { font-size: 14px; color: #66645D; margin: 4px 0 0; line-height: 1.5; }
.item .win { font-size: 14px; margin: 4px 0 0; }
.item .txt { font-size: 15px; line-height: 1.5; margin: 0; }
.sheet .note { font-size: 14px; color: #66645D; margin: 40px 0 0; }

@media (max-width: 1023px) {
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .sheet { padding: 32px 24px; }
  .item { grid-template-columns: minmax(0, 1fr); }
  .cv-name { font-size: 40px; }
  .contacts dt { font-size: 12px; }
  .toolbar { gap: 16px; }
}

@page { size: A4; margin: 12mm; }
@media print {
  .no-print { display: none !important; }
  html, body, .cvp { background: #FFFFFF !important; padding: 0 !important; }
  .narrow { padding: 0 !important; max-width: none; }
  .sheet { box-shadow: none !important; padding: 0 !important; animation: none; }
  .contacts dd { white-space: normal; }
  .item { break-inside: avoid; }
  /* Compact layout so the CV fits on one A4 page */
  .cv-name { font-size: 40px; }
  .cv-photo { width: 80px; height: 100px; }
  .cv-tags { margin-top: 12px; }
  .contacts { margin-top: 16px; padding-bottom: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
  .item { grid-template-columns: 112px minmax(0, 1fr); }
  .sheet { padding: 0 !important; }
  .sheet h2.label { margin-top: 22px; }
  .sheet .profile { font-size: 13.5px; line-height: 1.5; margin-top: 10px; }
  .cv-list { gap: 12px; margin-top: 10px; }
  .cv-list.tight { gap: 8px; }
  .item h3 { font-size: 14.5px; }
  .item .co { font-size: 14px; }
  .item .desc, .item .win, .item .place { font-size: 12.5px; }
  .item .txt { font-size: 13.5px; }
  .sheet .note { margin-top: 20px; font-size: 12.5px; }
  a[href]::after { content: none !important; }
}
