/* ═══════════════════════════════════════════════════════════════════════
   williem.app
   Palette is a depth colormap: far reads blue, near reads warm. That ramp
   only appears on Fig. 1 and the section rules, so it stays meaningful.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --void:  #070910;
  --slab:  #0C1017;
  --raise: #11161F;
  --edge:  #1C2331;
  --edge2: #2A3446;

  --ink:   #EAEEF6;
  --mute:  #8891A6;
  --dim:   #5C6577;

  --far:   #3A6DF0;
  --mid:   #3FBFAE;
  --near:  #FF8A3D;
  --far-lt:#9BB0FF;

  --serif: "Newsreader", Georgia, serif;
  --grot:  "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gut:   clamp(1.25rem, 5vw, 4rem);
  --max:   1200px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--far-lt); text-decoration: none; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--far);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; display: block; }

.sr, .skip {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: 1rem; left: 1rem;
  width: auto; height: auto; clip: auto;
  padding: .6rem 1rem; background: var(--far); color: #fff;
  font-family: var(--mono); font-size: .8rem; z-index: 100;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

/* ── shared type ──────────────────────────────────────────────────── */

.label {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}
.label--sub { color: var(--dim); margin: 2.75rem 0 .9rem; }
.label--sub:first-child { margin-top: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 clamp(1.5rem, 4vw, 2.75rem);
}

.head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.head .rule {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--far), var(--mid) 55%, var(--near));
  opacity: .5;
  max-width: 180px;
}
.head__link {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-left: auto;
  color: var(--mute);
}
.head__link:hover { color: var(--far-lt); }

/* ── top bar ─────────────────────────────────────────────────────── */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem var(--gut);
  background: rgba(7, 9, 16, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--edge);
  transform: translateY(-102%);
  transition: transform .4s cubic-bezier(.2, .8, .3, 1);
}
.bar.is-on { transform: none; }

.bar__mark {
  font-family: var(--grot);
  font-variation-settings: "wdth" 118;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .01em;
  color: var(--ink);
}

.bar__nav { display: flex; gap: 1.4rem; }
.bar__nav a {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
}
.bar__nav a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .bar__nav a:nth-child(2), .bar__nav a:nth-child(4) { display: none; }
}

/* ── hero ─────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(5rem, 14vh, 9rem) 0 clamp(4rem, 9vh, 7rem);
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--edge);
}

.wordmark {
  font-family: var(--grot);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(3.6rem, 15.5vw, 12.5rem);
  line-height: .8;
  letter-spacing: -.035em;
  text-transform: uppercase;
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  color: var(--ink);
}

.hero__split {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.thesis {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.45rem, 3.3vw, 2.3rem);
  line-height: 1.18;
  letter-spacing: -.012em;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.lede {
  color: var(--mute);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 46ch;
  margin: 0 0 1.9rem;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
}
.chips li {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--mute);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: .38em .85em;
  background: var(--slab);
}

/* ── Fig. 1, the signature ────────────────────────────────────────── */

.epi { margin: 0; }

.epi__frame {
  position: relative;
  border: 1px solid var(--edge2);
  background: #05070C;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.epi__frame canvas { width: 100%; height: 100%; display: block; }

.epi__tick {
  position: absolute;
  width: 9px; height: 9px;
  border: 1px solid var(--edge2);
  pointer-events: none;
}
.epi__tick--tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; }
.epi__tick--br { right: 7px; bottom: 7px; border-left: 0; border-top: 0; }

.epi figcaption {
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.75;
  color: var(--dim);
  margin-top: .95rem;
  max-width: 52ch;
}
.epi__no { color: var(--mute); margin-right: .5em; }

.ramp {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .85rem;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ramp b { font-weight: 400; color: var(--dim); }
.ramp i {
  flex: 0 0 90px;
  height: 5px;
  background: linear-gradient(90deg, var(--far), var(--mid) 52%, var(--near));
}

@media (max-width: 900px) {
  .hero__split { grid-template-columns: 1fr; }
  .epi { margin-top: 1rem; }
}

/* ── sections ─────────────────────────────────────────────────────── */

.section { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.section--slab { background: var(--slab); border-block: 1px solid var(--edge); }
.section--end { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }

.intro {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--mute);
  max-width: 62ch;
  margin: 0 0 clamp(2.5rem, 5vw, 3.75rem);
}

/* ── now: three domains ───────────────────────────────────────────── */

.planes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
}
.plane {
  display: flex;
  flex-direction: column;
  background: var(--void);
  padding: clamp(1.5rem, 2.6vw, 2.1rem);
  transition: background .35s ease;
}
.plane .tags { margin-top: auto; }
.plane:hover { background: var(--raise); }

