/* Night flight
   One flight, taken at night, landing at first light. Scrolling moves the
   camera forward; content hangs on frames along the flight path.

   Without scripts, or with reduced motion, this is a plain document whose
   sections each sit in a fixed slice of the same sky. With html.fly the
   page becomes a fixed stage and main.js flies the camera. */

:root {
  /* sky, in the order the flight passes through it */
  --night: #0A1424;
  --cloud: #1C2C4C;
  --predawn: #4B4370;
  --first: #EFC9A0;
  --morning: #DCE4EC;
  /* text */
  --star: #F2F5F9;
  --star-2: #B9C3D3;
  --ink: #0E1726;
  --ink-2: #344055;

  --font: "Jost", "Futura", "Century Gothic", ui-sans-serif, system-ui, sans-serif;

  /* type scale; frames multiply by --fit when a viewport is too short */
  --fs-name: clamp(3.25rem, 1.4rem + 5.6vw, 7rem);
  --fs-state: clamp(2rem, 1rem + 3.3vw, 4rem);
  --fs-contact: clamp(1.875rem, 1rem + 2.6vw, 3.375rem);
  --fs-title: clamp(1.75rem, 1.3rem + 1vw, 2.25rem);
  --fs-lead: clamp(1.125rem, 1rem + .35vw, 1.3125rem);
  --fs-body: clamp(1.0625rem, 1rem + .15vw, 1.125rem);
  --fs-small: .9375rem;

  --gutter: clamp(24px, 5vw, 56px);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--star);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
time { font-variant-numeric: tabular-nums; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .32em;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  transition: text-decoration-color .2s;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--first); color: var(--ink); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed; z-index: 40; left: 12px; top: 12px;
  padding: 10px 16px;
  background: var(--star); color: var(--ink);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

.bar {
  position: fixed; z-index: 20; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px calc(var(--gutter) - 8px);
  font-size: var(--fs-small);
  color: var(--star);
  transition: color .6s ease;
  pointer-events: none;
}
.bar a {
  pointer-events: auto;
  display: inline-block;
  padding: 8px;
  text-decoration-color: transparent;
}
.bar a:hover { text-decoration-color: currentColor; }
.bar__nav { display: flex; gap: 12px; }
.is-day .bar { color: var(--ink); }

/* ---------- frames ---------- */

.frame { --fit: 1; --fw: 60rem; --fg2: var(--star-2); }

.frame--hero { --fw: 44rem; text-align: center; }
.frame--hero h1 {
  font-weight: 300;
  font-size: calc(var(--fit) * var(--fs-name));
  line-height: .9;
  letter-spacing: -.025em;
}
.hero__role {
  margin-top: 1.1rem;
  font-size: calc(var(--fit) * var(--fs-lead));
}
.hero__line {
  max-width: 27em;
  margin: .4rem auto 0;
  color: var(--fg2);
  text-wrap: balance;
}

.frame--line { --fw: 60rem; }
.statement {
  font-weight: 300;
  font-size: calc(var(--fit) * var(--fs-state));
  line-height: 1.1;
  letter-spacing: -.015em;
  text-align: center;
  text-wrap: balance;
}

/* projects */
.project {
  --fw: 68rem;
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 35rem);
  justify-content: space-between;
  align-items: center;
  column-gap: 4rem;
}
.project__visual { color: var(--star); }
.project__visual svg { display: block; width: 100%; height: auto; overflow: visible; }
.project h3 {
  font-weight: 300;
  font-size: calc(var(--fit) * var(--fs-name));
  line-height: .9;
  letter-spacing: -.025em;
  margin-left: -.045em;
}
.project__meta {
  margin-top: .9rem;
  font-size: calc(var(--fit) * var(--fs-small));
  color: var(--fg2);
}
.project__lead {
  margin-top: 1.25rem;
  max-width: 30em;
  font-size: calc(var(--fit) * var(--fs-lead));
  line-height: 1.45;
  text-wrap: pretty;
}
.project__body {
  margin-top: .75rem;
  max-width: 34em;
  font-size: calc(var(--fit) * var(--fs-body));
  color: var(--fg2);
  text-wrap: pretty;
}
.project__stack {
  margin-top: 1.1rem;
  font-size: calc(var(--fit) * var(--fs-small));
  color: var(--fg2);
}
.project__link {
  display: inline-block;
  margin-top: .9rem;
  padding: 4px 0;
  font-size: calc(var(--fit) * var(--fs-body));
}

