/* ==========================================================================
   Victor Yushenko — personal site
   Swiss-minimal system: white ground, one grotesque family (Archivo,
   variable weight + width), hairline rules, a single blue accent.
   All colors derive from the tokens below.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/plexmono-normal-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #111114;
  --ink-soft: #55555c;
  --ink-faint: #8e8e96;
  --rule: #e4e4e8;
  --rule-strong: #111114;
  --accent: #0b2ce2;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --ink: #f0f0f2;
    --ink-soft: #a8a8b0;
    --ink-faint: #6e6e78;
    --rule: #28282e;
    --rule-strong: #f0f0f2;
    --accent: #7a90ff;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }

body {
  overflow-x: clip;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* shared page gutter */
.site-header, main, .site-footer {
  max-width: 76rem;
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule-strong);
}

.wordmark {
  font-weight: 680;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-header nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-header nav a {
  font-size: 0.8rem;
  font-weight: 480;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-soft);
}
.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--accent); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding: clamp(3rem, 9vh, 6rem) 0 clamp(2.5rem, 7vh, 4.5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.75rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  font-weight: 640;
  font-stretch: 80%;
  line-height: 1.0;
  letter-spacing: -0.022em;
  text-wrap: balance;
  max-width: 15ch;
}

.hero-bio {
  max-width: 44em;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-top: 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-top: 1.75rem;
}

.text-link {
  font-size: 0.9rem;
  font-weight: 520;
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.text-link:hover, .text-link:focus-visible { border-bottom-color: var(--accent); }

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 32%;
  filter: grayscale(1) contrast(1.06);
}
.hero-photo figcaption {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.7rem;
}

/* --------------------------------------------------------------------------
   Stats strip
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-strong);
}
.stat {
  padding: 1.4rem 1.25rem 1.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat + .stat { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.stat-num {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 620;
  font-stretch: 88%;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--ink-faint);
  max-width: 15em;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section, .contact { padding: clamp(3rem, 8vh, 5rem) 0 0; }

.section-label {
  font-size: 0.75rem;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 0.8rem;
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
  position: relative;
}
/* the section rule draws itself in as the label scrolls into view */
.section-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--rule-strong);
  transform-origin: 0 50%;
}
html.js .section-label::after {
  transform: scaleX(0);
  transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1) 0.15s;
}
html.js .section-label.is-visible::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Work
   -------------------------------------------------------------------------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
}
.project h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 640;
  font-stretch: 84%;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.project h3 a { text-decoration: none; }
.project h3 a:hover, .project h3 a:focus-visible { color: var(--accent); }
.project-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.7rem;
}
.project > p { max-width: 52em; color: var(--ink-soft); }

.project-more {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   Experience
   -------------------------------------------------------------------------- */
.job {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.75rem clamp(1.5rem, 4vw, 3rem);
  padding: 1.9rem 0;
  border-top: 1px solid var(--rule);
}
.timeline .job:first-child { border-top: 0; padding-top: 0; }

.job-when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.job-what h3 {
  font-size: 1.15rem;
  font-weight: 640;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.job-org { font-weight: 480; color: var(--accent); }
.job-org::before { content: "— "; color: var(--ink-faint); }

.job-what > p { color: var(--ink-soft); max-width: 52em; }

.job-what ul { margin-top: 0.8rem; padding-left: 1.1rem; max-width: 52em; }
.job-what li { margin-bottom: 0.4rem; color: var(--ink-soft); }
.job-what li::marker { color: var(--ink-faint); }

.job-earlier { list-style: none; padding-left: 0 !important; margin-top: 0 !important; }
.job-earlier li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-faint);
}
.job-earlier li:last-child { border-bottom: 0; }
.job-earlier li span:first-child { color: var(--ink); font-weight: 520; }
.job-years {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 2.25rem clamp(1.5rem, 4vw, 3rem);
}
.skill-group h3 {
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.skill-group ul { list-style: none; }
.skill-group li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--rule);
}
.skill-group li:last-child { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Beyond work
   -------------------------------------------------------------------------- */
.beyond {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
}
.beyond > p { max-width: 36em; color: var(--ink-soft); }

.hobbies { list-style: none; }
.hobbies li {
  font-size: 0.9rem;
  color: var(--ink-faint);
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--rule);
}
.hobbies li:last-child { border-bottom: 0; }
.hobbies li span { color: var(--ink); font-weight: 520; }

.inline-link {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.inline-link:hover, .inline-link:focus-visible { color: var(--accent); }

/* --------------------------------------------------------------------------
   Contact + footer
   -------------------------------------------------------------------------- */
.contact { padding-bottom: clamp(3.5rem, 9vh, 6rem); }

.contact-link {
  display: inline-block;
  font-size: clamp(1.8rem, 5.5vw, 4rem);
  font-weight: 640;
  font-stretch: 84%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s;
}
.contact-link:hover, .contact-link:focus-visible { color: var(--accent); }

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding-top: 1.4rem;
  padding-bottom: 2.25rem;
  border-top: 1px solid var(--rule-strong);
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Motion — restrained: elements fade up 10px as they enter the viewport and
   section rules draw themselves in. Hidden initial states apply only under
   html.js (stamped by an inline script), so nothing is hidden when JS is off.
   Reduced-motion users get everything static via the no-observer class.
   -------------------------------------------------------------------------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
  transition-delay: var(--reveal-delay, 0s);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .section-label::after { transform: none; transition: none; }
}

html.no-observer .reveal { opacity: 1; transform: none; }
html.no-observer .section-label::after { transform: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 17rem; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .project, .beyond { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.5rem 0; }
  .job-when { padding-top: 0; }
}
