/* EB Garamond is served from this site, so no font service sees who
   visits. SIL Open Font License; the license is in fonts/. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-normal-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond-italic-400-latin.woff2") format("woff2");
}

/* The page is one sheet of two-sided origami paper: indigo on the face,
   white on the back, with a single gold flap where a corner is turned. */
:root {
  color-scheme: light;
  --indigo: #1f2e6e;
  --paper: #ffffff;
  --ink: #161b33;
  --slate: #565c75;
  --gold: #f2b31b;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --page: 66rem;
  --fold: clamp(3rem, 7vw, 6.5rem);
  --font: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.125rem, 0.45vw + 1.02rem, 1.3125rem);
  font-synthesis: none;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 2;
  padding: 0.35rem 0.8rem;
  background: var(--paper);
  color: var(--indigo);
}

.skip:focus {
  top: 0.5rem;
}

/* ---------- The indigo face: masthead, haiku, crease pattern ---------- */

.sheet {
  position: relative;
  background: var(--indigo);
  color: var(--paper);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fold)),
    calc(100% - var(--fold)) 100%,
    0 100%
  );
}

/* The turned corner, showing the paper's other side. */
.sheet::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--fold);
  height: var(--fold);
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.sheet a {
  text-decoration-color: var(--gold);
}

.masthead,
.hero {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2.5rem;
  padding-block: 1.5rem;
}

.wordmark {
  margin: 0;
  font-size: 1.4em;
  font-weight: 400;
  line-height: 1.2;
}

.wordmark a,
.masthead nav a {
  text-decoration-line: none;
}

.masthead nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.masthead nav a {
  display: inline-block;
  padding-block: 0.3rem;
}

.masthead nav a:hover {
  text-decoration-line: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(13rem, 24vw, 19rem);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2.5rem, 7vw, 5.5rem) calc(var(--fold) + 2.5rem);
}

/* Each line of the haiku steps in, the way each fold narrows the sheet. */
.haiku {
  --step: clamp(0.6rem, 2.6vw, 2.5rem);
  margin: 0;
  font-size: clamp(1.45rem, max(min(7.25vw, 1.7rem), 3.6vw + 0.3rem), 3.35rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.005em;
}

.haiku span {
  display: block;
}

.haiku span:nth-child(2) {
  padding-left: var(--step);
}

.haiku span:nth-child(3) {
  padding-left: calc(var(--step) * 2);
}

.statement {
  max-width: 31rem;
  margin: clamp(1.75rem, 4vw, 3rem) 0 0;
  font-size: 1.12em;
  line-height: 1.45;
}

.statement + .statement {
  margin-top: 0.8em;
}

.crease-pattern {
  margin: 0;
}

.crease-pattern svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.crease-pattern .crease {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
}

.crease-pattern .edge {
  stroke-width: 1.8;
}

.crease-pattern .reference {
  opacity: 0.5;
}

.crease-pattern figcaption {
  margin-top: 0.9rem;
  font-size: 0.82em;
  font-style: italic;
  line-height: 1.4;
}

/* The one piece of unprompted motion: the creases are drawn once, in the
   order they are folded. */
@media (prefers-reduced-motion: no-preference) {
  .crease-pattern .crease {
    animation: crease 0.9s ease-out both;
  }

  .crease-pattern .reference {
    animation-delay: 0.35s;
  }

  .crease-pattern .kite {
    animation-delay: 0.85s;
  }

  .crease-pattern .petal {
    animation-delay: 1.35s;
  }
}

@keyframes crease {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- The white back: the practice in prose ---------- */

main {
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 0;
}

.section {
  display: grid;
  grid-template-columns: 12rem minmax(0, 35rem);
  align-items: baseline;
  column-gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(1.6rem, 3.5vw, 2.6rem);
  scroll-margin-top: 1rem;
}

.section > h2 {
  margin: 0;
  color: var(--indigo);
  font-size: 1.3em;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
}

.section p {
  margin: 0 0 0.9em;
}

.section p:last-child {
  margin-bottom: 0;
}

.section a {
  color: var(--indigo);
}

/* Recent AI work. Each piece of work is named at heading size. */
.work {
  margin-top: 1.7em;
}

.work h3 {
  margin: 0 0 0.25em;
  color: var(--indigo);
  font-size: 1.3em;
  font-weight: 400;
  line-height: 1.3;
}

.work h3 a {
  text-decoration-thickness: 2px;
}

.work h3 a:hover {
  text-decoration-thickness: 3px;
}

.work p {
  margin-bottom: 0.55em;
}

.work .stack {
  color: var(--slate);
  font-size: 0.92em;
  font-style: italic;
}

.section .more {
  margin-top: 1.7em;
}

/* Scope, cost and time: the triangle the approach works inside. The text
   runs along its edge. */
.triangle {
  float: right;
  width: 12.5rem;
  margin: 0.35rem 0 0.5rem 1.25rem;
  shape-outside: polygon(50% 0, 100% 100%, 0 100%);
  shape-margin: 0.9rem;
  color: var(--indigo);
}

.triangle svg {
  display: block;
  width: 100%;
  height: auto;
}

.triangle polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.triangle text {
  fill: currentColor;
  font-family: var(--font);
  font-size: 19px;
  font-style: italic;
  text-anchor: middle;
}

.tools {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.6rem 1.75rem;
  margin: 0;
}

.tools dt {
  color: var(--slate);
  font-style: italic;
}

.tools dd {
  margin: 0;
}

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

.engagements {
  columns: 2 12rem;
  column-gap: 2rem;
  margin-top: 0.4em;
}

.engagements li {
  break-inside: avoid;
}

.email {
  font-size: clamp(1.05em, 5.4vw, 1.3em);
  overflow-wrap: anywhere;
}

/* ---------- Colophon: the folded crane ---------- */

.colophon {
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--gutter) 2.5rem;
  color: var(--slate);
  font-size: 0.85em;
}

.colophon img {
  display: block;
  width: min(17rem, 70%);
  height: auto;
  margin-bottom: 1.25rem;
}

.colophon p {
  margin: 0;
}

/* ---------- Page not found ---------- */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.lost .sheet {
  flex: 1;
}

.lost .hero {
  display: block;
}

.lost .statement a {
  white-space: nowrap;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 54rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .crease-pattern {
    width: min(16rem, 70%);
  }

  .section {
    grid-template-columns: minmax(0, 35rem);
    row-gap: 0.6rem;
  }
}

@media (max-width: 34rem) {
  .triangle {
    float: none;
    width: 11rem;
    margin: 0 auto 1.25rem;
    shape-outside: none;
  }

  .tools {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  .tools dd {
    margin-bottom: 0.7rem;
  }
}

@media print {
  .sheet {
    background: none;
    color: var(--ink);
    clip-path: none;
  }

  .sheet::after,
  .masthead nav,
  .skip {
    display: none;
  }

  .sheet a {
    text-decoration-color: currentColor;
  }

  .crease-pattern .crease {
    animation: none;
  }
}