.plane h3 {
  font-family: var(--grot);
  font-variation-settings: "wdth" 112;
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: -.005em;
  margin: 0 0 .85rem;
  padding-top: .9rem;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--far), var(--mid)) 1;
  border-width: 2px 0 0;
}
.planes .plane:nth-child(2) h3 { border-image: linear-gradient(90deg, var(--mid), #96C06A) 1; }
.planes .plane:nth-child(3) h3 { border-image: linear-gradient(90deg, #96C06A, var(--near)) 1; }

.plane p {
  color: var(--mute);
  font-size: .97rem;
  line-height: 1.62;
  margin: 0 0 1.25rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
}
.tags li {
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .05em;
  color: var(--dim);
  border: 1px solid var(--edge);
  padding: .3em .65em;
}
.tags--wide li { font-size: .68rem; color: var(--mute); }

.interests { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* ── path ─────────────────────────────────────────────────────────── */

.path {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.portrait {
  width: 100%;
  height: auto;
  border: 1px solid var(--edge2);
  filter: grayscale(1) contrast(1.06) brightness(.92);
  transition: filter .5s ease;
}
.portrait:hover { filter: none; }

.track { list-style: none; margin: 0; padding: 0; }
.track li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--edge);
}
.track li:first-child { border-top: 0; padding-top: 0; }

.track__when {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--dim);
  padding-top: .35rem;
  white-space: nowrap;
}
.track .is-now .track__when { color: var(--near); }

.track__what h3 {
  font-family: var(--grot);
  font-variation-settings: "wdth" 108;
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0 0 .5rem;
  letter-spacing: -.003em;
}
.track__what p {
  margin: 0;
  color: var(--mute);
  font-size: .97rem;
  line-height: 1.62;
  max-width: 62ch;
}

@media (max-width: 860px) {
  .path { grid-template-columns: 1fr; }
  .portrait { width: 150px; }
  .track li { grid-template-columns: 1fr; gap: .45rem; }
}

/* ── publications ─────────────────────────────────────────────────── */

.group {
  font-family: var(--grot);
  font-variation-settings: "wdth" 115;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin: clamp(3rem, 6vw, 4.5rem) 0 .5rem;
  color: var(--ink);
}
.group:first-of-type { margin-top: 0; }

.pubs { list-style: none; margin: 0; padding: 0; }

.pub {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 1.75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--edge);
}

.pub__year {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dim);
  padding-top: .3rem;
}
.pub--star .pub__year { color: var(--far-lt); }

.pub__body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.14rem;
  line-height: 1.35;
  margin: 0 0 .4rem;
  max-width: 64ch;
}
.pub__body h3 a { color: var(--ink); }
.pub__body h3 a:hover { color: var(--far-lt); }

.pub__authors {
  margin: 0 0 .6rem;
  font-size: .93rem;
  color: var(--mute);
}
.pub__authors b { font-weight: 500; color: var(--ink); }

.pub__venue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin: 0;
}

.venue {
  font-family: var(--mono);
  font-size: .655rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  padding: .35em .75em;
  border: 1px solid var(--edge2);
  color: var(--mute);
}
.venue--top {
  border-color: rgba(74, 108, 247, .55);
  color: var(--far-lt);
  background: rgba(74, 108, 247, .1);
}

.pub__meta {
  font-family: var(--mono);
  font-size: .655rem;
  letter-spacing: .05em;
  color: var(--dim);
}

/* Paper figures are white-background scans. Left alone they read as bright
   blocks that outshout the titles, so they sit back until you go looking. */
.pub__fig {
  height: 68px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  margin-top: .95rem;
  border: 1px solid var(--edge);
  opacity: .34;
  filter: grayscale(.55) contrast(.95);
  transition: opacity .4s ease, filter .4s ease;
}
.pub:hover .pub__fig,
.pub:focus-within .pub__fig { opacity: 1; filter: none; }

@media (max-width: 640px) {
  .pub { grid-template-columns: 1fr; gap: .5rem; }
  .pub__year { padding-top: 0; }
}

/* ── recognition ──────────────────────────────────────────────────── */

.recog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.awards { list-style: none; margin: 0; padding: 0; }
.awards li {
  padding: .8rem 0;
  border-top: 1px solid var(--edge);
  font-size: .97rem;
}
.awards li:first-child { border-top: 0; padding-top: 0; }
.awards li a { color: var(--ink); }
.awards li a:hover { color: var(--far-lt); }
.awards li span {
  display: block;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .05em;
  color: var(--dim);
  margin-top: .2rem;
}

.review {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .72rem;
}
.review th, .review td {
  text-align: left;
  padding: .55rem .5rem .55rem 0;
  border-top: 1px solid var(--edge);
  font-weight: 400;
  vertical-align: baseline;
}
.review tr:first-child th, .review tr:first-child td { border-top: 0; }
.review th { color: var(--ink); letter-spacing: .08em; width: 5.5rem; }
.review__n { color: var(--far-lt); width: 2rem; }
.review td:last-child { color: var(--dim); letter-spacing: .02em; }

.recog__note {
  margin: 0;
  color: var(--mute);
  font-size: .97rem;
  line-height: 1.6;
}

/* Ordinals here are real: the workshop is a series and the edition number is
   the information. They are not decorative section numbering. */
.editions { list-style: none; margin: 1rem 0 0; padding: 0; }
.editions li {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  padding: .5rem 0;
  border-top: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: .72rem;
}
.editions__n { color: var(--far-lt); width: 1.8rem; flex: none; }
.editions a { color: var(--ink); letter-spacing: .04em; }
.editions a:hover { color: var(--far-lt); }
.editions__at { color: var(--dim); margin-left: auto; letter-spacing: .04em; }

/* ── contact ──────────────────────────────────────────────────────── */

.close {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.3rem, 2.9vw, 1.95rem);
  line-height: 1.32;
  letter-spacing: -.01em;
  max-width: 30ch;
  margin: 0 0 2.5rem;
}

.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--edge);
}
.links li { border-bottom: 1px solid var(--edge); }
.links a {
  display: block;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 1.1rem 2.5rem 1.1rem 0;
  transition: color .3s ease;
}
.links a:hover { color: var(--near); }

@media (min-width: 700px) {
  .links { display: flex; }
  .links li { flex: 1; border-bottom: 1px solid var(--edge); }
}

/* ── footer ───────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--edge);
  padding: 2.25rem 0 3rem;
  background: var(--slab);
}
.foot p {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--dim);
  margin: 0;
}
.foot__note { margin-top: .45rem; color: #454D5E; }

/* ── reveal ───────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .3, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
