/* ==========================================================================
   syedmohammadkaif.com
   Cyanotype blue, white lines, one warm colour for attention.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* local fonts resized to Geist's proportions, so nothing jumps when the real font lands */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 104.76%;
  ascent-override: 95.94%;
  descent-override: 28.16%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("DejaVu Sans Mono");
  size-adjust: 100%;
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}

:root {
  /* palette: a cyanotype print, plus one warm colour that means "look here" */
  --blue-950: #081743;
  --blue-900: #0b1f55;
  --blue-800: #0e2563;
  --blue-700: #122c71;
  --blue-600: #183a8c;
  --white: #f3f5fa;
  --body: #dde4f3;
  --dim: #b4c1e2;
  --faint: #98a8d6;
  --line: rgba(243, 245, 250, .14);
  --line-strong: rgba(243, 245, 250, .34);
  --hot: #ff7a3d;
  --paper: #f3f6fc;      /* unexposed paper */
  --prussian: #0e2563;   /* ink on paper */
  --prussian-dim: #3e5592;

  /* type */
  --sans: "Geist", "Geist Fallback", Arial, system-ui, sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* layout */
  --wrap-max: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --col-gap: clamp(16px, 2vw, 28px);
  --bar-h: 48px;
  --ruler-h: 16px;
  --header-h: calc(var(--bar-h) + var(--ruler-h) + 1px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 900px) {
  :root { --bar-h: 56px; --ruler-h: 26px; }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--blue-800);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--blue-800);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
@media (min-width: 900px) { body { font-size: 1.125rem; } }

/* paper texture of the print, fixed over everything, never interactive */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: url("../img/grain.png") repeat;
  background-size: 128px 128px;
  opacity: .5;
}

img, canvas, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
p, dd, li { text-wrap: pretty; }
cite { font-style: italic; }
strong { font-weight: 600; }

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

:focus-visible { outline: 2px solid var(--hot); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--hot); color: var(--blue-950); }

.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--white);
  color: var(--blue-900);
  font-size: .9375rem;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.touch-only { display: none; }
.mouse-only { display: inline; }
@media (hover: none) {
  .touch-only { display: inline; }
  .mouse-only { display: none; }
}

/* --------------------------------------------------------------------------
   Masthead: name, timecode, and the timeline ruler that doubles as nav
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blue-900);
  border-bottom: 1px solid var(--line);
}

.masthead__bar {
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.masthead__name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.masthead__end { display: flex; align-items: center; gap: 18px; }

.masthead__cta { font-size: .875rem; font-weight: 500; color: var(--white); text-decoration: none; }
@media (min-width: 900px) { .masthead__cta { display: none; } }

.tc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1;
  color: var(--dim);
}
.tc__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 10px rgba(255, 122, 61, .7);
}
@media (prefers-reduced-motion: no-preference) {
  .tc__dot { animation: rec 2s steps(1, end) infinite; }
}
@keyframes rec { 50% { opacity: .2; box-shadow: none; } }

/* small phones: tighten up so name, timecode and Contact still share one line */
@media (max-width: 399px) {
  .masthead__bar { gap: 10px; }
  .masthead__name { font-size: .9375rem; }
  .masthead__end { gap: 12px; }
  .tc { gap: 6px; font-size: .75rem; }
  .masthead__cta { font-size: .8125rem; }
}
@media (max-width: 359px) { .tc { display: none; } }

.ruler { height: var(--ruler-h); }
.ruler__track {
  position: relative;
  height: 100%;
  border-right: 1px solid var(--line-strong);
}
.ruler__track::before,
.ruler__track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.ruler__track::before {
  display: none;
  height: 4px;
  background-image: linear-gradient(to right, var(--line-strong) 1px, transparent 1px);
  background-size: calc(100% / 45) 100%;
}
@media (min-width: 600px) { .ruler__track::before { display: block; } }
.ruler__track::after {
  height: 8px;
  background-image: linear-gradient(to right, var(--faint) 1px, transparent 1px);
  background-size: calc(100% / 9) 100%;
}

.ruler__marks { display: none; gap: 20px; font-size: .75rem; line-height: 1; }
.ruler__marks a { color: var(--faint); text-decoration: none; }
.ruler__marks a:hover,
.ruler__marks a[aria-current="true"] { color: var(--white); }

