/* Alexander Zubenko — portfolio
   Plain CSS, no framework. Reference: clintonvanarnam.net */

:root {
  --fg: #111;
  --muted: #767676;
  --line: rgba(0, 0, 0, 0.1);
  --gutter: 16px;
  --section-gap: 72px;
  --header-gap: clamp(48px, 10vw, 200px); /* space between 'Selected projects' and the links on the right */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page-bg, #fff);
  color: var(--fg);
  font: 15px/1.35 "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

p { margin: 0 0 1.2em; }
ul { margin: 0; padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }

.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { padding: 0 var(--gutter); }

/* Per-project page themes. YuMuuv: a light tint of its brand blue (#006cfa) so the white
   phone screens stand out from the page. */
.theme-yumuuv {
  --page-bg: #e7f0fe;
  --muted: #5d6a85;           /* keeps small grey text readable on the tinted background */
  --line: rgba(0, 40, 120, 0.12);
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: flex-start;
  padding-top: var(--gutter);
}
/* The bio takes the left side and pushes the two link groups to the right edge. */
.intro { flex: 0 1 40rem; min-width: 0; margin-right: auto; padding-right: 48px; }
.intro p:last-child { margin-bottom: 0; }
.intro p { text-wrap: pretty; }

.nav-group { display: flex; flex: none; gap: 8px; }
.nav-group ul { white-space: nowrap; }
.nav-group + .nav-group { margin-left: var(--header-gap); }
.nav-group .label { color: var(--muted); white-space: nowrap; }
.nav-group a { text-decoration: none; }
.nav-group a:hover,
.nav-group a[aria-current="page"],
.intro a[aria-current="page"] { text-decoration: underline; }
.intro a { text-decoration: none; }
.intro a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- home */

.home .page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.home main { margin-top: auto; padding-top: 48px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: end;
  padding-bottom: var(--gutter);
}
.tile { position: relative; display: block; text-decoration: none; }
.tile img { width: 100%; height: auto; box-shadow: 0 0 0 1px var(--line); }
/* clip that plays inside the tile on touch / narrow screens; fades in over the still image */
.tile-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; box-shadow: 0 0 0 1px var(--line);
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
.tile-video.on { opacity: 1; }
a.tile { cursor: pointer; }
span.tile { cursor: default; }

@media (hover: hover) {
  .tile { transition: opacity 0.15s ease; }
  .tiles:hover .tile:not(:hover):not(:focus-visible) { opacity: 0.3; }
}

.preview {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(34vw, 560px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
}
.preview.on { opacity: 1; }
.preview img, .preview video {
  display: none;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.preview.show-img img { display: block; }
.preview.show-video video { display: block; }

/* ---------------------------------------------------------------- inner pages */

main > .back { margin: 56px 0 56px; }
.back a { text-decoration: none; }
.back .arrow { display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.35em; vertical-align: -0.12em; }
.back a:hover { text-decoration: underline; }

article h1 {
  margin: 0 0 56px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.row {
  display: grid;
  grid-template-columns: minmax(160px, 20%) minmax(0, 40rem);
  column-gap: var(--gutter);
  margin: 0 0 var(--section-gap);
}
.row h2 { margin: 0; font-size: 15px; line-height: inherit; font-weight: 400; color: var(--muted); }

.prose { line-height: 1.45; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { margin: 1.8em 0 0.4em; font-size: 15px; font-weight: 700; line-height: 1.35; }
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 1.2em; }
.prose li { position: relative; padding-left: 1.1em; margin-bottom: 0.55em; }
.prose li::before { content: "–"; position: absolute; left: 0; }
.prose li:last-child { margin-bottom: 0; }
.prose strong { font-weight: 700; }

.prose dl { margin: 2em 0 0; }
.prose dl > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); margin-bottom: 0.7em; }
.prose dt { color: var(--muted); }
.prose dd { margin: 0; }

.prose .badge { margin: 2em 0 0; }
.prose .badge img { width: 168px; height: auto; }

/* Black button in the same shape as the App Store badge (56px tall, 8px radius). */
.btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 22px 0 16px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.btn-badge:hover { opacity: 0.8; }
.btn-badge:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.btn-badge svg { flex: none; }
.btn-badge span { display: flex; flex-direction: column; justify-content: center; }
.btn-badge small { font-size: 11px; line-height: 1.1; letter-spacing: 0.01em; }
.btn-badge strong { font-size: 19px; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }

.media {
  max-width: 1600px;
  margin: 0 auto var(--section-gap);
}
.media:has(+ .media) { margin-bottom: var(--gutter); }
.media img, .media video { width: 100%; height: auto; }
.media-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); align-items: start; }

/* about */
.about .row { grid-template-columns: minmax(160px, 20%) minmax(0, 46rem); }
.about article h1 { max-width: 20ch; font-size: 40px; line-height: 1.08; letter-spacing: -0.02em; }
.prose.lead { font-size: 19px; line-height: 1.4; }

/* highlights: four proof points, number first */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px var(--gutter); }
.stat .figure { margin: 0 0 14px; font-size: 30px; line-height: 1; letter-spacing: -0.02em; }
.stat h3 { margin: 0 0 0.4em; }
.stat p:last-child { margin-bottom: 0; }

/* experience: years on the left, the story on the right */
.job { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0 var(--gutter); margin-bottom: 2.2em; }
.job p { margin-bottom: 0.8em; }
.job p:last-child { margin-bottom: 0; }
.job .years { margin: 0; }
.prose .closing { margin: 3em 0 0; font-size: 19px; line-height: 1.4; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 24px 0 var(--gutter);
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  :root { --header-gap: 48px; }
  .site-header { flex-wrap: wrap; row-gap: 24px; }
  .intro { flex-basis: 100%; max-width: 40rem; padding-right: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root { --section-gap: 48px; }
  .site-header { flex-direction: column; row-gap: 20px; }
  .nav-group + .nav-group { margin-left: 0; }
  /* label on its own line, links stacked underneath (no empty column beside the links) */
  .nav-group { flex-direction: column; gap: 4px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview { display: none; }
  main > .back { margin: 40px 0; }
  article h1 { font-size: 24px; margin-bottom: 40px; }
  .row, .about .row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .media-2 { grid-template-columns: minmax(0, 1fr); }
  .job { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .about article h1 { font-size: 30px; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .preview, .tile { transition: none; }
}