/* the fine-line figures */
.fig-line, .fig-soft {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fig-soft { stroke-opacity: .42; }
.fig-dots circle { fill: currentColor; fill-opacity: .9; }
.fig-key { fill: currentColor; fill-opacity: .16; }
.fig-edges path { fill: none; stroke: currentColor; stroke-opacity: .2; stroke-width: 1; }
.fig-nodes circle { fill: currentColor; fill-opacity: .55; }

/* logbook */
.frame-title {
  font-weight: 300;
  font-size: calc(var(--fit) * var(--fs-title));
  line-height: 1.1;
  letter-spacing: -.01em;
}
.logbook { --fw: 68rem; }
.log { margin-top: 1.5rem; }
.log__row {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 17rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 2rem;
  padding: 1rem 0;
  font-size: calc(var(--fit) * var(--fs-small));
  line-height: 1.5;
}
.log__when { grid-row: 1 / span 2; color: var(--fg2); font-variant-numeric: tabular-nums; }
.log__what { display: contents; }
.log__what h3 {
  grid-column: 2;
  font-weight: 400;
  font-size: calc(var(--fit) * var(--fs-body));
  line-height: 1.35;
}
.log__where { grid-column: 2; color: var(--fg2); }
.log__what p:last-child { grid-column: 3; grid-row: 1 / span 2; text-wrap: pretty; }

/* toolkit */
.toolkit { --fw: 52rem; }
.kit { margin-top: 1.25rem; }
.kit > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  column-gap: 2rem;
  padding: .5rem 0;
  font-size: calc(var(--fit) * var(--fs-small));
  line-height: 1.5;
}
.kit dt { color: var(--fg2); }
.kit dd { text-wrap: pretty; }

/* landing */
.landing { --fw: 46rem; --fg2: var(--ink-2); text-align: center; color: var(--ink); }
.landing h2 {
  font-weight: 300;
  font-size: calc(var(--fit) * var(--fs-contact));
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.landing__lead { margin-top: 1.5rem; color: var(--fg2); font-size: calc(var(--fit) * var(--fs-body)); }
.landing__mail {
  margin-top: .35rem;
  font-size: calc(var(--fit) * clamp(1.375rem, 1.1rem + 1vw, 1.875rem));
}
.landing__mail a { display: inline-block; padding: 2px 0; }
.landing__links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem 2rem;
  margin-top: 1.75rem;
  font-size: calc(var(--fit) * var(--fs-body));
}
.landing__links a { display: inline-block; padding: 6px 0; }
.landing__foot { margin-top: 2.5rem; font-size: calc(var(--fit) * var(--fs-small)); color: var(--fg2); }
.landing__foot span { display: block; }

/* ---------- tablets ---------- */

@media (min-width: 761px) and (max-width: 1099px) {
  .log__row { grid-template-columns: 9.5rem minmax(0, 1fr); grid-template-rows: none; }
  .log__when { grid-row: 1 / span 3; }
  .log__what h3, .log__where, .log__what p:last-child { grid-column: 2; grid-row: auto; }
  .log__what p:last-child { margin-top: .2rem; max-width: 40em; }
  .project { column-gap: 2.5rem; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 760px) {
  /* the figure sits beside the name so a project fits above the horizon */
  .project { display: block; position: relative; }
  .project__visual {
    position: absolute; top: 0; right: 0;
    width: min(8.25rem, 36%);
    margin-top: -.25rem;
  }
  .project h3 { padding-right: min(8.75rem, 38%); }
  .log__row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    padding: .5rem 0;
    line-height: 1.45;
  }
  .log__when, .log__what h3, .log__where, .log__what p:last-child { grid-column: 1; grid-row: auto; }
  .log__what p:last-child { margin-top: .1rem; }
  .log { margin-top: .75rem; }
  /* labels run into their lists so the toolkit stays above the horizon */
  .kit > div { display: block; padding: .35rem 0; }
  .kit dt { display: inline; margin-right: .45em; }
  .kit dd { display: inline; }
  .kit { margin-top: .75rem; }
  .landing__foot { margin-top: 2rem; }
}

/* =================================================================
   Static document: no scripts, or reduced motion. Each section keeps
   a fixed slice of the sky, night at the top and morning at the end.
   ================================================================= */

html:not(.fly) .world,
html:not(.fly) .track { display: none; }

html:not(.fly) .bar { position: absolute; }

html:not(.fly) main > section {
  position: relative;
  padding: 16vh var(--gutter);
}
html:not(.fly) .frame { margin-inline: auto; width: min(var(--fw), 100%); }

