/* ==========================================================================
   What the Woo
   White page, one ink, black reading text.
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem); /* 12 to 13px, labels */
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 1rem);
  --text-base: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); /* 18 to 21px, reading text */
  --text-lg: clamp(1.25rem, 1.12rem + 0.6vw, 1.625rem); /* 20 to 26px, serif italic lines */
  --text-xl: clamp(1.5rem, 1.1rem + 1.7vw, 2.25rem); /* 24 to 36px, display sentences */
  --text-2xl: clamp(2rem, 1.2rem + 2.6vw, 3.5rem); /* 32 to 56px, page titles */
  --text-3xl: clamp(2.5rem, 1.1rem + 5vw, 5rem); /* 40 to 80px, one line on the index */

  /* 4px spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Color. Change --ink to re-ink the whole site. */
  --ink: oklch(0.58 0.22 30);
  --paper: oklch(1 0 0);
  --text: oklch(0.17 0 0);

  --color-bg: var(--paper);
  --color-text: var(--text);
  --color-primary: var(--ink);

  /* Type */
  --font-sans: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', sans-serif;
  --font-serif: 'Gambetta', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-display: var(--font-sans);
  --font-body: var(--font-serif);
  --tracking: 0.3em;

  /* Line work */
  --hairline: 1.25px;
  --dot: 2px;
  --dot-gap: 7px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-interactive: 180ms var(--ease-out);

  /* Layout */
  --radius-sm: 0.125rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-h: 4.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

html {
  background: var(--paper);
  /* Hanging punctuation pulls centred lines off centre in Safari.
     It is switched back on for the reading text only. */
  hanging-punctuation: none;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  font-kerning: normal;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

/* --------------------------------------------------------------------------
   Shared pieces
   -------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--paper);
  text-decoration: none;
  background: var(--ink);
  transform: translateY(-300%);
}
.skip-link:focus {
  transform: none;
}

/* Small tracked capitals. All chrome is set in these. */
.label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  color: var(--ink);
}

/* A dotted line that extends under a label link. */
.dotlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}
.dotlink::after {
  content: '';
  position: absolute;
  right: var(--tracking);
  bottom: calc(50% - 1.1em);
  left: 0;
  height: var(--dot);
  background: radial-gradient(circle at center, currentColor 0.95px, transparent 1.15px) 0 0 / 6px
    var(--dot) repeat-x;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 360ms var(--ease-out);
}
.dotlink:hover::after,
.dotlink:focus-visible::after,
.dotlink[aria-current='page']::after {
  clip-path: inset(0 0 0 0);
}

/* Two circles, each through the other's centre. Used as a rule and an end mark. */
.vesica {
  position: relative;
  display: block;
  width: 2.25rem;
  height: 1.5rem;
  margin-inline: auto;
  border: 0;
}
.vesica::before,
.vesica::after {
  content: '';
  position: absolute;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.vesica::before {
  left: 0;
}
.vesica::after {
  right: 0;
}

/* --------------------------------------------------------------------------
   Header and footer
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding-inline: var(--gutter);
}

.site-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.site-nav a:last-child {
  /* trailing tracking would otherwise pull the label off the right gutter */
  margin-right: calc(var(--tracking) * -1);
}

.wordmark {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  padding-left: var(--tracking);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
.wordmark a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}
.wordmark a:hover {
  color: var(--text);
}

.site-footer {
  padding: var(--space-16) var(--gutter) var(--space-10);
  text-align: center;
}
.site-footer p {
  max-width: none;
  padding-left: var(--tracking);
}

/* --------------------------------------------------------------------------
   Index: the diagram
   Two circles of radius --r, each passing through the other's centre.
   The series is named in the overlap. The essays follow beneath it.
   -------------------------------------------------------------------------- */

.hero {
  --r: max(14rem, min(30vw, 50vh - 4.5rem, 30rem));
  --r: max(14rem, min(30vw, 50svh - 4.5rem, 30rem));
  --word: calc(var(--r) * 0.3);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding-block: var(--space-8);
  overflow-x: hidden;
  overflow-x: clip;
}

.diagram {
  position: relative;
  flex: none;
  width: calc(var(--r) * 3);
  height: calc(var(--r) * 2);
}