@media (min-width: 900px) {
  .ruler__marks { display: flex; padding-top: 3px; }
  .is-timeline .ruler__marks { display: block; position: absolute; inset: 0; padding: 0; }
  .is-timeline .ruler__marks li { position: absolute; top: 0; bottom: 0; left: var(--pos, 0%); width: 0; }
  .is-timeline .ruler__marks a {
    display: inline-block;
    vertical-align: top;
    height: 100%;
    padding: 3px 10px 0 9px;
    position: relative;
    white-space: nowrap;
  }
  .is-timeline .ruler__marks a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 9px;
    background: var(--faint);
    clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
    transition: background-color .2s ease;
  }
  .is-timeline .ruler__marks a:hover::before,
  .is-timeline .ruler__marks a[aria-current="true"]::before { background: var(--white); }
  .is-timeline .ruler__marks .is-flipped a { position: absolute; top: 0; right: 0; padding: 3px 9px 0 10px; }
  .is-timeline .ruler__marks .is-flipped a::before { left: auto; right: 0; }
  .is-timeline .ruler__marks .is-crowded a { color: transparent; }
  .is-timeline .ruler__marks .is-crowded a:hover,
  .is-timeline .ruler__marks .is-crowded a:focus-visible { color: var(--white); }
}

.ruler__head {
  display: none;
  position: absolute;
  top: -2px;
  bottom: -1px;
  left: -.5px;
  width: 1px;
  background: var(--hot);
  will-change: transform;
}
.ruler__head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4.5px;
  width: 10px;
  height: 7px;
  background: var(--hot);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.is-timeline .ruler__head { display: block; }

/* --------------------------------------------------------------------------
   Shared section furniture
   -------------------------------------------------------------------------- */

.section {
  padding-block: clamp(56px, 6.5vw, 96px);
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: clamp(28px, 3.6vw, 52px); }
.section-head--center { text-align: center; }

.display {
  font-weight: 800;
  font-size: clamp(3.25rem, 9.6vw, 9.5rem);
  line-height: .88;
  letter-spacing: -.05em;
  color: var(--white);
  text-wrap: balance;
}

.lede {
  margin-top: .7em;
  max-width: 26em;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--dim);
}
.section-head--center .lede { margin-inline: auto; }

.prose { max-width: 34em; }
.prose p + p { margin-top: 1em; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--white);
  border-radius: 2px;
  color: var(--white);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.btn:hover { background: var(--white); color: var(--blue-900); }
.btn--solid { background: var(--white); color: var(--blue-900); }
.btn--solid:hover { background: transparent; color: var(--white); }

.fine { margin-top: 14px; font-size: .875rem; color: var(--faint); }

/* --------------------------------------------------------------------------
   Hero: the name, larger than life, over a live Lorenz attractor
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 95% at 62% 36%, #193c92 0%, var(--blue-700) 46%, var(--blue-950) 100%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero__inner {
  position: relative;
  width: 100%;
  padding-block: 32px clamp(40px, 7vh, 64px);
}

.hero__kicker {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 500;
  color: var(--dim);
}
.hero__kicker strong { color: var(--white); }

.hero__name {
  margin-top: 14px;
  font-weight: 900;
  /* three lines; on phones "Mohammad" (5.48em wide) fills the column */
  font-size: calc((100vw - 2 * var(--gutter)) / 5.6);
  line-height: .84;
  letter-spacing: -.05em;
  color: var(--white);
}
.hero__name span { display: block; white-space: nowrap; }

.hero__row { margin-top: 28px; display: grid; row-gap: 14px; }
.hero__sub { max-width: 34em; color: var(--dim); font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.5; }

.lorenz {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}
.lorenz__gap {
  flex-basis: 100%;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--white);
}
.lorenz { text-shadow: 0 1px 10px rgba(8, 23, 67, .85); }
.lorenz__cap { font-size: .875rem; line-height: 1.5; color: var(--dim); max-width: 30em; }
.lorenz__nudge {
  appearance: none;
  border: 0;
  padding: 6px 0;
  background: none;
  font: 600 .875rem/1 var(--sans);
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--hot);
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
  cursor: pointer;
  transition: color .2s ease;
}
.lorenz__nudge:hover { color: var(--hot); }

/* phones: the caption sits up top with the butterfly, the name holds the bottom */
.hero__inner { align-self: stretch; display: flex; flex-direction: column; }
.hero__copy { margin-top: auto; padding-top: 32px; }

