/* Peep landing page.
   A 1990s coffeehouse print on kraft stock, with the private eye's typed notes:
   Macondo is the hand that letters headings and margin notes, Courier Prime is
   the typewriter for everything you read and run. */

@font-face {
  font-family: "Macondo";
  src: url("/assets/fonts/macondo.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --kraft: #d3b27f;
  --kraft-deep: #b8925c;
  --milk: #f6e3bd;
  --espresso: #2a1911;
  --coffee: #563621;
  --aubergine: #3b1e38;
  --plum: #5a2341;
  --rust: #84352a;
  --saffron: #f0b442;
  --verdigris: #3f7d72;
  --verdigris-dark: #2b5f56;

  --hand: "Macondo", "Papyrus", fantasy;
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 1240px;
}

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

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

body {
  margin: 0;
  background: var(--kraft);
  color: var(--espresso);
  font-family: var(--type);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
  margin: 0;
}

code {
  font-family: var(--type);
  font-size: 1em;
}

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

a:hover {
  color: var(--plum);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--aubergine);
  outline-offset: 3px;
}

.hand {
  font-family: var(--hand);
  font-weight: 400;
}

/* Placeholders such as <tunnel-id> never break at their hyphen. */
.whole {
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--espresso);
  color: var(--milk);
}

.skip:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- masthead ----------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.1rem var(--gutter) 1.25rem;
}

.wordmark {
  font-family: var(--hand);
  font-size: 2.25rem;
  line-height: 1;
  text-decoration: none;
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
  font-size: 0.9375rem;
}

/* ---- hero: the print block ---------------------------------------------- */

.hero {
  position: relative;
  color: var(--milk);
  /* A "rainbow roll": three inks blended on one roller, as linocut printers do. */
  background:
    radial-gradient(42rem 30rem at 76% 62%, rgb(240 180 66 / 0.16), transparent 70%),
    linear-gradient(176deg, var(--aubergine) 0%, var(--aubergine) 30%, var(--plum) 64%, var(--rust) 100%);
  /* Hand-cut top and bottom edges. */
  clip-path: polygon(0.00% 0.6px, 2.78% 0.9px, 5.56% 1.8px, 8.33% 2.8px, 11.11% 6.4px, 13.89% 4.0px, 16.67% 4.1px, 19.44% 0.8px, 22.22% 6.9px, 25.00% 2.2px, 27.78% 4.2px, 30.56% 6.6px, 33.33% 5.3px, 36.11% 1.2px, 38.89% 1.1px, 41.67% 0.8px, 44.44% 0.1px, 47.22% 6.3px, 50.00% 2.0px, 52.78% 3.5px, 55.56% 5.6px, 58.33% 1.9px, 61.11% 4.0px, 63.89% 4.7px, 66.67% 5.8px, 69.44% 4.2px, 72.22% 4.5px, 75.00% 5.0px, 77.78% 4.1px, 80.56% 5.8px, 83.33% 6.6px, 86.11% 5.4px, 88.89% 0.3px, 91.67% 6.3px, 94.44% 0.8px, 97.22% 3.7px, 100.00% 5.0px, 100.00% calc(100% - 3.9px), 97.22% calc(100% - 3.8px), 94.44% calc(100% - 1.2px), 91.67% calc(100% - 4.1px), 88.89% calc(100% - 6.8px), 86.11% calc(100% - 4.0px), 83.33% calc(100% - 4.7px), 80.56% calc(100% - 4.4px), 77.78% calc(100% - 5.0px), 75.00% calc(100% - 3.2px), 72.22% calc(100% - 0.5px), 69.44% calc(100% - 7.5px), 66.67% calc(100% - 7.0px), 63.89% calc(100% - 7.7px), 61.11% calc(100% - 1.1px), 58.33% calc(100% - 1.4px), 55.56% calc(100% - 3.6px), 52.78% calc(100% - 4.5px), 50.00% calc(100% - 6.7px), 47.22% calc(100% - 5.9px), 44.44% calc(100% - 5.9px), 41.67% calc(100% - 6.1px), 38.89% calc(100% - 4.3px), 36.11% calc(100% - 6.4px), 33.33% calc(100% - 1.8px), 30.56% calc(100% - 7.5px), 27.78% calc(100% - 6.5px), 25.00% calc(100% - 3.0px), 22.22% calc(100% - 3.8px), 19.44% calc(100% - 7.7px), 16.67% calc(100% - 2.1px), 13.89% calc(100% - 2.5px), 11.11% calc(100% - 3.9px), 8.33% calc(100% - 6.8px), 5.56% calc(100% - 8.0px), 2.78% calc(100% - 6.4px), 0.00% calc(100% - 3.5px));
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 2rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 4.5vw, 3.5rem) var(--gutter) clamp(2.75rem, 4.5vw, 3.5rem);
}

.pitch {
  max-width: 42rem;
}

.hero h1 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--milk);
}

/* Two deliberate lines on wide screens; free wrapping on narrow ones. */
.hero h1 span {
  display: block;
}