.ring {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--r) * 2);
  max-width: none;
  height: calc(var(--r) * 2);
  overflow: visible;
  pointer-events: none;
}
.ring--r {
  left: var(--r);
  transform: scaleX(-1);
}
.ring circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--hairline);
  animation: ring-draw 1100ms var(--ease-in-out) 100ms both;
}

.point {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: point-in 400ms var(--ease-out) both;
}
.point--a {
  left: var(--r);
}
.point--b {
  left: calc(var(--r) * 2);
}

/* Dotted connecting line */
.bridge {
  display: block;
  height: var(--dot);
  color: inherit;
  background: radial-gradient(circle at center, currentColor 0.95px, transparent 1.15px) center /
    var(--dot-gap) var(--dot) repeat-x;
}

/* The two domains, labelled on the equator of each crescent */
.domain {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: var(--r);
  max-width: none;
  color: var(--ink);
  transform: translateY(-50%);
  pointer-events: none;
}
.domain--l {
  left: 0;
}
.domain--r {
  left: calc(var(--r) * 2);
}
.domain__name {
  grid-row: 1;
  grid-column: 2;
  /* Both labels take the width of the longer one (10.85em, "The Academic"),
     so the dotted lines on either side come out the same length. */
  min-inline-size: calc(10.85em + var(--space-5) * 2 - var(--tracking));
  padding-inline: var(--space-5) calc(var(--space-5) - var(--tracking));
  text-align: center;
  white-space: nowrap;
  animation: fade-in 700ms var(--ease-out) 600ms both;
}
.domain .bridge {
  grid-row: 1;
}
.domain--l .bridge {
  grid-column: 3;
  margin-right: var(--space-3);
  animation: extend-left 420ms var(--ease-out) 1150ms both;
}
.domain--r .bridge {
  grid-column: 1;
  margin-left: var(--space-3);
  animation: extend-right 420ms var(--ease-out) 1150ms both;
}

/* The overlap. One link, clipped to the almond. */
.lens {
  position: absolute;
  top: calc(var(--r) * 0.1339746);
  left: var(--r);
  z-index: 1;
  width: var(--r);
  height: calc(var(--r) * 1.7320508);
  color: var(--ink);
  text-decoration: none;
  clip-path: circle(var(--r) at 100% 50%);
  transition: color 320ms var(--ease-out);
}
.lens__clip {
  position: absolute;
  inset: 0;
  display: block;
  clip-path: circle(var(--r) at 0 50%);
}
.lens__fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
}
.lens__title {
  font: inherit;
}
.lens__stem {
  position: absolute;
  right: 0;
  bottom: calc(50% + var(--word) * 0.84);
  left: 0;
  padding-left: var(--tracking);
  color: inherit;
  text-align: center;
  animation: fade-in 700ms var(--ease-out) 300ms both;
}
/* The word sits on the equator so the line through both centres
   also passes through the centres of its two o's. */
.lens__mid {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  height: 0;
  font-family: var(--font-sans);
  font-size: var(--word);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}
.lens__word {
  margin-top: -0.6135em; /* Jost: line-box top to the centre of the o */
  padding-inline: 0.127em 0.12em; /* equal gaps to the dotted line on either side of "Woo" */
  animation: fade-in 700ms var(--ease-out) 380ms both;
}
.lens__mid .bridge {
  margin-top: calc(var(--dot) / -2);
}
.lens__mid .bridge:first-child {
  margin-left: var(--space-3);
  animation: extend-left 420ms var(--ease-out) 800ms both;
}
.lens__mid .bridge:last-child {
  margin-right: var(--space-3);
  animation: extend-right 420ms var(--ease-out) 800ms both;
}
.lens__sub {
  position: absolute;
  top: calc(50% + var(--word) * 0.56);
  right: 0;
  left: 0;
  width: min(13em, 100%); /* the line is about 11.5em long; the slack keeps it whole */
  margin-inline: auto;
  font-size: clamp(1rem, var(--r) * 0.052, 1.375rem);
  font-style: italic;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
  text-wrap: balance;
  transition: color 320ms var(--ease-out);
  animation: fade-in 700ms var(--ease-out) 460ms both;
}

