/*
 * Child pages: a printed index for a room with ten openings.
 *
 * The page is white paper. One leather accent marks the destination's cell in
 * the goal map and the one live link. Type is Fraunces for the index and
 * Instrument Sans for everything you have to read. No cards, no shadows, no
 * rounded boxes: the hairline and the grid do the structuring.
 */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #ffffff;
  --ink: #141311;
  --ink-soft: #3c3933;
  --muted: #67635b;
  --faint: #736e64;
  --rule: #e4dfd4;
  --wash: #f4f0e7;
  --accent: #b8451f;
  --accent-deep: #8a3115;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --measure: 64ch;
  color-scheme: light;
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
}

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

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

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

::selection {
  color: var(--paper);
  background: var(--accent);
}

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
  translate: 0 -180%;
}

.skip-link:focus-visible {
  translate: 0;
}

/* --------------------------------------------------------------- chrome */

.site-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px var(--gutter) 22px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  text-underline-offset: 4px;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px var(--gutter) 42px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

.site-foot a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}

.site-foot a:hover {
  text-decoration-color: var(--accent);
}

/* ------------------------------------------------------------------ page */

.page-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 3.2fr);
  gap: clamp(40px, 7vw, 112px);
  padding: clamp(52px, 8vw, 118px) 0 clamp(72px, 10vw, 150px);
}

.index-rail {
  position: sticky;
  top: 36px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.index-num {
  font-family: var(--serif);
  font-size: clamp(82px, 10vw, 136px);
  font-weight: 300;
  font-optical-sizing: auto;
  line-height: 0.78;
  letter-spacing: -0.07em;
  color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}

.index-caption {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* The 5 x 2 goal itself, used as an index mark rather than decoration. */
.goal-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  inline-size: 104px;
  aspect-ratio: 5 / 2;
  padding: 5px;
  background: var(--ink);
}

.goal-map__cell {
  background: var(--paper);
}

.goal-map__cell.is-on {
  background: var(--accent);
}

.page-body {
  min-width: 0;
  max-width: 900px;
}

.kicker {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

h1 {
  max-width: 13ch;
  margin: 12px 0 20px;
  font-family: var(--serif);
  font-size: clamp(52px, 7.4vw, 104px);
  font-weight: 300;
  font-optical-sizing: auto;
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lede {
  max-width: 46ch;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(19px, 2.1vw, 23px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.section-head {
  margin-top: clamp(48px, 7vw, 78px);
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- empty */

.empty {
  padding: clamp(30px, 5vw, 46px) 0 0;
}

.empty__line {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.empty__copy {
  max-width: 48ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
}

.text-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent-deep);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.text-link:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------------- links */

.link-list {
  border-bottom: 1px solid var(--rule);
}

.link-row {
  border-top: 1px solid var(--rule);
}

.link-card {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 38px);
  padding: clamp(20px, 3vw, 30px) 0;
  text-decoration: none;
}

.link-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--wash);
}

.link-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.link-card:hover .link-card__media img {
  scale: 1.035;
}

.link-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 2px;
}

.link-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.link-card__meta > span + span::before {
  content: "/";
  margin-right: 7px;
  color: var(--rule);
}

.link-card__meta .tag {
  color: var(--accent-deep);
}

.link-card__meta .tag::before {
  content: none;
}

.link-card__title {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.7vw, 32px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 180ms ease;
}

.link-card:hover .link-card__title {
  text-decoration-color: var(--accent);
}

.link-card__desc {
  max-width: 54ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.link-card__open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent-deep);
  font-size: 13px;
}

.link-card__open .arrow {
  transition: translate 180ms ease;
}

.link-card:hover .link-card__open .arrow {
  translate: 2px -2px;
}

/* --------------------------------------------------------------- index */

.index-hero {
  max-width: 880px;
  padding: clamp(56px, 8vw, 112px) 0 clamp(40px, 6vw, 72px);
}

.index-hero h1 {
  max-width: 12ch;
  font-size: clamp(56px, 9vw, 132px);
}

.index-hero .lede {
  margin-top: 24px;
}

.index-list {
  border-top: 1px solid var(--ink);
}

.index-list li {
  border-bottom: 1px solid var(--rule);
}

.index-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 24px;
  align-items: baseline;
  gap: clamp(14px, 3vw, 32px);
  padding: 24px 0;
  text-decoration: none;
}

.index-row__num {
  color: var(--faint);
  font-family: var(--serif);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.index-row__title {
  font-family: var(--serif);
  font-size: clamp(25px, 3.1vw, 36px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.025em;
  transition: color 160ms ease;
}

.index-row__state {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.index-row__arrow {
  color: var(--accent);
  font-size: 17px;
  transition: translate 160ms ease;
}

.index-row:hover .index-row__title {
  color: var(--accent-deep);
}

.index-row:hover .index-row__arrow {
  translate: 3px -3px;
}

/* ---------------------------------------------------------------- pager */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: clamp(48px, 7vw, 76px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.pager a {
  color: var(--muted);
  text-decoration: none;
}

.pager a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 760px) {
  .page-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 40px;
  }

  .index-rail {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .index-num {
    font-size: 64px;
  }

  .index-caption {
    display: none;
  }

  .goal-map {
    inline-size: 82px;
  }

  .link-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .link-card__media {
    aspect-ratio: 16 / 9;
  }

  .link-card__open {
    padding-top: 12px;
  }

  .index-row {
    grid-template-columns: 34px minmax(0, 1fr) 20px;
  }

  .index-row__state {
    display: none;
  }
}

@media (max-width: 460px) {
  .site-head {
    padding-top: 22px;
  }

  .index-row {
    gap: 12px;
  }

  .index-row__arrow {
    font-size: 15px;
  }
}

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

@media (forced-colors: active) {
  .goal-map {
    background: CanvasText;
  }

  .goal-map__cell {
    background: Canvas;
  }

  .goal-map__cell.is-on {
    background: Highlight;
  }
}