@media (min-width: 900px) {
  /* on wide screens "Mohammad" takes about four fifths of the row; the butterfly takes the rest */
  .hero__name { font-size: calc((min(100vw, var(--wrap-max)) - 2 * var(--gutter)) / 7); }
  .hero__row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--col-gap);
    align-items: end;
    margin-top: 34px;
  }
  .hero__sub { grid-column: 1 / -1; max-width: 36em; }
  .hero__copy { padding-top: 0; }
  .lorenz {
    position: absolute;
    top: 28px;
    right: max(var(--gutter), env(safe-area-inset-right));
    max-width: 20em;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
  }
  .lorenz__gap { flex-basis: auto; }
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about { padding-block: clamp(56px, 6.5vw, 96px) clamp(12px, 1.6vw, 24px); border-top: 1px solid var(--line); }
.about__grid {
  --about-gap: clamp(16px, 2vw, 28px);
  --photo-w: min(100vw - 2 * var(--gutter), 460px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--about-gap);
}
.about__joke {
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  color: var(--white);
  text-wrap: balance;
}
/* a transparent cut-out: no frame, no box, the section's blue is its background */
/* the photo fades out from the waist down; the text sits on top of that fade */
.portrait { width: var(--photo-w); margin-inline: auto; }
.portrait img { width: 100%; height: auto; }
.about__body {
  position: relative;
  z-index: 1;
  /* pull the paragraph up over the faded bottom of the photo */
  margin-top: calc(var(--photo-w) * -0.36 - var(--about-gap));
}
.about__body p {
  font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(8, 23, 67, .7), 0 0 26px rgba(8, 23, 67, .9);
}
@media (min-width: 900px) {
  .about__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: var(--col-gap); align-items: start; }
  .about__joke { grid-column: 1 / span 7; grid-row: 1; }
  .about__body { grid-column: 1 / span 7; grid-row: 2; margin-top: 0; }
  /* the photo stands on the right, head level with the heading, torso fading out at the bottom.
     The negative margins trim the empty transparent strips above the head and below the fade
     (they are 10.5% and 18% of the photo's width). */
  .portrait { grid-column: 9 / span 4; grid-row: 1 / span 2; width: auto; margin: -10.5% 0 -15%; }
}

/* the brain beside the photo, traced from a real MRI template. The script draws it in the first time
   it comes into view, then sends signals along its folds. Hidden until the script has something to draw. */