.lens:focus-visible {
  outline: none;
}
.lens:focus-visible,
.lens:active {
  color: var(--paper);
}
.lens:focus-visible .lens__fill,
.lens:active .lens__fill {
  opacity: 1;
}
.lens:focus-visible .lens__sub,
.lens:active .lens__sub {
  color: var(--paper);
}
@media (hover: hover) {
  .lens:hover {
    color: var(--paper);
  }
  .lens:hover .lens__fill {
    opacity: 1;
  }
  .lens:hover .lens__sub {
    color: var(--paper);
  }
}

/* Whole dots only: each line is trimmed to a multiple of the dot spacing
   and counted out from the point it runs to */
@supports (width: round(down, 1px, 1px)) {
  .domain .bridge,
  .lens__mid .bridge {
    width: round(down, 100% - var(--space-3), var(--dot-gap));
    background-position: 0 0;
  }
  /* With room for fewer than three dots it no longer reads as a line, so it is left out */
  .domain .bridge {
    max-width: max(0px, (100% - var(--space-3) - var(--dot-gap) * 3) * 9999);
  }
  .domain--l .bridge,
  .lens__mid .bridge:last-child {
    justify-self: end;
  }
  .domain--r .bridge,
  .lens__mid .bridge:first-child {
    justify-self: start;
  }
}

/* Narrow or upright screens: the circles run off both edges and the overlap
   takes the page. Each label sits in whatever is left of its crescent, set
   upright when that sliver is too thin to hold it. */
@media (max-width: 799px), (max-aspect-ratio: 1/1) {
  .hero {
    --r: max(14rem, min(74vw, 50vh - 4.5rem, 26rem));
    --r: max(14rem, min(74vw, 50svh - 4.5rem, 26rem));
  }
  .domain {
    width: min(var(--r), 50vw - var(--r) * 0.5);
    container-type: inline-size;
  }
  .domain--l {
    left: max(0px, var(--r) * 1.5 - 50vw);
  }
  .domain .bridge {
    display: none;
  }
  .domain__name {
    padding: var(--tracking) 0 0;
    writing-mode: vertical-rl;
  }
  .domain--l .domain__name {
    transform: rotate(180deg);
  }

  @container (min-width: 14rem) {
    .domain .bridge {
      display: block;
    }
    .domain__name,
    .domain--l .domain__name {
      padding: 0;
      padding-inline: var(--space-5) calc(var(--space-5) - var(--tracking));
      writing-mode: horizontal-tb;
      transform: none;
    }
  }
}

/* Index: the essays, one entry each.
   A dotted line drops from the lower crossing of the circles to the first. */
.hero::after,
.essays::before {
  content: '';
  position: absolute;
  left: 50%;
  width: var(--dot);
  margin-left: calc(var(--dot) / -2);
  color: var(--ink);
  background-image: radial-gradient(circle at center, currentColor 0.95px, transparent 1.15px);
  background-repeat: repeat-y;
  background-size: var(--dot) var(--dot-gap);
  pointer-events: none;
}
.hero::after {
  top: calc(50% + var(--r) * 0.8660254 + var(--space-5));
  bottom: 0;
  background-position: center bottom;
  animation: extend-down 520ms var(--ease-out) 1300ms both;
}
.essays::before {
  --reach: var(--space-2);
  top: 0;
  height: calc(var(--essays-top) + var(--reach));
  background-position: center top;
}
/* Stop short of the focus outline when the first entry is reached by keyboard */
.essays:has(.entry:first-child:focus-visible)::before {
  --reach: calc(var(--space-2) * -1);
}
/* Whole dots only: each part is trimmed to a multiple of the dot spacing */
@supports (height: round(down, 1px, 1px)) {
  .hero::after {
    top: auto;
    height: round(down, 50% - var(--r) * 0.8660254 - var(--space-5), var(--dot-gap));
  }
  .essays::before {
    height: round(down, var(--essays-top) + var(--reach), var(--dot-gap));
  }
}

