/* ————— Oleg Kossoy · portfolio ————— */

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe8;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-faint: #8a837b;
  --accent: #8c3320;
  --accent-soft: #b8654f;
  --line: #e5dfd5;
  --card: #ffffff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ————— header ————— */

header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; }
.brand em { font-style: italic; color: var(--accent); }
nav.top { display: flex; gap: 28px; }
nav.top a {
  color: var(--ink-soft); text-decoration: none; font-size: 15px; letter-spacing: 0.01em;
}
nav.top a:hover, nav.top a.active { color: var(--accent); }

/* ————— hero ————— */

.hero { padding: 96px 0 72px; }
.hero .kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 64px);
  line-height: 1.08; letter-spacing: -0.015em; max-width: 20ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede {
  margin-top: 28px; max-width: 62ch; font-size: 19px; color: var(--ink-soft);
}
.hero .contacts { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 18px; text-decoration: none; color: var(--ink);
  font-size: 15px; background: var(--card); transition: border-color .15s, transform .15s;
}
.pill:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ————— stats strip ————— */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-block: 1px solid var(--line);
}
.stats > div { background: var(--paper); padding: 28px 24px; }
.stats .n { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--ink); }
.stats .l { margin-top: 8px; font-size: 14px; color: var(--ink-faint); letter-spacing: 0.02em; }

/* ————— sections ————— */

section.block { padding: 88px 0 8px; }
.section-head { margin-bottom: 48px; max-width: 68ch; }
.section-head .kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15; letter-spacing: -0.01em;
}
.section-head p { margin-top: 16px; color: var(--ink-soft); }

/* ————— featured project rows ————— */

.project {
  display: grid; grid-template-columns: 5fr 6fr; gap: 56px;
  align-items: center; padding: 56px 0; border-top: 1px solid var(--line);
}
.project:nth-of-type(even) .shot { order: -1; }
.project .meta .tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.project h3 {
  font-family: var(--serif); font-weight: 500; font-size: 32px;
  margin: 10px 0 4px; letter-spacing: -0.01em;
}
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { color: var(--accent); }
.project .one-liner { font-size: 17px; color: var(--accent); font-style: italic; font-family: var(--serif); }
.project p.desc { margin-top: 16px; color: var(--ink-soft); font-size: 16px; }
.project .facts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px;
  background: var(--paper-2);
}
.project .links { margin-top: 22px; display: flex; gap: 20px; }
.project .links a {
  font-size: 14px; color: var(--accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
}
.project .links a:hover { border-bottom-color: var(--accent); }

/* screenshot frame */
.shot { position: relative; }
.shot .frame {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--card);
}
.shot .bar {
  display: flex; gap: 6px; padding: 10px 14px;
  background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.shot .bar i { width: 9px; height: 9px; border-radius: 50%; background: #d6cec2; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  margin-top: 12px; font-size: 13px; color: var(--ink-faint); text-align: center;
  font-family: var(--mono); letter-spacing: 0.02em;
}

/* ————— card grid (tools & plugins) ————— */

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 56px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { border-color: var(--accent-soft); }
.card .thumb {
  margin: -28px -28px 20px; border-bottom: 1px solid var(--line);
  border-radius: 13px 13px 0 0; overflow: hidden; background: var(--paper-2);
}
.card .thumb img { display: block; width: 100%; height: auto; }
.card .tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.card h4 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 8px 0 2px; }
.card h4 a { color: inherit; text-decoration: none; }
.card h4 a:hover { color: var(--accent); }
.card .one-liner { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--accent); }
.card p { margin-top: 12px; font-size: 15px; color: var(--ink-soft); flex: 1; }
.card .facts { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.card .facts .chip { font-size: 11px; padding: 3px 8px; }
.badge-private {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  border: 1px dashed var(--ink-faint); border-radius: 6px; padding: 2px 8px; margin-left: 8px;
  vertical-align: 3px;
}

/* ————— homelab page ————— */

.lab-hero { padding: 88px 0 40px; }
.lab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 24px 0 64px; }
.lab-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px;
}
.lab-card h4 {
  font-family: var(--serif); font-size: 22px; font-weight: 500; margin-bottom: 4px;
}
.lab-card .sub { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.lab-card p { margin-top: 12px; font-size: 15px; color: var(--ink-soft); }
.lab-card ul { margin: 12px 0 0 18px; font-size: 15px; color: var(--ink-soft); }
.lab-card li { margin-top: 6px; }
.lab-card li strong { color: var(--ink); font-weight: 600; }

.pipeline {
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2);
  padding: 34px; margin: 8px 0 72px;
}
.pipeline h4 { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.pipeline .flow {
  margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13.5px;
}
.pipeline .step {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; white-space: nowrap;
}
.pipeline .step.hot { border-color: var(--accent-soft); color: var(--accent); }
.pipeline .arr { color: var(--ink-faint); }
.pipeline p { margin-top: 18px; font-size: 15px; color: var(--ink-soft); max-width: 78ch; }

/* ————— footer ————— */

footer.site {
  margin-top: 72px; border-top: 1px solid var(--line);
  padding: 48px 0 64px; background: var(--paper-2);
}
footer.site .wrap { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 20px; }
footer.site .sig { font-family: var(--serif); font-size: 19px; }
footer.site .sig em { color: var(--accent); font-style: italic; }
footer.site nav { display: flex; gap: 24px; }
footer.site a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; }
footer.site a:hover { color: var(--accent); }

/* ————— responsive ————— */

@media (max-width: 920px) {
  .project { grid-template-columns: 1fr; gap: 32px; padding: 44px 0; }
  .project:nth-of-type(even) .shot { order: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lab-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  nav.top { gap: 16px; }
}
