:root {
  color-scheme: dark;
  --background: #161616;
  --foreground: #f5f5f5;
  --muted: #999;
  --accent: #fff;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Liberation Mono", monospace;
  --serif: Georgia, serif;
  --gutter: clamp(1rem, 4.8vw, 5rem);
  --gap: clamp(.75rem, 1.35vw, 1.5rem);
  --copy-size: clamp(1.0625rem, 1.4vw, 1.375rem);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: clip;
  isolation: isolate;
  background: var(--background);
  color: var(--foreground);
  font: var(--copy-size)/1.55 var(--mono);
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 700; }
a { color: inherit; text-underline-offset: .23em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.frame { width: min(calc(100% - 2 * var(--gutter)), 96rem); margin-inline: auto; }
.skip {
  position: fixed;
  z-index: 1;
  inset: .75rem auto auto .75rem;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--background);
  transform: translateY(-200%);
}
.skip:focus { transform: none; color: var(--background); }

.cover, .chapter {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.wordmark {
  position: fixed;
  z-index: 2;
  inset: auto auto env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  padding: .1em .16em .13em;
  color: var(--accent);
  font: 700 min(11.2vw, 13.3rem)/.75 var(--sans);
  letter-spacing: -.095em;
  pointer-events: none;
  user-select: none;
}
.wordmark [role="img"] > span { display: block; width: max-content; }
.wordmark [role="img"] > span:first-child {
  font-size: .76em;
  margin-inline-start: -.055em;
  transform: scaleX(1.06);
  transform-origin: left center;
}
.wordmark-i { margin-inline-start: .055em; }
.wordmark-g { margin-inline-start: .075em; }
.wordmark-slash { margin-inline-end: .15em; }
.wordmark-caption {
  margin-block-start: .8rem;
  font: clamp(.75rem, 1.05vw, 1rem)/1.4 var(--mono);
  letter-spacing: .035em;
}

.cover {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  align-content: center;
  padding-block: 1.15rem clamp(3rem, 20svh, 12rem);
}
.cover-landscape, .cover-interference {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  height: 100%;
  pointer-events: none;
}
.cover-landscape {
  object-fit: cover;
  object-position: 100% 54%;
  filter: sepia(.34) saturate(.86) contrast(.98) brightness(1.08);
}
.cover-interference {
  opacity: .12;
  background:
    repeating-linear-gradient(to right, transparent 0 7%, rgb(33 28 12 / .82) 7% 14%, transparent 14% 27%, rgb(255 238 188 / .7) 27% 31%, transparent 31% 100%) 0 12% / 100% 12px,
    repeating-linear-gradient(to right, rgb(30 27 12 / .75) 0 4%, transparent 4% 18%, rgb(241 225 177 / .65) 18% 29%, transparent 29% 42%, rgb(31 27 12 / .8) 42% 48%, transparent 48% 100%) 0 27% / 100% 18px,
    repeating-linear-gradient(to right, transparent 0 12%, rgb(30 27 12 / .8) 12% 16%, transparent 16% 35%, rgb(250 231 173 / .72) 35% 51%, transparent 51% 70%, rgb(37 31 15 / .75) 70% 76%, transparent 76% 100%) 0 64% / 100% 14px,
    repeating-linear-gradient(to right, rgb(31 28 14 / .75) 0 9%, transparent 9% 21%, rgb(255 240 193 / .7) 21% 25%, transparent 25% 46%, rgb(28 26 13 / .78) 46% 62%, transparent 62% 100%) 0 86% / 100% 20px;
  background-repeat: repeat-x;
  animation: landscape-noise 8s steps(1, end) infinite;
  mix-blend-mode: screen;
}
@keyframes landscape-noise {
  0%, 16%, 18%, 61%, 63%, 100% {
    background-position: 0 12%, 0 27%, 0 64%, 0 86%;
    opacity: .12;
  }
  17%, 62% {
    background-position: 13% 12%, -9% 27%, 7% 64%, -16% 86%;
    opacity: .4;
  }
}
.cover h1 {
  font-family: var(--sans);
  grid-column: 1 / -1;
  justify-self: end;
  max-width: 19ch;
  text-align: right;
  font-size: clamp(1.7rem, 5.25vw, 6rem);
  line-height: .9;
  letter-spacing: -.075em;
  text-wrap: balance;
  mix-blend-mode: multiply;
}
.chapter {
  padding-block: 1.1rem clamp(4rem, 8vw, 8rem);
  scroll-margin-top: 1rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.cover h1 { position: relative; }
.about-lead, .about-copy,
.services, .archive-note, .contact-intro, .contact-details {
  position: relative;
}
.about-lead {
  grid-column: 1 / 6;
  font-size: clamp(1.1875rem, 2vw, 2rem);
  line-height: 1.38;
  letter-spacing: -.04em;
}
.about-copy { grid-column: 8 / -1; max-width: 44ch; }
.about-copy p + p, .contact-intro p + p { margin-top: 1.35em; }

.services {
  grid-column: 1 / -1;
  padding: 0;
  list-style: none;
}
.services li {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: baseline;
  gap: var(--gap);
  padding-block: clamp(1.5rem, 3vw, 2.8rem);
}
.services h3 {
  font-family: var(--sans);
  max-width: 18ch;
  font-size: clamp(1.35rem, 3.2vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.services p { max-width: 43ch; }

.archive-note {
  grid-column: 1 / -1;
  justify-self: end;
  max-width: 14ch;
  margin-bottom: var(--gap);
  color: var(--muted);
  font: 700 clamp(2rem, 5vw, 6rem)/.9 var(--sans);
  letter-spacing: -.065em;
  text-align: right;
}
.client-credits {
  grid-column: 1 / -1;
  position: relative;
  width: min(100%, 42rem);
  justify-self: end;
  text-align: right;
}
@media (prefers-reduced-motion: no-preference) {
  .client-window.is-enhanced {
    block-size: 50vh;
    overflow: auto;
    scrollbar-width: none;
  }
  .client-window.is-enhanced::-webkit-scrollbar { display: none; }
}
.client-list {
  padding: .15rem 1rem .15rem 0;
  list-style: none;
  font: .875rem/1.65 var(--mono);
  overflow-wrap: anywhere;
}

.contact-intro {
  grid-column: 1 / 6;
  font-size: clamp(1.125rem, 2vw, 1.9375rem);
  line-height: 1.38;
  letter-spacing: -.04em;
}
.contact-details {
  display: grid;
  grid-column: 8 / -1;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: .55rem 1rem;
  align-self: start;
  padding-top: .75rem;
  font: var(--copy-size)/1.45 var(--mono);
}
.contact-details dt { color: var(--muted); }
.contact-details :is(dt, dd) { overflow-wrap: anywhere; }

.contact {
  margin-block-start: -6rem;
  padding-block-end: calc(24rem + env(safe-area-inset-bottom, 0px));
}
.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .85rem;
  margin-block-start: .35rem;
  font-size: .8rem;
}
.legal-actions button, .legal-dialog button {
  padding: .2em 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.legal-dialog {
  width: min(34.5rem, calc(100% - 1rem));
  max-width: none;
  max-height: calc(100% - 1rem);
  padding: 2.45rem 3.125rem .375rem;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: .95rem/1.55 var(--mono);
}
.legal-dialog::backdrop { background: rgb(0 0 0 / .7); }
.legal-dialog h2 { font-size: 1.125rem; }
.legal-dialog p { margin-block: .75rem 1rem; }
.legal-dialog--wide { width: min(45.75rem, calc(100% - 1rem)); }

.legal-dialog-panel {
  max-block-size: min(80dvh, calc(100dvh - 5rem));
  overflow: auto;
  padding: clamp(1rem, 4vw, 1.75rem);
  border: 1px solid var(--muted);
  background: var(--background);
}
.legal-dialog-close {
  position: absolute;
  inset: .375rem .375rem auto auto;
}
.legal-dialog-close button {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  font: 2.5rem/1 var(--sans);
  text-decoration: none;
}

@media (max-width: 36rem) {
  .legal-dialog { padding-inline: .375rem 2rem; }
  .legal-dialog-close { inset-inline-end: .15rem; }
}

.cover { --text-color: #ff8b40; }
.about { --text-color: #d8f25b; }
#services { --text-color: #8ae0ff; }
.clients { --text-color: #ff95bf; }
.contact { --text-color: #ff8b40; }

main p { hyphens: none; }

main :is(h1, h3, p, .client-list li, dt, dd) {
  position: relative;
  z-index: 3;
  color: var(--text-color, var(--accent));
  mix-blend-mode: difference;
}

.cover h1#headline { mix-blend-mode: multiply; }

@media (max-width: 48rem) {
  .cover-landscape { object-position: 82% 54%; }
  .cover, .chapter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wordmark { font-size: 11.9vw; }
  .cover { min-height: 100svh; }
  .cover h1 {
    max-width: min(100%, 17ch);
    font-size: clamp(2.125rem, 9vw, 4rem);
  }
  .about-lead, .contact-intro { grid-column: 1 / -1; }
  .about-copy { grid-column: 2 / -1; }
  .about-copy { margin-top: 1.4rem; }
  .services li { grid-template-columns: 1fr; gap: .5rem; }
  .contact-details { grid-column: 1 / -1; }
  .contact-details { margin-top: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .contact { margin-block-start: 0; padding-block-end: calc(30rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark { position: absolute; }
}

/* The index changes its alignment at each section break. */
@media (min-width: 49rem) {
  .services { grid-column: 1 / 11; }
  .about-lead, .about-copy { margin-top: clamp(1rem, 4vw, 5rem); }
  .services li:nth-child(3n + 2) h3 { margin-inline-start: clamp(.5rem, 4vw, 4rem); }
  .services li:nth-child(3n) p { margin-inline-start: clamp(.5rem, 3vw, 3rem); }
  .clients .archive-note { grid-column: 1 / -1; }
  .client-credits { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference) {
  .edge-eroded:not(:focus-within) {
    mask-image: url("./assets/edge/top.svg?v=fine"), linear-gradient(black, black), url("./assets/edge/bottom.svg?v=fine");
    mask-size: 192px var(--edge-depth), calc(100% + 2rem) calc(var(--edge-viewport-height) - 2 * var(--edge-depth)), 192px var(--edge-depth);
    mask-position:
      left var(--edge-mask-offset),
      center calc(var(--edge-mask-offset) + var(--edge-depth)),
      left calc(var(--edge-mask-offset) + var(--edge-viewport-height) - var(--edge-depth));
    mask-repeat: repeat-x, no-repeat, repeat-x;
    mask-clip: no-clip;
  }

  .wordmark [role="img"] {
    position: relative;
    animation: logo-tint 6.8s step-end 1.1s infinite;
  }
  .wordmark [role="img"]::after {
    content: "";
    position: absolute;
    inset: -.02em -.17em 0 -.08em;
    opacity: 0;
    background: linear-gradient(to bottom,
      transparent 12%,
      var(--background) 12% 13%,
      transparent 13% 17%,
      currentColor 17% 17.5%,
      transparent 17.5% 31%,
      var(--background) 31% 33%,
      transparent 33% 39%,
      currentColor 39% 39.5%,
      transparent 39.5% 61%,
      var(--background) 61% 62.5%,
      transparent 62.5% 66%,
      currentColor 66% 66.5%,
      transparent 66.5% 79%,
      var(--background) 79% 80%,
      transparent 80% 86%,
      currentColor 86% 86.4%,
      transparent 86.4%);
    mask-image: repeating-linear-gradient(to right,
      black 0 13%, transparent 13% 18%, black 18% 26%, transparent 26% 31%);
    animation: tracking-noise 6.8s step-end 1.1s infinite;
  }
}

@keyframes tracking-noise {
  0%, 4%, 78.4%, 100% { opacity: 0; }
  1.5%, 76.5% { opacity: .8; }
  3%, 77.7% { opacity: .45; }
}
@keyframes logo-tint {
  0%, 4%, 78.4%, 100% { color: var(--accent); filter: none; }
  1.5%, 77.7% { color: #d5f5ff; filter: blur(clamp(.5px, .1vw, 1.5px)); }
  3%, 76.5% { color: #ffe2ee; filter: blur(.5px); }
}
