/* Mono Ledger — shared styles for all six CV pages. Tokens follow tokens.css from the design handoff. */

@font-face { font-family: 'Iosevka'; src: url('fonts/iosevka-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('fonts/iosevka-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --font-sans: 'IBM Plex Sans', sans-serif;
  --font-mono: 'Iosevka', ui-monospace, monospace;

  --bg: #F3F3F0;
  --surface: #FBFBF9;
  --ink: #18181B;
  --text: #3F3F3A;
  --text-lead: #4A4A45;
  --muted: #5E5E58;
  --rule: #D6D6D0;
  --rule-soft: #E0E0DA;
  --rule-strong: #18181B;
  --link-underline: #B9B9B3;
  --cell-empty: #E4E4DF;

  --cat-blue-bg: #E3ECF7;   --cat-blue-fg: #1F4E8C;
  --cat-violet-bg: #ECE6F6; --cat-violet-fg: #5B3E96;
  --cat-teal-bg: #DCEFEA;   --cat-teal-fg: #1D5A4F;
  --cat-amber-bg: #F6EBD6;  --cat-amber-fg: #7A4F0E;
  --cat-rose-bg: #F6E3E3;   --cat-rose-fg: #93353A;
  --cat-grey-bg: #E6E6E1;   --cat-grey-fg: #2E2E2A;

  --status-working-bg: #E1F0E7; --status-working-fg: #22603F;
  --status-dev-bg: #F6EBD6;     --status-dev-fg: #7A4F0E;
  --status-research-bg: #ECE6F6; --status-research-fg: #5B3E96;

  --container: 1120px;
  --radius-card: 10px;
  --radius-panel: 12px;
  --grid-label-col: 220px;
}

/* One accent per CV: base, tint (contact panel), deep (contact heading), fg (accent text on light bg). */
.cv-developer { --accent: #2F7A55; --accent-tint: #E1F0E7; --accent-deep: #173F2A; --accent-fg: #22603F; }
.cv-support   { --accent: #2F5D8A; --accent-tint: #E3ECF7; --accent-deep: #173356; --accent-fg: #1F4E8C; }
.cv-devops    { --accent: #B4532A; --accent-tint: #F6E6DC; --accent-deep: #5E2A10; --accent-fg: #7A3A17; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.55; min-height: 100vh; }
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--link-underline); }
a:hover { border-bottom-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.acc { color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex: none; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 6px 12px; z-index: 10; }
.skip:focus { left: 16px; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* header */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.brand { display: flex; align-items: center; gap: 10px; }
.top nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* hero */
.hero { padding: 96px 0 64px; }
.hero-row { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: flex-end; }
.hero-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.prompt { font-size: 15px; }
.hero h1 { margin: 0; font-size: clamp(52px, 8vw, 96px); line-height: 0.98; font-weight: 600; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.intro { margin: 0; max-width: 600px; font-size: 22px; line-height: 1.5; color: var(--text); }
.contacts { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--font-mono); font-size: 16px; }
.facts { flex: 1 1 280px; padding: 8px 22px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; }
.fact:last-child { border-bottom: 0; }
.fk { color: var(--muted); }
.fv-status { display: flex; align-items: center; gap: 8px; color: var(--accent-fg); }
.fv-status .dot { width: 7px; height: 7px; }

/* sections */
.sec { padding: 72px 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 32px; }
.shead { display: flex; flex-direction: column; gap: 10px; }
.shead-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.shead-row > .shead { flex: 1 1 0; min-width: min(100%, 320px); }
.shead-row > a { font-size: 15px; }
.h2 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.lead { margin: 0; color: var(--text-lead); font-size: 18px; line-height: 1.55; }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card); }

/* badges, tags, pills */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 4px 12px; border-radius: 999px; font-family: var(--font-mono); font-size: 15px; }
.badge.next { border: 1px dashed var(--accent); color: var(--accent-fg); padding: 3px 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--font-mono); font-size: 14px; }
.tag { padding: 1px 8px; border-radius: 3px; }
.blue { background: var(--cat-blue-bg); color: var(--cat-blue-fg); }
.violet { background: var(--cat-violet-bg); color: var(--cat-violet-fg); }
.teal { background: var(--cat-teal-bg); color: var(--cat-teal-fg); }
.amber { background: var(--cat-amber-bg); color: var(--cat-amber-fg); }
.rose { background: var(--cat-rose-bg); color: var(--cat-rose-fg); }
.grey { background: var(--cat-grey-bg); color: var(--cat-grey-fg); }
.st, .kind { align-self: flex-start; font-family: var(--font-mono); font-size: 13px; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.st-working { background: var(--status-working-bg); color: var(--status-working-fg); }
.st-dev { background: var(--status-dev-bg); color: var(--status-dev-fg); }
.st-research { background: var(--status-research-bg); color: var(--status-research-fg); }
.star { font-family: var(--font-mono); font-size: 14px; font-weight: 500; padding: 2px 9px; border-radius: 3px; background: var(--ink); color: var(--bg); white-space: nowrap; }

/* featured project cards */
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 20px; } /* 330: status chip + meta fit on one line */
.fcard { padding: 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fcard .tags { margin-top: auto; } /* tags + links sit at the bottom, level across a row */
.ftop { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 26px; } /* star badge is taller than a status chip */
.meta { font-size: 13px; min-width: 0; text-align: right; }
.fname { margin: 0; font-size: 25px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.desc { margin: 0; color: var(--text); line-height: 1.6; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 15px; }
/* small cards (support side projects) */
.feat.sm { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.feat.sm .fcard { padding: 22px; gap: 10px; }

/* compact project list */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--rule-strong); }
.lrow { display: grid; grid-template-columns: 210px minmax(0, 1fr) 140px; gap: 10px 32px; padding: 22px 0; border-bottom: 1px solid var(--rule-soft); align-items: start; }
:lang(ru) .lrow { grid-template-columns: 210px minmax(0, 1fr) 160px; }
.lhead, .lbody { display: flex; flex-direction: column; min-width: 0; }
.lhead { gap: 6px; }
.lbody { gap: 10px; }
.pname { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-family: var(--font-mono); font-size: 15px; }

/* skills table */
.skills { display: flex; flex-direction: column; border-top: 1px solid var(--rule-strong); }
.skrow { display: grid; grid-template-columns: var(--grid-label-col) minmax(0, 1fr); gap: 10px 32px; padding: 16px 0; border-bottom: 1px solid var(--rule-soft); align-items: center; }
.sklabel { font-family: var(--font-mono); font-size: 15px; color: var(--muted); }

/* experience / ops rows */
.xrow { display: grid; grid-template-columns: var(--grid-label-col) minmax(0, 1fr); gap: 10px 32px; padding: 28px 0; border-bottom: 1px solid var(--rule-soft); align-items: start; }
.side { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 15px; }
.side.ops { gap: 8px; }
.side a { align-self: flex-start; }
.xbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.xbody.edu { gap: 4px; }
.co { margin: 0; font-family: var(--font-sans); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; color: var(--ink); }
.cv-devops .co { font-size: 22px; }
.co.school { font-size: 20px; }
.role { color: var(--muted); display: block; }
.bl { margin: 0; padding-left: 20px; color: var(--text); display: flex; flex-direction: column; gap: 6px; line-height: 1.55; }

/* GitHub pulse */
.pulse { display: flex; flex-wrap: wrap; gap: 28px 48px; padding: 28px; align-items: stretch; }
.pgrid-wrap { flex: 0 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; }
.months, .pgrid { display: grid; grid-template-columns: repeat(var(--weeks), 20px); column-gap: 5px; }
.months { font-size: 13px; }
.months span { white-space: nowrap; }
.pgrid { grid-template-rows: repeat(7, 20px); grid-auto-flow: column; row-gap: 5px; }
.c { width: 20px; height: 20px; border-radius: 4px; background: var(--cell-empty); }
.c.pad { background: transparent; }
.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--bg)); }
.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--bg)); }
.l3 { background: color-mix(in srgb, var(--accent) 76%, var(--bg)); }
.l4 { background: var(--accent); }
.legend { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; }
.legend .c { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.legend > span:first-child { margin-right: 4px; }
.legend > span:last-child { margin-left: 4px; }
.pstats { flex: 1 1 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-content: start; }
.pstat { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 1px dashed var(--rule); }
.pstat:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.pstat b { font-size: 30px; font-weight: 500; line-height: 1.1; }
.pstat b small { font-size: 18px; color: var(--muted); font-weight: 500; }
.pstat span { font-size: 13px; color: var(--muted); }
.pstat b.acc { color: var(--accent); }
.pstat.repos { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pstat.repos a { font-size: 14px; }

/* contact panel + footer */
.contact { margin: 8px 0 32px; padding: 40px; background: var(--accent-tint); border-radius: var(--radius-panel); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-end; }
.contact-head { display: flex; flex-direction: column; gap: 10px; }
.contact h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; color: var(--accent-deep); }
.contact .contacts { gap: 10px 24px; }
.foot { padding: 18px 0 32px; border-top: 1px solid var(--rule); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* 404 */
.nf { padding: 120px 0; display: flex; flex-direction: column; gap: 22px; }

@media (max-width: 760px) {
  .lrow, :lang(ru) .lrow, .skrow, .xrow { grid-template-columns: minmax(0, 1fr); }
  .end { align-items: flex-start; }
  .hero { padding: 64px 0 48px; }
  .sec { padding: 56px 0; }
  .contact { padding: 28px 24px; }
  .wrap { padding: 0 16px; }
}

/* print / PDF (A4) — same design, tightened spacing, no screen-only chrome */
@page { size: A4; margin: 12mm 0 14mm; }
@media print {
  html, body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff; font-size: 13.5px; }
  .wrap { max-width: none; padding: 0 14mm; }
  .skip, .top nav, .pdf-link { display: none !important; }
  .top { padding: 0 0 10px; }
  .hero { padding: 20px 0 18px; }
  .hero-row { gap: 18px 28px; flex-wrap: nowrap; }
  .hero-main { gap: 10px; flex: 1 1 auto; }
  .prompt { font-size: 12px; }
  .hero h1 { font-size: 44px; }
  .intro { font-size: 14.5px; }
  .contacts { font-size: 13px; }
  .facts { flex: 0 0 270px; padding: 2px 14px; }
  .fact { padding: 5px 0; font-size: 12px; white-space: nowrap; }
  .sec { padding: 20px 0; gap: 14px; }
  .h2 { font-size: 24px; }
  .lead { font-size: 14.5px; }
  .feat { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .feat.sm { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .fcard, .feat.sm .fcard { padding: 12px 13px; gap: 7px; }
  .fname { font-size: 17px; }
  .desc { line-height: 1.45; }
  .tags { font-size: 11.5px; }
  .badge { font-size: 12.5px; padding: 2px 9px; }
  .lrow { grid-template-columns: 150px minmax(0, 1fr) 110px; gap: 6px 20px; padding: 12px 0; }
  :lang(ru) .lrow { grid-template-columns: 150px minmax(0, 1fr) 130px; }
  .skrow { grid-template-columns: 170px minmax(0, 1fr); padding: 9px 0; }
  .xrow { grid-template-columns: 170px minmax(0, 1fr); gap: 6px 20px; padding: 14px 0; }
  .sklabel, .side, .end, .links { font-size: 12.5px; }
  .co { font-size: 18px; } .cv-devops .co { font-size: 17px; } .co.school { font-size: 16px; }
  .pname { font-size: 16px; }
  .pulse { padding: 16px; gap: 16px 28px; }
  .pstat b { font-size: 22px; }
  .contact { padding: 20px 24px; margin: 8px 0 0; }
  .contact h2 { font-size: 28px; }
  .foot { padding: 10px 0 0; font-size: 11px; }
  .fcard, .lrow, .skrow, .xrow, .pulse, .contact { break-inside: avoid; }
  .shead, .shead-row { break-after: avoid; }
  a { border-bottom-color: transparent; }
}