.portrait { position: relative; }
.brain {
  position: absolute;
  left: 0;
  top: 3.08%;
  width: 37%;
  pointer-events: none;
  visibility: hidden;
}
.brain__canvas { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 859; }
.brain__cap {
  margin-top: 2px;
  padding-left: 3%;
  font-family: var(--mono);
  font-size: .625rem;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--faint);
  text-wrap: balance;
}
.brain__lead {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  visibility: hidden;
}
.brain__lead path { fill: none; stroke: rgba(243, 245, 250, .38); stroke-width: 1; vector-effect: non-scaling-stroke; }
.brain__lead circle { fill: none; stroke: var(--hot); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.brain__wide { display: none; }
@media (min-width: 900px) {
  .brain { left: -42%; top: -4.19%; width: 72%; }
  .brain__wide { display: inline; }
  .brain__narrow { display: none; }
  .brain__cap { font-size: .6875rem; }
}
.is-brain .brain,
.is-brain .brain__lead { visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes brain-lead { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes brain-ring { from { opacity: 0; transform: scale(.2); } }
  @keyframes brain-cap { from { opacity: 0; transform: translateY(4px); } }
  .is-brain .brain__lead path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .is-brain .brain__lead circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
  .is-brain .brain__cap { opacity: 0; }
  .is-brain.is-on .brain__lead path { stroke-dashoffset: 0; animation: brain-lead .7s 1.2s var(--ease-out) both; }
  .is-brain.is-on .brain__lead circle { opacity: 1; animation: brain-ring .6s 1.8s var(--ease-out) both; }
  .is-brain.is-on .brain__cap { opacity: 1; animation: brain-cap .8s 1.1s var(--ease-out) both; }
}

/* --------------------------------------------------------------------------
   The butterfly effect, as an introduction to the companies
   -------------------------------------------------------------------------- */

.effect { padding-block: clamp(40px, 4.5vw, 64px) clamp(48px, 5.5vw, 80px); border-top: 1px solid var(--line); }
.effect__setup {
  max-width: 30em;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  color: var(--dim);
}
.effect__line {
  margin-top: clamp(20px, 2.4vw, 32px);
  max-width: 13em;
  font-weight: 800;
  font-size: clamp(2.5rem, 6.2vw, 6rem);
  line-height: .96;
  letter-spacing: -.045em;
  color: var(--white);
  text-wrap: balance;
}
.effect__cite { margin-top: clamp(24px, 3vw, 36px); font-family: var(--mono); font-size: .8125rem; color: var(--faint); }

/* --------------------------------------------------------------------------
   Companies
   -------------------------------------------------------------------------- */

.companies { background: var(--blue-900); }

.ventures { border-bottom: 1px solid var(--line); }
.venture {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-block: clamp(32px, 4vw, 52px);
  border-top: 1px solid var(--line);
}
.venture__no { font-family: var(--mono); font-size: .875rem; color: var(--faint); }
.venture__name {
  font-weight: 800;
  font-size: clamp(2.5rem, 5.6vw, 5rem);
  line-height: .95;
  letter-spacing: -.045em;
  color: var(--white);
}
.venture__what { margin-top: 14px; max-width: 30em; color: var(--dim); }
/* outlined, like a title card waiting for its footage. The fill matches the background and
   is painted over the stroke, so letters that overlap show one clean contour, not crossed lines */
.venture--soon .venture__name {
  color: var(--blue-900);
  -webkit-text-stroke: 3px var(--faint);
  paint-order: stroke fill;
  letter-spacing: -.012em;
}
.figures { display: flex; flex-wrap: wrap; gap: 18px 36px; }
.figures dt {
  font-weight: 800;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--white);
}
.figures dd { margin-top: 6px; font-family: var(--mono); font-size: .75rem; color: var(--faint); }
.venture__link { margin-top: 22px; font-size: .9375rem; color: var(--white); }

/* "media offline", the way an edit marks footage that hasn't been shot yet */
.venture__status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 122, 61, .55);
  border-radius: 3px;
  background: repeating-linear-gradient(135deg, rgba(255, 122, 61, .16) 0 6px, rgba(255, 122, 61, .04) 6px 12px);
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1;
  color: var(--hot);
}

@media (min-width: 900px) {
  .ventures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .venture { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  .venture--live { grid-column: 1 / -1; }
  .venture__no { grid-column: 1 / span 1; padding-top: .9em; }
  .venture__main { grid-column: 2 / span 6; }
  .venture__side { grid-column: 9 / span 4; padding-top: .6em; }
  .venture--soon { grid-template-columns: minmax(0, 1fr); row-gap: 18px; align-content: start; padding-right: clamp(0px, 3vw, 48px); }
  .venture--soon .venture__no,
  .venture--soon .venture__main { grid-column: auto; padding-top: 0; }
}

/* --------------------------------------------------------------------------
   Markets
   -------------------------------------------------------------------------- */

.markets__grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
.rules {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--col-gap);
  border-bottom: 1px solid var(--line);
}
.rules li { padding-block: 20px; border-top: 1px solid var(--line); }
.rules h3 {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--white);
}
.rules p { margin-top: 6px; font-size: 1rem; color: var(--dim); }

.chart { position: relative; }
.chart__canvas {
  width: 100%;
  aspect-ratio: 5 / 4;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(8, 23, 67, .35);
}
.chart__cap { margin-top: 14px; font-size: .875rem; line-height: 1.5; color: var(--faint); max-width: 34em; }
.markets__fine { margin-top: 0; max-width: 46em; }

@media (min-width: 640px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .markets__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }
  .markets__copy { grid-column: 1 / span 6; }
  .chart { grid-column: 8 / span 5; position: sticky; top: calc(var(--header-h) + 40px); }
  .markets__fine { grid-column: 1 / span 6; }
}

/* --------------------------------------------------------------------------
   Mind: unexposed paper, and an eye-tracking study running on the reader
   -------------------------------------------------------------------------- */

.mind {
  position: relative;
  isolation: isolate;
  background: var(--paper);
  color: var(--prussian);
  padding-block: clamp(56px, 6.5vw, 96px);
}
.mind ::selection { background: var(--hot); color: var(--blue-950); }
.mind__heat, .mind__gaze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mind__heat { z-index: 0; }
.mind__gaze { z-index: 2; overflow: visible; }
.mind__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 48px; }

