/* maievskyi.com
   One idea: a single vertical line (the path) runs down every page.
   Sections are checkpoints on it (double tick), items are stops (single tick).
   State is line form: solid = done, dashed = planned. One accent: the yellow mark. */

@font-face {
  font-family: "Martian Grotesk";
  src: url("/fonts/martian-grotesk.woff2") format("woff2");
  font-weight: 100 1000;
  font-stretch: 75% 200%;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ground: oklch(96.5% 0.006 230);
  --ink: oklch(22% 0.015 250);
  --muted: oklch(46% 0.015 250);
  --hair: oklch(82% 0.01 250);
  --mark: oklch(88% 0.18 98);
  --on-mark: oklch(22% 0.015 250);

  --rail: 0.5rem;           /* x position of the path */
  --tick: 1rem;             /* checkpoint tick width */
  --gutter: 1rem;
  --step: 3.5rem;           /* space between checkpoints */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: oklch(19% 0.012 250);
    --ink: oklch(93% 0.006 230);
    --muted: oklch(72% 0.012 250);
    --hair: oklch(36% 0.012 250);
  }
}

@media (min-width: 52rem) {
  :root {
    --rail: 13rem;
    --tick: 1.5rem;
    --gutter: 2rem;
    --step: 5.5rem;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--muted) var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Martian Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  caret-color: var(--ink);
}

::selection { background: var(--mark); color: var(--on-mark); }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { background: var(--mark); color: var(--on-mark); text-decoration-color: transparent; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--ground);
  z-index: 2;
}
.skip:focus { top: 0.5rem; }

/* ---- the path ---------------------------------------------------------- */

.path {
  position: relative;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: 2rem;
}
.path::before {               /* the line itself */
  content: "";
  position: absolute;
  top: 0;
  bottom: 5rem;
  left: calc(var(--gutter) + var(--rail));
  border-left: 1px solid var(--ink);
}
.path::after {                /* it does not end here: the tail is still planned */
  content: "";
  position: absolute;
  bottom: 0;
  height: 5rem;
  left: calc(var(--gutter) + var(--rail));
  border-left: 1px dashed var(--ink);
}

/* every row on the path: a margin column left of the line, content right of it */
.row {
  position: relative;
  padding-left: calc(var(--rail) + 1.5rem);
}
.row > .side {
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums lining-nums;
}

@media (min-width: 52rem) {
  .row { padding-left: calc(var(--rail) + 3rem); }
  .row > .side {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--rail) - 2rem);
    text-align: right;
  }
}

/* checkpoint: double tick across the line */
.gate { margin-top: var(--step); }
.gate::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) - var(--tick) / 2);
  top: 0.42rem;
  width: var(--tick);
  height: 5px;
  border-block: 1px solid var(--ink);
  background: var(--ground);
}
.gate > h2.side { margin-bottom: 0.9rem; }
@media (min-width: 52rem) {
  .gate > h2.side { margin-bottom: 0; }
}

/* stop: single tick, for items inside a checkpoint */
.stop { margin-top: 2rem; }
.stop:first-child { margin-top: 0; }
.stop::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) - var(--tick) / 4);
  top: 0.72em;
  width: calc(var(--tick) / 2);
  border-top: 1px solid var(--ink);
}
/* nested rows share the page's line, so undo the parent's offset */
.gate > .stops { margin-left: calc(-1 * (var(--rail) + 1.5rem)); }
@media (min-width: 52rem) {
  .gate > .stops { margin-left: calc(-1 * (var(--rail) + 3rem)); }
}

