/* baikurazov.com
   One flat Saxon blue field, one light tone, two derived blues.
   Display: Bodoni Moda. Text and interface: IBM Plex Sans. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #1f4aa8;   /* the field; the hero images dissolve into exactly this */
  --light: #eef2fc;  /* text, lines, the lit side of the halftone */
  --deep: #143a92;   /* window title bars */
  --mist: #c5d2f3;   /* secondary text, 5.2:1 on the field */
  --line: rgba(238, 242, 252, .4);
  --line-strong: rgba(238, 242, 252, .75);

  --serif: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1rem, 4.4vw, 4rem);
  --wrap: 92rem;       /* widest text-and-window column */
  --stage: 100rem;     /* widest hero; equals --wrap plus both gutters, so the two line up */
  --gap: clamp(1.25rem, 2.6vw, 2.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  background: var(--blue);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--blue);
  color: var(--light);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--light); color: var(--blue); }

img, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color .15s, text-underline-offset .15s;
}
a:hover { text-decoration-color: var(--light); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 20;
  padding: .6rem .9rem;
  background: var(--light);
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { top: .75rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ---------- top bar ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--stage);
  margin-inline: auto;
  padding: 1.1rem var(--gutter);
  font-size: .9375rem;
  font-weight: 500;
}
.top a { text-decoration: none; padding-block: .35rem; }
.top a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.top__nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); list-style: none; }

/* ---------- windows ---------- */

.win {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--blue);
}
.win__bar {
  display: flex;
  align-items: stretch;
  background: var(--deep);
  border-bottom: 1px solid var(--line);
  font: 500 .8125rem/1.25 var(--sans);
  transition: background-color .2s, color .2s;
}
.win__name {
  flex: 1 1 auto;
  min-width: 0;
  padding: .5rem .7rem;
  font: inherit;
}
.win__cell {
  flex: none;
  padding: .5rem .7rem;
  border-left: 1px solid var(--line);
  color: var(--mist);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.win > img,
.win__pic > img { width: 100%; }

/* True colour under the pointer. The script stacks the real picture over the
   halftone (lazy-loaded, and only where a pointer can hover); it fades in on
   hover and on keyboard focus of the play button, and out again on leaving. */
.win__pic { position: relative; }
.win__colour {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
figure.win { transition: border-color .2s; }

/* feed windows: the project clips */
.win--feed { transition: border-color .2s; }
.win--feed .win__name { font-size: .9375rem; font-weight: 600; padding: .6rem .8rem; }
.win--feed .win__cell { padding: .6rem .8rem; font-size: .875rem; }
.win--feed:hover,
.win--feed:focus-within { border-color: var(--line-strong); }

.win__screen {
  position: relative;
  aspect-ratio: var(--ar, 16 / 9);
  background: var(--blue);
}
.win__poster,
.win__screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* An unloaded video is transparent, so the blue poster under it shows
   through until a frame arrives. With script on, the poster is lifted
   above the video while the window is idle. */
.win__poster { z-index: 0; }
.win__screen video { z-index: 1; }
.win__screen video:focus-visible { outline-offset: -4px; }
/* Chrome fills an unloaded player with dark grey; keep it clear so the poster shows */
.win__screen video::-webkit-media-controls { background-color: transparent; }
.js .win--feed[data-state="idle"] .win__poster,
.js .win--feed[data-state="loading"] .win__poster,
.win--feed[data-state="idle"] .win__colour,
.win--feed[data-state="loading"] .win__colour { z-index: 2; }

.win--feed.is-colour[data-state="idle"] .win__colour.is-ready { opacity: 1; }
@media (hover: hover) {
  .win:hover > .win__pic > .win__colour.is-ready,
  .win--feed[data-state="idle"]:hover .win__colour.is-ready,
  .win--feed[data-state="loading"]:hover .win__colour.is-ready { opacity: 1; }
  figure.win:hover { border-color: var(--light); }
}

.win__play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  width: 100%;
  padding: clamp(.6rem, 1.6vw, 1rem);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.win__play[hidden] { display: none; }
.win--chip-top .win__play { align-items: flex-start; }
.win__play:focus-visible { outline-offset: -5px; }
.win__chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem .55rem .75rem;
  border: 1px solid var(--light);
  border-radius: 3px;
  background: var(--light);
  color: var(--blue);
  font: 600 .9375rem/1 var(--sans);
  transition: background-color .15s, color .15s;
}
.win__chip svg { width: .7rem; height: .8rem; fill: currentColor; }
[data-loop] .win__chip { padding: .4rem .65rem .4rem .55rem; font-size: .8125rem; gap: .45rem; }
[data-loop] .win__chip svg { width: .55rem; height: .65rem; }
.win__play:hover .win__chip,
.win__play:focus-visible .win__chip { background: var(--blue); color: var(--light); }

/* live: the clip itself is playing */
.win--feed[data-state="live"] { border-color: var(--light); }
.win--feed[data-state="live"] .win__bar { background: var(--light); color: var(--blue); }
.win--feed[data-state="live"] .win__cell { color: var(--blue); border-color: rgba(31, 74, 168, .35); }

/* ---------- hero ---------- */

.hero { overflow: clip; }
.hero__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: .5rem var(--gutter) 0;
}
.hero__text { display: contents; }
.hero__name {
  order: 1;
  font: 400 clamp(3.25rem, 15.6vw, 5.5rem)/.92 var(--serif);
  letter-spacing: -.015em;
}
.hero__name span { display: block; }
.hero__role {
  order: 2;
  position: relative;
  z-index: 1;
  margin-top: .9rem;
  font-size: 1.0625rem;
  font-weight: 500;
}
.hero__art {
  order: 3;
  display: block;
  /* the tall plate carries its own blue margin; let it run to the screen edge */
  margin: -2.25rem calc(-1 * var(--gutter)) 0;
}
.hero__art img { width: 100%; }
.hero__intro {
  order: 4;
  position: relative;
  z-index: 1;
  margin-top: -1.5rem;
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.5;
}
.hero__go {
  order: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  margin-top: 1.4rem;
}
.hero__credit {
  order: 6;
  margin-top: 2rem;
  color: var(--mist);
  font-size: .8125rem;
}
.hero__win { display: none; }