.mind__label { font-family: var(--mono); font-size: .8125rem; color: var(--prussian-dim); }
.mind__title {
  margin-top: 16px;
  font-weight: 800;
  font-size: clamp(2.75rem, 7vw, 6.75rem);
  line-height: .92;
  letter-spacing: -.05em;
  color: var(--prussian);
  text-wrap: balance;
}
.mind .prose { margin-top: 40px; color: #1d2f63; }
.mind__areas { margin-top: 28px; font-weight: 600; color: var(--prussian); }

.study {
  align-self: start;
  border-top: 2px solid var(--prussian);
  padding-top: 16px;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.6;
}
.study__title { font-weight: 600; color: var(--prussian); margin-bottom: 14px; }
.study dl div { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; border-bottom: 1px solid rgba(14, 37, 99, .14); }
.study dt { color: var(--prussian-dim); }
.study dd { color: var(--prussian); font-weight: 600; text-align: right; }
.study__note { margin-top: 16px; color: var(--prussian-dim); }

.gaze-fix circle.ring { fill: rgba(255, 122, 61, .12); stroke: var(--hot); stroke-width: 1.4; }
.gaze-fix circle.dot { fill: var(--hot); }
.gaze-fix text { fill: #fff; font: 600 10px var(--mono); text-anchor: middle; dominant-baseline: central; }
.gaze-path { fill: none; stroke: var(--hot); stroke-width: 1.1; stroke-opacity: .7; }
.mind__gaze.is-settled .gaze-replay { opacity: .28; transition: opacity 1.6s ease; }

@media (min-width: 1000px) {
  .mind__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .mind__copy { grid-column: 1 / span 8; }
  .study { grid-column: 10 / span 3; margin-top: 52px; }
}

/* --------------------------------------------------------------------------
   Story: the edit timeline stays docked while the cuts scroll past
   -------------------------------------------------------------------------- */

.story { padding-bottom: clamp(40px, 4.5vw, 72px); }
.story .section-head { margin-bottom: clamp(24px, 3vw, 40px); }

.nle-dock {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  padding-block: 12px;
  background: var(--blue-800);
  border-bottom: 1px solid var(--line);
}
.nle {
  position: relative;
  height: 89px;          /* ruler + two lanes; four on wider screens */
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--blue-950);
  overflow: hidden;
}
.nle__ruler {
  position: absolute;
  left: 34px;
  right: 0;
  top: 0;
  height: 18px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(to right, rgba(243, 245, 250, .22) 1px, transparent 1px),
    linear-gradient(to right, rgba(243, 245, 250, .5) 1px, transparent 1px);
  background-size: calc(100% / 45) 5px, calc(100% / 9) 10px;
  background-repeat: repeat-x;
  background-position: 0 100%, 0 100%;
}
.nle__tc {
  position: absolute;
  top: 3px;
  margin-left: 4px;
  font-family: var(--mono);
  font-size: .5625rem;
  line-height: 1;
  color: var(--faint);
  pointer-events: none;
}
.nle__tc--minor { display: none; }
.nle__lanes { position: absolute; left: 0; right: 0; top: 19px; bottom: 0; }
.lane { position: relative; height: 34px; border-bottom: 1px solid rgba(243, 245, 250, .06); }
.lane__id {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .625rem;
  color: var(--faint);
  border-right: 1px solid var(--line);
}
.lane__clips { position: absolute; left: 34px; right: 0; top: 0; bottom: 0; }
.clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  border-radius: 3px;
  background: rgba(243, 245, 250, .14);
  border: 1px solid rgba(243, 245, 250, .22);
  font-family: var(--mono);
  font-size: .625rem;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.clip__name { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip--title { background: rgba(124, 196, 255, .16); border-color: rgba(124, 196, 255, .35); }
.clip--audio { background: rgba(243, 245, 250, .07); border-color: rgba(243, 245, 250, .14); color: var(--dim); align-items: flex-start; padding-top: 3px; }
.clip--audio svg { position: absolute; left: 0; right: 0; bottom: 1px; width: 100%; height: 44%; }
.clip--audio path { fill: none; stroke: rgba(243, 245, 250, .32); stroke-width: 1.5; }
.clip--audio .clip__name { line-height: 1.1; }
.clip--offline {
  background: repeating-linear-gradient(135deg, rgba(255, 122, 61, .22) 0 6px, rgba(255, 122, 61, .06) 6px 12px);
  border-color: rgba(255, 122, 61, .55);
  color: var(--hot);
}
.clip.is-live { background: var(--hot); border-color: var(--hot); color: var(--blue-950); font-weight: 600; }
.nle__head {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 2px;
  margin-left: -1px;
  background: var(--hot);
  box-shadow: 0 0 12px rgba(255, 122, 61, .6);
  will-change: transform;
}
.nle__head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 9px;
  background: var(--hot);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.lane--v2, .lane--a2 { display: none; }
@media (max-width: 899px) {
  .lane--v1 .clip__name { display: none; }   /* too narrow to read; the colours carry it */
}
@media (min-width: 900px) {
  .nle { height: 157px; }
  .lane--v2, .lane--a2 { display: block; }
  .nle__tc--minor { display: block; }
}

.cuts { margin-top: clamp(24px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.cut {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-block: 30px;
  border-top: 1px solid var(--line);
  transition: opacity .3s ease;
}
.cut__when { font-family: var(--mono); font-size: .8125rem; color: var(--faint); padding-top: .2em; }
.cut__body h3 {
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  color: var(--white);
}
.cut__body p { max-width: 36em; margin-top: 10px; }
.cut.is-live .cut__when { color: var(--hot); }
@media (min-width: 900px) {
  .cut { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); padding-block: 40px; }
  .cut__when { grid-column: 1 / span 3; padding-top: .55em; }
  .cut__body { grid-column: 4 / span 7; }
}

/* --------------------------------------------------------------------------
   Book
   -------------------------------------------------------------------------- */

.book { background: var(--blue-900); }
.book__grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: clamp(48px, 7vw, 80px); }
.book__object { display: none; }
.book__object.is-loaded { display: block; }
.book__cover {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin-inline: auto;
  border-radius: 2px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7);
}
/* "Existentialist" is about 6em wide: keep it inside narrow phones */
.book__title { max-width: 11em; font-size: min(clamp(3.25rem, 9.6vw, 9.5rem), calc((100vw - 2 * var(--gutter)) / 6.1)); }
.book__subtitle {
  margin-top: 22px;
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  letter-spacing: -.015em;
  color: var(--dim);
}
.book__copy .prose { margin-top: 36px; }
@media (min-width: 900px) {
  .book__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: center; }
  .book__copy { grid-column: 1 / span 10; }
  .book__copy .prose { columns: 2; column-gap: var(--col-gap); max-width: none; }
  .book__copy .prose p { break-inside: avoid; margin: 0 0 1em; }
  .book__object.is-loaded { grid-column: 1 / span 5; }
  .book__object.is-loaded + .book__copy { grid-column: 7 / span 6; }
  .book__object.is-loaded + .book__copy .book__title { font-size: clamp(3rem, 6.2vw, 6rem); }
  .book__object.is-loaded + .book__copy .prose { columns: 1; }
}