.essays {
  --essays-top: clamp(var(--space-12), 11vw, var(--space-24));
  position: relative;
  padding: var(--essays-top) 0 clamp(var(--space-8), 7vw, var(--space-20));
  text-align: center;
}
.entry {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: var(--space-4) var(--space-6);
  text-decoration: none;
}
.entry + .entry {
  margin-top: clamp(var(--space-12), 9vw, var(--space-24));
}
.entry__no {
  padding-left: var(--tracking);
}
.entry__title {
  margin-top: var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.entry__sub {
  display: block;
  margin-top: var(--space-6);
  font-size: var(--text-lg);
  font-style: italic;
  line-height: 1.35;
  color: var(--text);
  text-wrap: balance;
}
.entry__cta {
  display: block;
  margin-top: var(--space-8);
  padding-left: var(--tracking);
}
.entry:hover .dotlink::after,
.entry:focus-visible .dotlink::after {
  clip-path: inset(0 0 0 0);
}

@supports (animation-timeline: view()) {
  .entry {
    animation: fade-in linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 70%;
  }
}

/* --------------------------------------------------------------------------
   Essay
   -------------------------------------------------------------------------- */

.progress {
  display: none;
}
@supports (animation-timeline: scroll()) {
  .progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
}

.essay-head {
  padding: clamp(var(--space-12), 9vw, var(--space-24)) var(--gutter) 0;
  text-align: center;
}
.essay-head p {
  max-width: none;
}
.essay-head .label {
  padding-left: var(--tracking);
}
.essay-title {
  margin-top: var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.essay-sub {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  font-style: italic;
  line-height: 1.35;
}
.essay-byline {
  margin-top: var(--space-10);
}
.essay-date {
  margin-top: var(--space-2);
}

.prose {
  display: grid;
  grid-template-columns:
    minmax(var(--gutter), 1fr)
    minmax(0, 31em)
    minmax(var(--gutter), 1fr);
  font-size: var(--text-base);
  line-height: 1.62;
}
.prose > * {
  grid-column: 2;
}
.prose > p {
  max-width: none;
  hanging-punctuation: first;
}
.prose > .opener,
.prose > .closer {
  hanging-punctuation: none;
}
.prose > p + p {
  margin-top: 1.1em;
}
.prose > hr {
  margin-block: clamp(var(--space-16), 9vw, var(--space-24)) clamp(var(--space-12), 7vw, var(--space-20));
}
.prose > hr:first-child {
  margin-top: clamp(var(--space-12), 7vw, var(--space-20));
}

/* The line that opens each section, and the line that closes the essay */
.prose > .opener,
.prose > .closer {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: min(23em, 100% - var(--gutter) * 2);
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: 1.24;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}
.prose > .opener + p {
  margin-top: clamp(var(--space-10), 5vw, var(--space-16));
}
.prose > .closer {
  margin-top: clamp(var(--space-12), 7vw, var(--space-20));
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.prose a:hover {
  color: var(--ink);
}
.prose a:active {
  text-decoration-thickness: 2px;
}

.essay-foot {
  padding: clamp(var(--space-16), 9vw, var(--space-24)) var(--gutter) 0;
  text-align: center;
}
.essay-foot p {
  max-width: none;
  margin-top: var(--space-10);
  padding-left: var(--tracking);
}

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

.about {
  padding: clamp(var(--space-12), 9vw, var(--space-24)) var(--gutter) 0;
  text-align: center;
}
.about p {
  margin-inline: auto;
}
.about .label {
  padding-left: var(--tracking);
}
.about__statement {
  max-width: 21em;
  margin-top: var(--space-10);
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  line-height: 1.24;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.about__text {
  max-width: 32ch;
  margin-top: clamp(var(--space-12), 7vw, var(--space-20));
  font-size: var(--text-base);
  line-height: 1.55;
  text-wrap: balance;
}
.about__text + .about__text {
  margin-top: var(--space-5);
}
.about__cta {
  max-width: none;
  margin-top: var(--space-12);
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes ring-draw {
  from {
    stroke-dasharray: 0 1;
  }
  to {
    stroke-dasharray: 1 0;
  }
}
@keyframes point-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes extend-left {
  from {
    clip-path: inset(0 0 0 100%);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes extend-right {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes extend-down {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring circle,
  .point,
  .bridge,
  .domain__name,
  .lens__stem,
  .lens__word,
  .lens__sub,
  .hero::after,
  .entry {
    animation: none !important;
  }
  .progress {
    display: none;
  }
}
