/* ------------------------------------------------------------------
   Sasha Kudymov — portfolio
   Document style: slab serif body, mono for metadata, numbered
   sections with rules, superscript references, a References list.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light dark;

  --bg: #fcfcfb;
  --fg: #171716;
  --fg-2: #4f4f4b;
  --fg-3: #85857f;
  --rule: #d9d9d4;
  --rule-soft: #ebebe7;
  --link: #1d4f8c;
  --underline: #c9dbf5;
  --target: #fff5b8;

  --serif: "Bitter", "Roboto Slab", "Zilla Slab", "Rockwell", Georgia, serif;
  --display: "Gloock", "Bitter", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 50rem;
  --gutter: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110;
    --fg: #e8e8e5;
    --fg-2: #b0b0aa;
    --fg-3: #77776f;
    --rule: #33332f;
    --rule-soft: #232321;
    --link: #8db4e8;
    --underline: #22406f;
    --target: #3a3410;
  }
}
:root[data-theme="dark"] {
  --bg: #111110;
  --fg: #e8e8e5;
  --fg-2: #b0b0aa;
  --fg-3: #77776f;
  --rule: #33332f;
  --rule-soft: #232321;
  --link: #8db4e8;
  --underline: #22406f;
  --target: #3a3410;
}

/* Base ------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.0625rem;           /* 17px */
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0;
  padding: 3rem var(--gutter) 4rem;
}
@media (min-width: 640px) {
  .page { padding: 4rem 3rem 6rem; }
}

a {
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: .15em;
  text-underline-offset: .1em;
  text-decoration-skip-ink: auto;
  transition: text-decoration-color .2s var(--ease, ease);
}
a:hover { text-decoration-color: var(--link); }
.refs a, .footer a { font-weight: 400; text-underline-offset: auto; }
a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.refs, sup.ref, .footer {
  font-family: var(--mono);
  font-feature-settings: "tnum", "zero";
}

.sep {
  display: inline-block;
  margin: 0 .55em;
  color: var(--fg-3);
}

/* Masthead --------------------------------------------------------- */

.masthead {
  margin-bottom: 2rem;
}
.name {
  margin: 0 0 .75rem;
  font-family: var(--display);
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem);
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.01em;
}
.byline {
  margin: .5rem 0 0;
  color: var(--fg-2);
  max-width: 44rem;
  text-wrap: pretty;
}

/* Intro ------------------------------------------------------------ */

.intro p { text-wrap: pretty; }
.lede {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.75rem);
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 1rem;
}
.intro p:not(.lede) { color: var(--fg-2); }

/* Superscript references ------------------------------------------ */

sup.ref {
  font-size: .68em;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: -.55em;
  margin-left: .06em;
  white-space: nowrap;
}
sup.ref a { text-decoration: none; }
sup.ref a:hover { text-decoration: underline; }

/* Sections --------------------------------------------------------- */

.block { margin-top: 4rem; }

