/* yarosaz.com — styles
   Type: Libre Franklin (self-hosted, latin + cyrillic, licence in /assets/fonts/OFL-LibreFranklin.txt)
   for text and headlines; the system monospace stack for labels, code and status lines.
*/
@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/libre-franklin-latin.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: "Libre Franklin";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/libre-franklin-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --ink: #16181a;
  --muted: #5d6267;
  --faint: #8a8f94;
  --line: #dfe0dc;
  --accent: #0b7a4b;
  --accent-soft: rgba(11, 122, 75, .09);
  --code-bg: #eeefea;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f10;
    --surface: #15181a;
    --ink: #e9ebe8;
    --muted: #9ba1a6;
    --faint: #6c7378;
    --line: #262b2e;
    --accent: #4fd18b;
    --accent-soft: rgba(79, 209, 139, .1);
    --code-bg: #1b1f22;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }

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

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.logo { font: 600 15px/1 var(--mono); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; font: 13px/1 var(--mono); }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 10px; border-radius: 6px; }
.nav a:hover, .nav a.is-active { color: var(--ink); background: var(--code-bg); }
.lang { font: 13px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.lang a { color: var(--muted); text-decoration: none; }
.lang [aria-current] { color: var(--ink); }
@media (max-width: 760px) { .nav { display: none; } .lang { margin-left: auto; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 11vw, 128px) 0 clamp(48px, 8vw, 96px); border-bottom: 1px solid var(--line); }
.prompt { font: 14px/1.5 var(--mono); color: var(--muted); margin-bottom: 20px; }
.prompt b { color: var(--accent); font-weight: 600; }
.prompt .cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--accent); margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .prompt .cursor { animation: none; } }
.hero h1 { font-size: clamp(40px, 7.4vw, 84px); max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(18px, 2.1vw, 21px); color: var(--muted); max-width: 40em; margin-top: 24px; }
.lead strong { color: var(--ink); font-weight: 600; }
.status {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin-top: 28px; padding: 8px 14px;
  font: 13px/1.4 var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.status .sep { color: var(--faint); }
@media (max-width: 520px) { .status { border-radius: 12px; } .status .sep { display: none; } .status > span { width: 100%; } }
.dot { margin-right: 6px !important; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s ease-out infinite; margin-right: 2px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 8px;
  font: 600 15px/1 var(--sans); text-decoration: none;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button-ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; margin-bottom: clamp(32px, 5vw, 48px); max-width: 44em; }
.label { font: 13px/1 var(--mono); color: var(--accent); letter-spacing: .02em; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); }
.section-head p { color: var(--muted); font-size: 18px; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 20px; }
.project {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(20px, 3.4vw, 36px);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px);
}
.project-flag { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font: 13px/1.4 var(--mono); color: var(--faint); }
.project-flag .id { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.project-flag a { color: var(--muted); }
.project h3 { font-size: clamp(22px, 2.8vw, 28px); margin-bottom: 14px; }
.project-body p { color: var(--muted); }
.project-body p strong { color: var(--ink); font-weight: 600; }
.features { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; font-size: 15.5px; }
.features li { position: relative; padding-left: 20px; }
.features li::before { content: "›"; position: absolute; left: 2px; top: -1px; color: var(--accent); font: 600 16px/1.6 var(--mono); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; padding: 0; list-style: none; }
.tags li { font: 12.5px/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: var(--code-bg); color: var(--muted); }

/* Pipeline: trigger -> process -> result */
.flow { list-style: none; margin: 0; padding: 18px; border-radius: 10px; background: var(--code-bg); font: 13px/1.5 var(--mono); align-self: start; counter-reset: step; }
.flow-title { display: block; color: var(--faint); margin-bottom: 12px; }
.flow li { position: relative; padding: 0 0 18px 26px; }
.flow li:last-child { padding-bottom: 0; }
.flow li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); background: var(--code-bg); z-index: 1; }
.flow li::after { content: ""; position: absolute; left: 9px; top: 14px; bottom: -4px; width: 1px; background: var(--line); }
.flow li:last-child::after { display: none; }
.flow li:last-child::before { background: var(--accent); }
.flow b { display: block; color: var(--accent); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.flow span { color: var(--ink); }

@media (max-width: 820px) { .project { grid-template-columns: 1fr; } }

/* ---------- Approach ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.steps li { counter-increment: s; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.steps li::before { content: "0" counter(s); display: block; font: 13px/1 var(--mono); color: var(--accent); margin-bottom: 16px; }
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.note { margin-top: 28px; max-width: 46em; color: var(--muted); }
.note strong { color: var(--ink); font-weight: 600; }

/* ---------- Experience ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 40px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.figures div { padding: 22px; border-left: 1px solid var(--line); }
.figures div:first-child { border-left: 0; }
.figures dt { font: 700 clamp(30px, 4vw, 42px)/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figures dd { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
@media (max-width: 820px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(3) { border-left: 0; }
  .figures div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.roles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.roles li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.roles time { font: 13px/1.7 var(--mono); color: var(--faint); grid-row: span 2; }
.roles h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.roles h3 span { font-weight: 400; color: var(--faint); }
.roles p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 560px) { .roles li { grid-template-columns: 1fr; } .roles time { grid-row: auto; } }

/* ---------- Stack ---------- */
.stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.stack div { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stack dt { font: 13px/1 var(--mono); color: var(--accent); margin-bottom: 12px; }
.stack dd { margin: 0; color: var(--muted); font-size: 15.5px; }
@media (max-width: 820px) { .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stack { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { padding: clamp(64px, 10vw, 120px) 0; }
.contact h2 { font-size: clamp(32px, 5vw, 54px); max-width: 16ch; }
.contact p { color: var(--muted); font-size: 18px; max-width: 36em; margin-top: 18px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font: 13px/1.7 var(--mono); color: var(--faint); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
.foot p { margin: 0; }
.foot a { color: var(--muted); }

/* ---------- Reveal on scroll (only with JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- 404 ---------- */
.is-404 .hero { border-bottom: 0; min-height: 70vh; }
.is-404 .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
@media (max-width: 640px) { .is-404 .split { grid-template-columns: 1fr; } }