html:not(.fly) .takeoff {
  min-height: 100svh;
  display: grid; align-content: center;
  padding-top: 88px;
  padding-bottom: 38svh;
  background: linear-gradient(#0A1424 0%, #0B172A 34%, #16253F 62%, #0C1628 62%, #08101D 100%);
}
html:not(.fly) .takeoff::after {
  content: ""; position: absolute; left: 0; right: 0; top: 62%;
  height: 1px; background: rgb(242 245 249 / .26);
}
.still-ground { display: none; }
html:not(.fly) .still-ground {
  display: block; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 38%;
}

html:not(.fly) .climb {
  display: grid; gap: 20vh;
  background: linear-gradient(#08101D, #0C1830);
}
html:not(.fly) .waypoints {
  display: grid; gap: 22vh;
  background: linear-gradient(#0C1830, #1C2C4C);
}
html:not(.fly) .log-sec { background: linear-gradient(#1C2C4C, #2E345B); }
html:not(.fly) .tools-sec { background: linear-gradient(#2E345B, #4B4370); }
html:not(.fly) .land-sec {
  min-height: 100svh;
  display: grid; align-content: end;
  padding-top: 52svh; padding-bottom: 14vh;
  background: linear-gradient(#4B4370 0%, #8B7488 14%, #EFC9A0 24%, #E3DCD6 34%, #DCE4EC 46%, #DCE4EC 100%);
}


/* =================================================================
   Flight mode
   ================================================================= */

html.fly { scrollbar-width: none; }
html.fly::-webkit-scrollbar { display: none; }
html.fly body { overflow-x: hidden; }

.world { display: none; }
html.fly .world {
  display: block;
  position: fixed; z-index: 0;
  inset: calc(-1 * var(--pad, 0px));
  pointer-events: none;
  will-change: transform;
}
.sky, .sky i { position: absolute; inset: 0; }
.sky i { opacity: 0; visibility: hidden; }
.sky i:first-child { opacity: 1; visibility: visible; }
.ground, .stars { position: absolute; left: 0; display: block; }
.stars { top: 0; }
.horizon { position: absolute; left: 0; right: 0; height: 1px; }

html.fly main {
  position: fixed; z-index: 1; inset: 0;
  overflow: hidden;
}
html.fly main > section { position: static; }
html.fly .frame {
  position: absolute; left: 0; right: 0; top: 0;
  margin-inline: auto;
  width: min(var(--fw), 100% - 2 * var(--gutter));
  pointer-events: none;
}
html.fly .frame.is-live { pointer-events: auto; }
html.fly .layer { opacity: 0; }
html.fly .track { display: block; height: calc((var(--dur, 12) + 1) * 100svh); }
html.fly .bar__name { opacity: 0; }

/* scroll cue, on the ground below the hero; gone once the flight starts */
.cue { display: none; }
html.fly .cue {
  display: block;
  position: fixed; z-index: 1; left: 0; right: 0; bottom: 30px;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--star-2);
  opacity: 0;
  pointer-events: none;
}

/* the route: one dot per waypoint, spaced by where it falls in the flight */
.route {
  position: absolute; top: 16px; left: 50%;
  width: 15rem; height: calc(var(--fs-small) * 1.55 + 16px);
  translate: -50% 0;
  pointer-events: auto;
  visibility: hidden; opacity: 0;
}
.route__line, .route__done {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; margin-top: -.5px;
  background: currentColor;
  opacity: .22;
}
.route__done { opacity: .62; transform-origin: 0 50%; transform: scaleX(0); }
.route ol { position: absolute; inset: 0; }
.route li { position: absolute; top: 0; bottom: 0; width: 0; }
.route a {
  position: absolute; top: 50%; left: 0;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  padding: 0;
  text-decoration: none;
}
.route a::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .38;
  transition: opacity .3s, transform .3s;
}
.route a.is-past::before { opacity: 1; }
.route a[aria-current]::before { transform: scale(1.5); }
.route a:hover::before, .route a:focus-visible::before { opacity: 1; transform: scale(1.7); }
.route a:focus-visible { outline: none; }
.route__label {
  position: absolute; top: 100%; left: 50%;
  translate: -50% 4px;
  white-space: nowrap;
  font-size: .8125rem;
  line-height: 1;
  opacity: 0;
  transition: opacity .2s, translate .2s;
}
.route a:hover .route__label, .route a:focus-visible .route__label { opacity: 1; translate: -50% 0; }
.route a:focus-visible .route__label { text-decoration: underline; text-underline-offset: .3em; }
html.fly .bar__name:focus-visible { opacity: 1 !important; }

/* drawn figures start undrawn; the timeline draws them */
html.fly .draw { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