.heading {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.005em;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry + .entry { margin-top: 3rem; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.entry-name {
  font-size: 1.125rem;
  font-weight: 600;
}
.entry-role {
  margin: .25rem 0 0;
  color: var(--fg-3);
  text-wrap: pretty;
}
.role-when { color: var(--fg-3); white-space: nowrap; }
.entry-desc {
  margin: .5rem 0 0;
  color: var(--fg-2);
  max-width: 44rem;
  text-wrap: pretty;
}
.entry-desc--note { margin-top: 1rem; }
#references.heading { margin-bottom: 1.5rem; }

.subheading {
  margin: 1.5rem 0 .75rem;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Highlighter: a stretched SVG stroke painted behind the words. */
.hl {
  color: inherit;
  background-color: transparent;
  background-image: var(--hl-shape);
  background-repeat: no-repeat;
  background-size: 100% .78em;
  background-position: 0 82%;
  padding: .04em .25em .02em;
  margin: 0 -.25em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hl-broadcom, .hl-vmware, .hl-acronis { font-weight: 600; color: var(--fg); }
.entry-name .hl { font-weight: 650; }

/* In the Work section the stroke appears on hover of the entry. */
.entry .hl {
  background-size: 0% .78em;
  transition: background-size .35s cubic-bezier(.2, .7, .2, 1);
}
.entry:hover .hl,
.entry:focus-within .hl { background-size: 100% .78em; }
@media (hover: none) {
  .entry .hl { background-size: 100% .78em; }
}
@media (prefers-reduced-motion: reduce) {
  .entry .hl { transition: none; }
}

.hl-yellow { --hl-shape: var(--hl-yellow); }
.heading .hl { background-size: 100% .7em; background-position: 0 88%; }
.hl-green  { --hl-shape: var(--hl-green); }
.hl-broadcom { --hl-shape: var(--hl-broadcom); }
.hl-vmware   { --hl-shape: var(--hl-vmware); }
.hl-acronis  { --hl-shape: var(--hl-acronis); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 6rem 1fr;
  column-gap: .5rem;
  row-gap: .8rem;
}
.timeline li { display: contents; }
.tl-when {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--fg-3);
  white-space: nowrap;
  padding-top: .2em;
}
.tl-what { color: var(--fg-2); text-wrap: pretty; }
.tl-what a { font-weight: 500; }
.tl-what strong { font-weight: 600; }
.tl-what strong { color: var(--fg); }
.tl-note {
  display: block;
  margin-top: .1rem;
  max-width: 42rem;
}

@media (max-width: 480px) {
  .entry-head { flex-wrap: wrap; gap: .25rem .75rem; }
  .timeline { grid-template-columns: 1fr; row-gap: .9rem; }
  .tl-when { padding-top: 0; }
}

/* References ------------------------------------------------------- */

.refs {
  margin: 0;
  padding-left: 1.75em;
  font-size: .8125rem;
  line-height: 1.7;
  color: var(--fg-2);
}
.refs li {
  padding: .1rem .3rem .1rem .25rem;
  margin-left: -.25rem;
}
.refs li::marker { color: var(--fg-3); }
.refs .back {
  color: var(--fg-3);
  margin-right: .4em;
}
.refs li:target { background: var(--target); }

/* Project pages ---------------------------------------------------- */

.crumb {
  margin-bottom: 2rem;
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--fg-3);
}
.crumb a { font-weight: 400; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: .75rem 1.5rem;
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.6;
}
.facts div { margin: 0; }
.facts dt {
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .6875rem;
  font-weight: 500;
}
.facts dd { margin: 0; color: var(--fg-2); }
.facts a { font-weight: 400; }

.figure {
  margin: 2rem 0 0;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 44rem;
}
.figure figcaption {
  margin-top: .6rem;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--fg-3);
  max-width: 44rem;
}

.prose { max-width: 44rem; color: var(--fg-2); }
.prose p { text-wrap: pretty; }
.prose + .timeline { margin-top: 1.25rem; }

.timeline--steps .tl-when { padding-top: .2em; }
.timeline--steps { grid-template-columns: 9rem 1fr; }

.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
  color: var(--fg-2);
}
.plain li { margin: 0 0 .9rem; text-wrap: pretty; }
.plain strong { color: var(--fg); font-weight: 600; }

.entry-name a { color: inherit; font-weight: inherit; }

@media (max-width: 480px) {
  .timeline--steps { grid-template-columns: 1fr; }
}

/* Footer ----------------------------------------------------------- */

.footer {
  margin-top: 5rem;
  color: var(--fg-3);
  font-size: .8125rem;
}
.footer p { margin: 0 0 .25rem; }

/* Motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Print ------------------------------------------------------------ */

@media print {
  .page { padding: 0; max-width: none; }
  a { color: inherit; }
  .footer { display: none; }
}