.button {
  display: inline-block;
  padding: .7rem 1.1rem;
  border: 1px solid var(--light);
  border-radius: 3px;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.button:hover,
.button:focus-visible { background: var(--light); color: var(--blue); text-decoration: none; }

/* download link: the label, then the file type and size */
.dl__meta {
  margin-left: .45em;
  color: var(--mist);
  font-size: .875em;
  font-weight: 400;
  white-space: nowrap;
  transition: color .15s;
}
.dl:not(.button) {
  display: inline-block;
  padding-block: .55rem;
  font-weight: 500;
  text-decoration: none;
}
.dl:not(.button) .dl__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--line-strong);
}
.dl:not(.button):hover .dl__label { text-decoration-color: var(--light); text-decoration-thickness: 2px; }
.button:hover .dl__meta,
.button:focus-visible .dl__meta { color: inherit; }

@media (min-width: 40rem) and (max-width: 56.24rem) {
  .hero__stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: 1fr auto auto auto auto auto;
    column-gap: 0;
    padding-top: 0;
  }
  .hero__stage > *, .hero__text > * { grid-column: 1; }
  .hero__name { grid-row: 2; font-size: clamp(3rem, 8.4vw, 4.75rem); }
  .hero__role { grid-row: 3; }
  .hero__intro { grid-row: 4; margin-top: 1rem; }
  .hero__go { grid-row: 5; }
  .hero__credit { grid-row: 6; margin-top: 1.5rem; padding-bottom: 2rem; }
  .hero__stage > .hero__art {
    grid-column: 2;
    grid-row: 1 / -1;
    margin: 0 calc(-1 * var(--gutter)) 0 0;
    align-self: center;
  }
}

