/* farhour.com: a deck of slides on a wide screen, a plain document on a phone.
   One dark look by design: a faint grid, a serif for statements, a mono for
   labels, and one vermilion accent. */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --stage: #08080a;
  --slide: #0f0f11;
  --panel: #17171a;
  --bone: #ece5d8;
  --soft: #b9b2a6;
  --muted: #8d877d;
  --accent: #ff5a36;
  --hair: rgba(236, 229, 216, 0.16);
  --edge: rgba(236, 229, 216, 0.35);
  --grid: rgba(236, 229, 216, 0.08);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1rem, 6vw, 7.5rem);
}

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

html {
  background: var(--stage);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Proximity, not mandatory: a slide taller than the screen stays readable. */
@media (min-width: 60em) and (min-height: 36em) {
  html {
    scroll-snap-type: y proximity;
  }
}

body {
  margin: 0;
  color: var(--bone);
  background: var(--stage);
  font: 400 1rem/1.6 var(--mono);
}

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

/* Slides */

main > section {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vh, 2.5rem);
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.25rem, 5vh, 3.5rem) var(--pad);
  border-bottom: 1px solid var(--hair);
  scroll-snap-align: start;
  background:
    radial-gradient(ellipse 60% 70% at 72% 50%, rgba(255, 90, 54, 0.06), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 80px 80px,
    var(--slide);
}

/* Fade the grid toward the edges of each slide. */
main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, var(--slide) 85%);
}

.chrome {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.body {
  flex: 1;
  display: grid;
  align-content: center;
  gap: clamp(1.75rem, 5vh, 3rem);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.narrow {
  max-width: 52rem;
}

@media (min-width: 60em) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    column-gap: clamp(2.5rem, 6vw, 6rem);
  }
}

/* Type */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
}

h2 em {
  font-style: italic;
  color: var(--accent);
}

h1 {
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2.5rem, 5.2vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.1;
}

p {
  margin: 0;
}

.label {
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count b {
  color: var(--accent);
  font-weight: 500;
}

.headline {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.lede {
  max-width: 40em;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Links and buttons */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.actions,
.cards,
.panels,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--edge);
  color: var(--bone);
  font: 500 1rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.button:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--stage);
}

.button.email {
  letter-spacing: 0.02em;
  text-transform: none;
}

.link {
  color: var(--bone);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
}

.link:hover {
  color: var(--accent);
}

.ruler {
  height: 18px;
  border-top: 1px solid var(--hair);
  background: repeating-linear-gradient(90deg, var(--hair) 0 1px, transparent 1px 24px);
}

/* Cards: the areas of work */

.cards {
  display: grid;
  gap: 1.75rem 2.5rem;
}

@media (min-width: 40em) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cards li {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hair);
}

.cards p,
.panel p,
.note,
.venue {
  color: var(--soft);
}

/* Panels: the things built */

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.panels.three {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: rgba(23, 23, 26, 0.9);
  border: 1px solid var(--hair);
}

.panel p.label {
  color: var(--muted);
}

.panel .stat,
.panel .stats,
.panel .more {
  margin-top: auto;
}

.stat {
  padding-top: 0.75rem;
  border-top: 1px solid var(--hair);
  font-weight: 500;
}

.panel p.stat {
  color: var(--bone);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hair);
}

.stats div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stats dt {
  color: var(--muted);
}

/* The number shows above its label; screen readers still read the label first. */
.stats dd {
  order: -1;
  margin: 0;
  font: 400 clamp(2.25rem, 3.5vw, 3rem) / 1 var(--serif);
}

/* Research */

.paper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--panel);
  border: 1px solid var(--hair);
  color: var(--bone);
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.paper:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.paper-title {
  font: 400 clamp(1.75rem, 3vw, 2.75rem) / 1.1 var(--serif);
}

.paper .doi {
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: none;
}

/* The path */

#path h2 {
  font-size: clamp(2.5rem, 4vw, 4rem);
}

.timeline {
  border-bottom: 1px solid var(--hair);
}

.timeline li {
  display: grid;
  gap: 0.25rem 2rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--hair);
  line-height: 1.5;
}

@media (min-width: 60em) {
  .timeline li {
    grid-template-columns: 9rem minmax(0, 15rem) minmax(0, 1fr);
    align-items: baseline;
  }
}

.when {
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.role {
  font: 400 1.375rem / 1.2 var(--serif);
}

/* Contact */

.contact h2 {
  font-size: clamp(3.5rem, 10vw, 9rem);
}

/* A wide, short screen, such as 1440 by 780: tighten the vertical spacing so each slide fits. */

@media (min-width: 60em) and (max-height: 55em) {
  main > section {
    gap: 1rem;
    padding-block: 1.25rem;
  }

  .body {
    gap: 1.25rem;
  }

  .timeline li {
    padding-block: 0.3rem;
  }

  #path h2 {
    font-size: clamp(2.25rem, 3.4vw, 3.25rem);
  }
}

/* Progress bar, driven by site.js */

.progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  height: 3px;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