/* --------------------------------------------------------------------------
   Press: clippings taped to the wall
   -------------------------------------------------------------------------- */

.clippings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 4vw, 48px) var(--col-gap);
  align-items: start;
  padding-top: 12px;
}
@media (min-width: 700px) { .clippings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .clippings { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.clipping { --tilt: -.7deg; }
.clipping:nth-child(3n + 2) { --tilt: .5deg; }
.clipping:nth-child(3n) { --tilt: -.3deg; }

.clipping__link {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--prussian);
  text-decoration: none;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 0 30px 50px -32px rgba(2, 8, 30, .9);
  transform: rotate(var(--tilt));
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.clipping__link:hover,
.clipping__link:focus-visible {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 42px 60px -32px rgba(2, 8, 30, .95);
}
/* a strip of tape */
.clipping__link::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -10px;
  left: 50%;
  width: 88px;
  height: 22px;
  margin-left: -44px;
  background: rgba(243, 245, 250, .3);
  box-shadow: 0 1px 2px rgba(2, 8, 30, .18);
  transform: rotate(calc(var(--tilt) * -4));
}

.clipping__shot { display: none; }
.clipping__shot.is-loaded {
  display: block;
  margin: 10px 10px 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(14, 37, 99, .16);
}
.clipping__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(1) contrast(1.06);
  mix-blend-mode: multiply;
  transition: filter .45s ease;
}
.clipping__link:hover .clipping__img,
.clipping__link:focus-visible .clipping__img { filter: none; }