/* planned: this stretch of the line is dashed */
.stop.planned::after {
  content: "";
  position: absolute;
  left: calc(var(--rail) - 1px);
  top: -2rem;
  bottom: 0;
  width: 3px;
  background:
    repeating-linear-gradient(to bottom, var(--ink) 0 4px, transparent 4px 8px) 1px 0 / 1px 100% no-repeat,
    var(--ground);
}
.stop.planned::before { border-top-style: dashed; z-index: 1; }

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

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-top: 1.5rem;
}
.top .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 1rem; }
.name {
  font-size: 1rem;
  font-weight: 750;
  font-stretch: 150%;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.name a { text-decoration: none; }
.role { font-stretch: 75%; font-weight: 500; font-size: 0.875rem; color: var(--muted); }
.top nav ul { display: flex; gap: 1.5rem; }
.top nav a {
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-block;
  padding-block: 0.5rem;
}
.top nav a[aria-current="page"] { text-decoration-thickness: 2px; }

@media (min-width: 52rem) {
  .top { padding-top: 2.25rem; }
}

/* ---- type -------------------------------------------------------------- */

.thesis {
  font-size: clamp(1.7rem, 1.05rem + 3.1vw, 3.6rem);
  font-weight: 680;
  font-stretch: 86%;
  line-height: 1.1;
  letter-spacing: -0.022em;
  max-width: 27ch;
  text-wrap: balance;
}
.thesis .setup { color: var(--muted); display: block; margin-bottom: 0.35em; }

.gate.first { margin-top: 3.5rem; }
@media (min-width: 52rem) {
  .gate.first { margin-top: 6.5rem; }
  .gate.first::before { top: 1.35rem; }
  .gate.first > .side { top: 0.95rem; }
}

.page-title {
  font-size: clamp(2.2rem, 1.4rem + 4vw, 4.5rem);
  font-weight: 720;
  font-stretch: 120%;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 34rem;
  margin-top: 1.75rem;
}
.prose { max-width: 36rem; }
.prose p + p { margin-top: 1em; }

.claim {
  font-size: 1.25rem;
  font-weight: 680;
  font-stretch: 92%;
  line-height: 1.25;
  letter-spacing: -0.012em;
}
.stop p { max-width: 34rem; }
.stop .claim + p { margin-top: 0.4rem; }
.stop .meta { color: var(--muted); }
.stop .links { margin-top: 0.4rem; font-size: 0.9375rem; }
.stop .links a + a { margin-left: 1rem; }

.upcoming {
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  border: 1px dashed var(--ink);
  padding: 0.1rem 0.4rem;
  margin-right: 0.5rem;
  vertical-align: 0.15em;
}

/* the one accent: the current position on the path */
.mark {
  display: block;
  background: var(--mark);
  color: var(--on-mark);
  padding: 1.1rem 1.25rem 1.2rem;
  max-width: 38rem;
}
.mark .meta { color: inherit; }
.mark a:hover { background: var(--on-mark); color: var(--mark); }
.mark a:focus-visible { outline-color: var(--on-mark); }
.gate.current::before { background: var(--mark); height: 7px; top: 0.36rem; }
.gate.current.planned::before { border-block-style: dashed; }
.more { margin-top: 1.25rem; font-weight: 600; font-stretch: 86%; }

.contact-line {
  font-size: clamp(1.2rem, 0.9rem + 1.4vw, 1.9rem);
  font-weight: 680;
  font-stretch: 86%;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.contact-line + p { margin-top: 0.9rem; }
.also a + a { margin-left: 1.25rem; }

/* ---- home: the person first ------------------------------------------- */

.hero { display: grid; gap: 2rem; align-items: end; }
@media (min-width: 52rem) { .hero { grid-template-columns: minmax(0, 1fr) 17rem; gap: 3rem; } }
.big-name {
  font-size: clamp(2.5rem, 1rem + 6.2vw, 5.4rem);
  font-weight: 740;
  font-stretch: 118%;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.big-role {
  margin-top: 1.1rem;
  font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem);
  font-weight: 650;
  font-stretch: 86%;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.hero .lede { margin-top: 1.1rem; }
.now {
  display: inline-block;
  margin-top: 1.5rem;
  border: 1px solid var(--ink);
  padding: 0.45rem 0.8rem 0.5rem;
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.875rem;
}
.now span { color: var(--muted); margin-right: 0.5rem; }
.hero .portrait { max-width: 17rem; }
.hero .portrait img { width: 100%; }
.facts { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; margin: 2rem 0 0; }
.facts div { min-width: 8rem; }
.facts dt { font-size: 2rem; font-weight: 700; font-stretch: 86%; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.facts dd { margin: 0.35rem 0 0; font-stretch: 75%; font-weight: 600; font-size: 0.8125rem; color: var(--muted); }
.gate.first.person::before { top: 1.6rem; }
@media (min-width: 52rem) { .gate.first.person { margin-top: 5rem; } .gate.first.person::before { top: 2.6rem; } }
.spaced { margin-top: 1.75rem; }
.lede.flush { margin-top: 0; }

/* ---- speaking page ----------------------------------------------------- */

.portrait { max-width: 15rem; }
.portrait img { filter: grayscale(1) contrast(1.05); }
.portrait figcaption { margin-top: 0.6rem; font-size: 0.9375rem; }

.gate > .label { margin-bottom: 1.75rem; }
.label, .bio h3 {
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.bio + .bio { margin-top: 1.5rem; }

/* a gap: something Liu still has to supply. Must not be deployed. */
.gap {
  border: 1px dashed var(--ink);
  padding: 0.75rem 1rem;
  max-width: 34rem;
  font-size: 0.9375rem;
}
.gap::before {
  content: "Missing";
  display: inline-block;
  background: var(--ink);
  color: var(--ground);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
  margin-right: 0.6rem;
}

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

.end {
  margin-top: var(--step);
  padding-bottom: 4rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: background-color 120ms ease-out, color 120ms ease-out; }
}

@media print {
  .path::before, .path::after, .top nav, .skip { display: none; }
}