.lede {
  max-width: 34em;
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
}

.run {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.cmd {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  background: rgb(22 9 20 / 0.55);
  font-size: 1.0625rem;
  line-height: 1.45;
}

.cmd .prompt {
  color: var(--saffron);
  font-weight: 700;
  user-select: none;
}

.cmd code {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  color: var(--milk);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.copy {
  flex: none;
  margin: -0.2rem 0;
  padding: 0.2rem 0.65rem;
  border: 1.5px solid var(--saffron);
  border-radius: 0;
  background: transparent;
  color: var(--saffron);
  font: 700 0.875rem/1.5 var(--type);
  cursor: pointer;
}

.copy:hover {
  background: var(--saffron);
  color: var(--aubergine);
}

.copy:focus-visible,
.hero a:focus-visible {
  outline-color: var(--saffron);
}

.access {
  margin-top: 1.1rem;
  font-size: 0.9375rem;
  color: rgb(246 227 189 / 0.86);
}

.emblem {
  align-self: center;
  margin-right: calc(var(--gutter) * -0.5);
}

/* ---- the eye ------------------------------------------------------------ */

.eye {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ink-moon,
.rays path,
.ink-lidline {
  fill: var(--saffron);
}

.ink-star,
.ink-white,
.ink-glint {
  fill: var(--milk);
}

.ink-spiral,
.ink-wave {
  fill: #5fa192;
}

.ink-iris {
  fill: var(--verdigris);
}

.ink-cut {
  fill: var(--saffron);
}

.ink-fleck {
  fill: var(--milk);
  opacity: 0.7;
}

.ink-pupil {
  fill: #1d0d1a;
}

.eye .lid {
  transform-box: fill-box;
  transform-origin: 50% 52%;
}

@media (prefers-reduced-motion: no-preference) {
  /* The one unprompted moment: the eye opens as the page arrives. */
  .eye .lid {
    animation: eye-open 900ms cubic-bezier(0.3, 0.7, 0.2, 1) 200ms both;
  }

  /* Once open, it stays open; after a copy it blinks to confirm it saw. */
  .eye.awake .lid {
    animation: none;
  }

  .eye.awake.blink .lid {
    animation: eye-blink 320ms ease-in-out;
  }
}

@keyframes eye-open {
  0%,
  20% {
    transform: scaleY(0.06);
  }
  100% {
    transform: scaleY(1);
  }
}

@keyframes eye-blink {
  0%,
  100% {
    transform: scaleY(1);
  }
  45%,
  55% {
    transform: scaleY(0.06);
  }
}

/* ---- the address, annotated --------------------------------------------- */

.address {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 2.75rem) var(--gutter) 0;
  --url-size: clamp(1.5rem, 2.6vw, 2.25rem);
  /* Courier Prime's advance is 0.6em, so this is one column of the address. */
  --cw: calc(var(--url-size) * 0.6);
}

.address-lead {
  font-family: var(--type);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
}

.address-lead code {
  font-weight: 700;
}

.url-board {
  position: relative;
  margin-top: 0.75rem;
  padding: 2.9rem 0 3.4rem;
}

.url {
  font-size: var(--url-size);
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.notes {
  list-style: none;
  padding: 0;
}

/* Each note sits over or under its part of the address, placed by column. */
.note {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
}

.note .part {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The inked bracket over or under the part. */
.note::before {
  content: "";
  position: absolute;
  left: calc(var(--col) * var(--cw) + 0.1rem);
  width: calc(var(--len) * var(--cw) - 0.2rem);
  height: 0.7rem;
  border: 2.5px solid var(--aubergine);
}

.note .hand {
  position: absolute;
  left: calc(var(--col) * var(--cw));
  width: max-content;
  max-width: 24rem;
  color: var(--aubergine);
  font-size: 1.3125rem;
  line-height: 1.15;
}

.note-route::before,
.note-host::before {
  top: 2.05rem;
  border-bottom: 0;
  border-radius: 55% 45% 0 0 / 100% 100% 0 0;
}

.note-route .hand,
.note-host .hand {
  top: 0.15rem;
}

.note-id::before {
  bottom: 2.3rem;
  border-top: 0;
  border-radius: 0 0 48% 52% / 0 0 100% 100%;
}

.note-id .hand {
  bottom: 0.25rem;
}

/* ---- the path a visit takes --------------------------------------------- */

.path {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 0;
}

h2 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  color: var(--espresso);
}

.trail {
  position: relative;
  margin-top: 2rem;
  padding-top: 4.25rem;
}

.trail-note {
  position: absolute;
  top: 0;
  color: var(--aubergine);
  font-size: 1.3125rem;
  line-height: 1.15;
}

/* The stops are four columns 1.5rem apart, so the line runs from the first
   column's edge to the last one's, and the third stop sits at two-thirds. */
.trail-sealed {
  left: 0;
  width: calc(50% + 0.75rem);
  text-align: center;
}

.trail-open {
  left: calc(50% + 0.75rem);
  width: calc(25% + 0.375rem);
  text-align: center;
}

.trail-line {
  position: absolute;
  top: 2.6rem;
  left: 0.6rem;
  width: calc(75% + 1.125rem);
  height: 1.5rem;
  overflow: visible;
}

.trail-line path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.trail-line .sealed {
  stroke: var(--verdigris-dark);
  stroke-width: 5;
}

.trail-line .open {
  stroke: var(--espresso);
  stroke-width: 3;
  stroke-dasharray: 2 9;
}

.stops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.stops li {
  position: relative;
  padding-top: 1.75rem;
}

/* An ink dot where the line reaches each stop. */
.stops li::before {
  content: "";
  position: absolute;
  top: -1.05rem;
  left: 0;
  width: 1.2rem;
  height: 1.1rem;
  background: var(--espresso);
  border-radius: 54% 46% 51% 49% / 47% 55% 45% 53%;
}

.stops li:nth-child(3)::before {
  background: var(--saffron);
  box-shadow: 0 0 0 3px var(--espresso);
}

.stops h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

.stops p {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--coffee);
}

.stops code {
  overflow-wrap: anywhere;
}

/* ---- install notes and the command menu --------------------------------- */

.notebook {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 5.5rem) var(--gutter) clamp(3.5rem, 7vw, 5rem);
}

.install p {
  max-width: 36em;
  margin-top: 1rem;
}

.install h2 + p {
  margin-top: 1.25rem;
}

.install code,
.menu code {
  font-weight: 700;
}

.menu {
  margin-top: 1.25rem;
}

/* A café menu: the command, a dotted leader, then what it does. */
.menu > div {
  display: grid;
  grid-template-columns: max-content minmax(1.5rem, 1fr) minmax(0, 15.5rem);
  align-items: baseline;
  padding: 0.55rem 0;
}

.menu > div::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  align-self: baseline;
  height: 0.2em;
  margin: 0 0.6rem;
  border-bottom: 2px dotted var(--coffee);
}