@media (min-width: 56.25rem) {
  .top {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 5;
  }
  .hero__stage {
    position: relative;
    display: block;
    max-width: var(--stage);
    margin-inline: auto;
    padding: 0;
    aspect-ratio: 16 / 9;
  }
  .hero__art {
    position: absolute;
    inset: 0;
    margin: 0;
    /* slide the plate right: its left third is flat blue, kept for the name */
    transform: translateX(6%);
  }
  .hero__art img { width: 100%; height: 100%; }
  .hero__text {
    display: block;
    position: absolute;
    z-index: 2;
    left: var(--gutter);
    bottom: 12%;
    width: 33%;
  }
  .hero__name { font-size: clamp(3rem, 6.1vw, 6.1rem); }
  .hero__role { margin-top: 1.1rem; font-size: clamp(1rem, 1.35vw, 1.3rem); }
  .hero__intro {
    margin-top: clamp(.9rem, 1.6vw, 1.6rem);
    max-width: 27rem;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
  }
  .hero__go { margin-top: clamp(1rem, 1.8vw, 1.9rem); }
  .hero__credit {
    position: absolute;
    z-index: 2;
    right: var(--gutter);
    bottom: 3.2%;
    margin: 0;
    font-size: .75rem;
  }

  .hero__win {
    display: block;
    position: absolute;
    z-index: 3;
    border-color: var(--line-strong);
  }
  .hero__win .win__bar { font-size: clamp(.625rem, .8vw, .75rem); }
  .hero__win .win__name { padding: .35em .6em; }
  .hero__win--hand { left: 30.5%; top: 11%; width: 12.5%; }
  .hero__win--face { right: 2.4%; top: 13.5%; width: 13.5%; }
  .hero__win--eye { right: 5.6%; top: 57%; width: 10.5%; }
}

@media (min-width: 56.25rem) and (max-width: 68.74rem) {
  .hero__win--eye { display: none; }
  .hero__credit { display: none; }
  .hero__text { bottom: 8%; }
}

/* the one orchestrated moment: the plate resolves, then its detail windows open */
@media (prefers-reduced-motion: no-preference) {
  .hero__art img { animation: resolve 1.5s var(--ease) both; }
  .hero__win {
    animation: open .55s var(--ease) both;
    animation-delay: calc(.85s + var(--i, 0) * .16s);
  }
}
@keyframes resolve {
  from { opacity: 0; filter: blur(16px) contrast(.6); transform: scale(1.035); }
  to { opacity: 1; filter: none; transform: none; }
}
@keyframes open {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* ---------- sections ---------- */

.section { padding-block: clamp(4.5rem, 11vw, 9.5rem) 0; }
.section h2 {
  font: 400 clamp(2.75rem, 6vw, 5rem)/1 var(--serif);
  letter-spacing: -.015em;
}
.section__head {
  display: grid;
  gap: .9rem;
  margin-bottom: clamp(2rem, 4.5vw, 3.5rem);
}
.section__head p { color: var(--mist); max-width: 34rem; }

/* Bodoni's hairlines thin out as its optical size rises. Sentence-sized
   display text is pinned to a low optical size so the hairlines hold up
   in light on blue. */
.lede {
  font: 400 clamp(1.4rem, 2.05vw, 1.8rem)/1.2 var(--serif);
  font-variation-settings: "opsz" 12;
  text-wrap: balance;
}

/* ---------- projects ---------- */

.feeds { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(3.5rem, 8vw, 7rem); }
.feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem var(--gap); align-content: start; }
.feed__text { display: grid; gap: .8rem; align-content: start; max-width: 38rem; }
.feed__text > div { display: grid; gap: .8rem; align-content: start; }
.feed__text p:not(.lede) { color: var(--light); }

.steps {
  display: grid;
  gap: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.pair, .duo { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(3.5rem, 8vw, 7rem); }
.feed--tall .win { width: min(100%, 17rem); }
.feed--small .win { width: min(100%, 19rem); }

@media (min-width: 40rem) {
  .pair > .feed { flex: var(--ar) 1 0; min-width: 0; }
  .feed--tall { grid-template-columns: 17rem minmax(0, 1fr); align-items: end; }

  .feed__text--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); max-width: none; }

  /* the two simulation clips: the long one large, the 5 second loop beside it */
  .duo { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem var(--gap); align-items: start; }
  .feed--small .win { width: 100%; }
}