.clipping__paper { display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 26px; }
.clipping__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--prussian);
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.clipping__meta span { flex: none; font-weight: 400; color: var(--prussian-dim); }
.clipping__headline {
  font-weight: 800;
  font-size: clamp(1.3125rem, 1.7vw, 1.5625rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.clipping__quote { font-size: .9375rem; line-height: 1.5; color: #1d2f63; }

/* the three profiles: one tile per site, in that site's colours, with the cut-out photo.
   Same footprint as a clipping. The script plays a short load-in the first time each one is seen. */
.sites {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px var(--col-gap);
  margin-bottom: clamp(44px, 5vw, 64px);
}
@media (min-width: 700px) { .sites { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.site__link {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 260px;
  padding: 18px 20px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--tile-bg);
  color: var(--tile-ink);
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--tile-line), 0 30px 50px -32px rgba(2, 8, 30, .9);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.site__link:hover,
.site__link:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--tile-line), 0 42px 60px -32px rgba(2, 8, 30, .95); }

.site__top { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
/* the site's name, until its official logo is dropped into the slot beside it */
.site__brand { font-size: clamp(1rem, 5.6cqi, 1.25rem); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--tile-ink); }
.site--wiki .site__brand { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: 0; font-size: clamp(1.0625rem, 6cqi, 1.375rem); }
.site__logo.is-loaded + .site__brand { display: none; }
.site__go {
  width: 13px;
  height: 13px;
  margin-left: auto;
  fill: none;
  stroke: var(--tile-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .45s var(--ease-out);
}
.site__link:hover .site__go,
.site__link:focus-visible .site__go { transform: translate(2px, -2px); }
.site__logo { display: none; }
.site__logo.is-loaded { display: inline-flex; align-items: center; }
.site__logo-img { display: block; width: auto; height: 24px; }

.site__name {
  position: relative;
  z-index: 1;
  max-width: min(9em, 60cqi);
  margin-top: auto;
  font-size: clamp(1.0625rem, 7.2cqi, 1.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.site__meta {
  position: relative;
  z-index: 1;
  max-width: min(15em, 58cqi);
  margin-top: 8px;
  font-size: .75rem;
  line-height: 1.4;
  color: var(--tile-dim);
}

/* the cut-out, standing at the right edge and fading into the tile */
.site__me {
  position: absolute;
  right: -7%;
  bottom: -14%;
  height: 112%;
  aspect-ratio: 640 / 853;
  transition: transform .7s var(--ease-out);
  pointer-events: none;
}
.site__me img { display: block; width: 100%; height: 100%; opacity: var(--tile-photo, .8); }
/* film grain over the whole tile, photo and type included */
.site__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: url("../img/grain.png") 0 0 / 150px 150px repeat;
  opacity: var(--tile-grain, .9);
  pointer-events: none;
}
.site__link:hover .site__me,
.site__link:focus-visible .site__me { transform: translateY(-6px) scale(1.03); }
@container (max-width: 300px) {
  .site__me { right: -24%; height: 84%; bottom: -8%; }
}

/* IMDb: near-black, white type, the yellow bar it puts beside every heading */
.site--imdb { --tile-bg: radial-gradient(120% 90% at 85% 15%, #262626, #121212 62%); --tile-ink: #fff; --tile-dim: #a3a3a3; --tile-line: rgba(255, 255, 255, .08); --tile-accent: #f5c518; }
.site--imdb .site__name { padding-left: 12px; }
.site--imdb .site__name::before {
  content: "";
  position: absolute;
  top: .06em;
  bottom: .06em;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: #f5c518;
}
.site--imdb .site__meta { padding-left: 12px; }

/* WikiFlux: white page, serif title over a hairline, link blue */
.site--wiki { --tile-bg: #fff; --tile-ink: #202122; --tile-dim: #54595d; --tile-line: rgba(255, 255, 255, .5); --tile-accent: #3366cc; }
.site--wiki .site__name { width: 60cqi; max-width: none; padding-bottom: 6px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.01em; }
.site--wiki .site__name::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #a2a9b1;
}
.site__a { color: #3366cc; }

/* Fandom: the plum to hot pink of its community banners */
.site--fandom { --tile-bg: linear-gradient(135deg, #2b0a26 0%, #7a0b46 55%, #fa005a 120%); --tile-ink: #fff; --tile-dim: rgba(255, 255, 255, .72); --tile-line: rgba(255, 255, 255, .1); --tile-accent: #fff; }

/* the load-in, played once per tile. Without the script or with reduced motion they just sit there. */
@keyframes tile-fade { from { opacity: 0; transform: translateY(6px); } }
@keyframes tile-reveal { from { clip-path: inset(0 100% 0 0); } }
@keyframes tile-rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes tile-bar { from { transform: scaleY(0); } }
@keyframes tile-rule { from { transform: scaleX(0); } }
.is-armed .site__top,
.is-armed .site__name,
.is-armed .site__meta,
.is-armed .site__me,
.is-armed .site--imdb .site__name::before,
.is-armed .site--wiki .site__name::after {
  animation-duration: .7s;
  animation-timing-function: var(--ease-out);
  animation-delay: calc(var(--cd, 0s) + var(--d, 0s));
  animation-fill-mode: both;
  animation-play-state: paused;
}
.is-armed .site__top { --d: 0s; animation-name: tile-fade; }
.is-armed .site__me { --d: .1s; animation-name: tile-rise; animation-duration: 1.1s; }
.is-armed .site__name { --d: .3s; animation-name: tile-reveal; animation-duration: .8s; }
.is-armed .site__meta { --d: .55s; animation-name: tile-fade; }
.is-armed .site--imdb .site__name::before { --d: .25s; animation-name: tile-bar; transform-origin: bottom; }
.is-armed .site--wiki .site__name::after { --d: .5s; animation-name: tile-rule; animation-duration: 1s; transform-origin: left; }
.is-armed .is-on .site__top,
.is-armed .is-on .site__name,
.is-armed .is-on .site__meta,
.is-armed .is-on .site__me,
.is-armed .is-on.site--imdb .site__name::before,
.is-armed .is-on.site--wiki .site__name::after { animation-play-state: running; }
.site:nth-child(2) { --cd: .15s; }
.site:nth-child(3) { --cd: .3s; }

.press__more {
  margin-top: clamp(36px, 4vw, 56px);
  max-width: 50em;
  font-size: .9375rem;
  line-height: 1.75;
  color: var(--dim);
}
.press__more p + p { margin-top: .8em; }
.press__more a { color: var(--white); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  border-top: 1px solid var(--line);
  padding-block: clamp(64px, 8vw, 104px);
  background: radial-gradient(90% 80% at 80% 100%, #183a8c 0%, transparent 70%);
}
@media (min-width: 900px) {
  .contact {
    min-height: calc(100svh - var(--header-h) - 80px);
    padding-block: 48px;
    display: flex;
    align-items: center;
  }
}
.contact__title, .contact__move {
  font-weight: 900;
  font-size: clamp(3.5rem, 12.5vw, 12rem);
  line-height: .86;
  letter-spacing: -.055em;
  color: var(--white);
}
.contact__move { color: var(--hot); }
.contact__text { max-width: 32em; margin-top: clamp(32px, 4vw, 48px); }
.contact__primary { margin-top: 28px; }
.contact__email {
  font-weight: 700;
  font-size: clamp(1.625rem, 4.2vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.035em;
  color: var(--white);
  text-underline-offset: .14em;
  overflow-wrap: anywhere;
}
.contact__links { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 26px; }
.contact__links a { display: inline-block; padding-block: 10px; font-size: .9375rem; color: var(--white); }

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

.footer {
  border-top: 1px solid var(--line);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom));
  font-size: .8125rem;
  color: var(--faint);
  background: var(--blue-900);
}
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; }
.footer a { color: var(--dim); }

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

.lost { min-height: calc(100svh - 140px); display: flex; align-items: center; padding-block: 64px; }
.lost__code { font-family: var(--mono); font-size: .875rem; color: var(--faint); }
.lost .display { margin-top: 18px; max-width: 10em; }
.lost .prose { margin-top: 28px; }

/* --------------------------------------------------------------------------
   Preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body::after, .masthead, .hero__canvas, .lorenz, .nle-dock, .chart, .mind__heat, .mind__gaze, .skip { display: none !important; }
  body, .mind, .companies, .book, .footer { background: #fff !important; color: #000 !important; }
  .display, .hero__name, .about__joke, .contact__title, .contact__move, .venture__name, .cut__body h3, .mind__title { color: #000 !important; -webkit-text-stroke: 0 !important; }
  .clipping__link { transform: none !important; box-shadow: none !important; border: 1px solid #999; }
  .clipping__link::before { display: none; }
  .hero { min-height: 0; background: none; }
  .section, .contact, .about, .mind { padding-block: 32px; border: 0; }
}