.menu dt {
  grid-column: 1;
  grid-row: 1;
}

.menu dd {
  grid-column: 3;
  grid-row: 1;
  color: var(--coffee);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---- colophon ----------------------------------------------------------- */

.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--coffee);
}

.colophon p {
  max-width: 62em;
}

.colophon::before {
  content: "";
  display: block;
  height: 2px;
  margin-bottom: 1.75rem;
  background: var(--espresso);
}

.colophon p + p {
  margin-top: 0.4rem;
}

/* ---- narrower screens --------------------------------------------------- */

@media (max-width: 1020px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  }

  .stops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2.5rem;
  }

  .trail {
    padding-top: 0;
  }

  .trail-line {
    display: none;
  }

  /* The notes become a legend for the rules beside each stop. */
  .trail {
    display: flex;
    flex-wrap: wrap;
    column-gap: 2rem;
  }

  .trail-note {
    position: static;
    width: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
  }

  .trail-note::before {
    content: "";
    width: 1.75rem;
    height: 0;
    border-top: 5px solid var(--verdigris-dark);
  }

  .trail-open::before {
    border-top: 3px dotted var(--espresso);
  }

  .stops {
    flex-basis: 100%;
    margin-top: 1.75rem;
  }

  .stops li::before {
    display: none;
  }

  .stops li {
    padding-top: 0;
    padding-left: 1.25rem;
    border-left: 5px solid var(--verdigris-dark);
  }

  .stops li:nth-child(4) {
    border-left: 3px dotted var(--espresso);
  }

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

@media (max-width: 760px) {
  body {
    font-size: 1rem;
  }

  .masthead nav {
    gap: 0.25rem 1.1rem;
    font-size: 0.8125rem;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 1.75rem;
  }

  .emblem {
    order: -1;
    width: min(74%, 22rem);
    margin: 0 -0.5rem 0.75rem auto;
  }

  /* Keep the two lines of the headline whole on phones. */
  .hero h1 {
    font-size: clamp(2.125rem, 11.4vw, 3.25rem);
  }

  .lede {
    font-size: 1rem;
  }

  .cmd {
    font-size: 0.9375rem;
    padding-left: 0.75rem;
  }

  /* Notes become a plain list under the address. */
  .address {
    --url-size: clamp(1.05rem, 5.4vw, 1.5rem);
  }

  .url-board {
    padding: 0.25rem 0 0;
  }

  .url {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .notes {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.25rem;
  }

  .note {
    position: static;
    width: auto;
    height: auto;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.75rem;
    align-items: baseline;
    font-size: 1rem;
  }

  .note::before {
    display: none;
  }

  .note .part {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    font-weight: 700;
  }

  .note .hand {
    position: static;
    width: auto;
    max-width: none;
    font-size: 1.1875rem;
  }

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

  .menu > div {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.5rem 0;
  }

  .menu > div::after {
    display: none;
  }

  .menu dd {
    grid-column: 1;
    grid-row: 2;
  }
}