@media (min-width: 60rem) {
  /* two windows share a row at equal height: each grows by its aspect ratio */
  .pair--tall { display: flex; align-items: flex-start; gap: var(--gap); }
  .feed--tall { grid-template-columns: minmax(0, 1fr); }
  .feed--tall .win { width: 100%; }
}

@media (min-width: 64rem) {
  .feed--side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: end; }
  .feed__text--cols { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: calc(var(--gap) * 2); }
  .feed--lead .feed__text { margin-top: .5rem; }

  /* The loop's column is exactly as tall as the large window: its sentence
     starts level with that window's top, its own window ends level with the
     bottom. The large clip's text sits on the row below. */
  .duo { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: auto auto; }
  .duo > .feed:first-child { grid-row: 1 / span 2; grid-template-rows: subgrid; }
  .duo > .feed--small {
    grid-row: 1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .duo > .feed--small .feed__text { order: -1; }
  .feed--small .lede { font-size: clamp(1.5rem, 2.3vw, 2.1rem); }
}

/* ---------- about ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem clamp(2rem, 5vw, 4.5rem); }
.about__portrait { width: min(100%, 20rem); }
.about__body { display: grid; gap: 1.4rem; align-content: start; }
.statement {
  font: 400 clamp(1.6rem, 3.6vw, 4rem)/1.12 var(--serif);
  font-variation-settings: "opsz" 20;
  letter-spacing: -.01em;
  max-width: 22em;
  text-wrap: balance;
}
.about__more { max-width: 36rem; }
.about__cv { margin-top: .4rem; }

@media (min-width: 48rem) {
  /* heading level with the top of the portrait, the text ending level with its foot */
  .about { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); grid-template-rows: auto 1fr; align-items: start; }
  .about__portrait { grid-column: 1; grid-row: 1 / span 2; width: 100%; max-width: 24rem; }
  .about > h2, .about__body { grid-column: 2; }
  .about__body { align-self: end; }
}
@media (min-width: 72rem) {
  .about { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
  .about__portrait { max-width: 22rem; }
}

/* ---------- contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: end; }
.contact__body { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.contact__links { list-style: none; display: grid; gap: 1.25rem; }
.contact__links li { display: grid; gap: .1rem; }
.contact__kind { color: var(--mist); font-size: .9375rem; }
.contact__links a {
  justify-self: start;
  font: 400 clamp(1.25rem, 5.5vw, 3rem)/1.15 var(--serif);
  font-variation-settings: "opsz" 14;
  overflow-wrap: anywhere;
  text-underline-offset: .16em;
}
.contact__rock { width: min(100%, 26rem); }

@media (min-width: 56.25rem) {
  .contact { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .contact__links a { font-size: clamp(2rem, 3.6vw, 3.25rem); }
  .contact__rock { width: 100%; justify-self: end; }
}

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

.foot { padding-block: clamp(3.5rem, 8vw, 6rem) 2.5rem; }
.foot__in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--mist);
  font-size: .875rem;
}
.foot__in p:first-child { max-width: 44rem; }

/* ---------- 404 ---------- */

.lost {
  min-height: calc(100vh - 4.5rem);
  min-height: calc(100svh - 4.5rem);
  display: grid;
  align-content: center;
  padding-block: 2rem 4rem;
}
.lost__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lost h1 { font: 400 clamp(3rem, 9vw, 6.5rem)/.95 var(--serif); letter-spacing: -.015em; }
.lost__body { display: grid; gap: 1.25rem; justify-items: start; }
.lost__body p { max-width: 28rem; font-size: 1.125rem; }
.lost .win { width: min(100%, 26rem); }
.top--static { position: static; }
@media (min-width: 56.25rem) {
  .lost__in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .lost .win { width: 100%; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
