/* ==========================================================================
   8 Bit Cache
   Grid: 8 columns, broken 3 | 5. The spine sits on that break and runs the
   whole page. Eight for the name, three against five for what we make.
   ========================================================================== */

:root {
  /* Palette: a CRT in its off state, lit by sodium vapor. */
  --void:  #0B0E0C;
  --slab:  #14181A;
  --wire:  #2A3130;
  --bone:  #D8D4C8;
  --amber: #E8A33D;

  --bone-dim: color-mix(in srgb, var(--bone) 58%, var(--void));
  --bone-faint: color-mix(in srgb, var(--bone) 32%, var(--void));

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;

  --shell: 1240px;
  --gap: clamp(12px, 1.6vw, 26px);
  --pad: clamp(20px, 5vw, 64px);
  --colw: calc((100% - 7 * var(--gap)) / 8);
  /* The 3 | 5 break: three columns plus two full gaps and half the third. */
  --spine: calc(3 * var(--colw) + 2.5 * var(--gap));

  --band-y: clamp(72px, 11vw, 160px);
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--body);
  font-size: clamp(17px, 1.05vw + 13px, 20px);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: var(--void);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  z-index: 20;
}
.skip:focus { left: 0; }

a { color: inherit; }

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

/* --- Status bar ---------------------------------------------------------- */

.statusbar {
  border-bottom: 1px solid var(--wire);
  position: relative;
  z-index: 2;
}

.statusbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  height: 46px;
}

.statusbar__mid { color: var(--bone-faint); }

@media (max-width: 640px) {
  .statusbar__mid { display: none; }
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(56px, 10vw, 128px) clamp(64px, 10vw, 140px);
  border-bottom: 1px solid var(--wire);
  overflow: hidden;
}

/* Scanlines, kept almost subliminal. One accessory, worn quietly. */
.hero__field {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(216, 212, 200, 0.035) 0px,
    rgba(216, 212, 200, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  mask-image: radial-gradient(120% 90% at 50% 18%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 18%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero__inner { position: relative; }

.eyebrow {
  margin: 0 0 clamp(20px, 3vw, 34px);
  color: var(--amber);
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  /* Sized so the shifted line still lands inside the shell. CACHE measures
     4.513x the font size, and the shifted line has 698px to live in. */
  font-size: clamp(3.2rem, 12vw, 9.6rem);
  line-height: 0.84;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
}

.wordmark__line { display: block; }

/* The name breaks on the same seam the grid does. */
.wordmark__line--shift {
  margin-left: var(--spine);
  color: var(--bone-dim);
}

.hero__grid {
  margin-top: clamp(40px, 6vw, 76px);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  column-gap: var(--gap);
  row-gap: clamp(28px, 4vw, 40px);
  align-items: start;
}

.hero__tally { grid-column: 1 / span 3; }

.hero__lede {
  grid-column: 4 / span 5;
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw + 0.8rem, 1.62rem);
  line-height: 1.42;
  text-wrap: pretty;
  max-width: 34ch;
}

/* Tally: three against five, drawn rather than stated. */
.tally {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  gap: 7px;
}

.tally li {
  width: 12px;
  height: 34px;
  background: var(--wire);
}

.tally--few li { background: var(--amber); }

.tally__label {
  margin: 0 0 10px;
  color: var(--bone-faint);
}

.tally__label--lower { margin-top: 4px; }

/* --- Bands --------------------------------------------------------------- */

.band {
  position: relative;
  padding-block: var(--band-y);
  border-bottom: 1px solid var(--wire);
}

.band__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  column-gap: var(--gap);
  row-gap: clamp(26px, 4vw, 44px);
  align-items: start;
}

/* The spine. It is the one line that never moves. Absolute inside the grid, so
   the percentages in --spine resolve against the grid's own width. */
.band__grid::before {
  content: "";
  position: absolute;
  top: calc(var(--band-y) * -1);
  bottom: calc(var(--band-y) * -1);
  left: var(--spine);
  width: 1px;
  background: var(--wire);
  pointer-events: none;
}

@media (max-width: 860px) {
  .band__grid::before { display: none; }
}

.band__rail { grid-column: 1 / span 3; }
.band__body { grid-column: 4 / span 5; }

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(1.5rem, 2.4vw + 0.6rem, 2.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* --- Tenets -------------------------------------------------------------- */

.tenets { margin: 0; }

.tenet + .tenet {
  margin-top: clamp(28px, 3.4vw, 44px);
  padding-top: clamp(28px, 3.4vw, 44px);
  border-top: 1px solid var(--wire);
}

.tenet dt {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 108%;
  font-size: clamp(1.08rem, 1vw + 0.8rem, 1.35rem);
  margin-bottom: 10px;
}

.tenet dd {
  margin: 0;
  color: var(--bone-dim);
  max-width: 52ch;
  text-wrap: pretty;
}

/* --- Project ------------------------------------------------------------- */

.band--project { background: var(--slab); }

.project__lede {
  margin: 0;
  font-size: clamp(1.1rem, 1.3vw + 0.8rem, 1.45rem);
  line-height: 1.46;
  max-width: 42ch;
  text-wrap: pretty;
}

.project__title {
  font-weight: inherit;
  color: var(--amber);
}

.project__note {
  margin: clamp(22px, 2.6vw, 32px) 0 0;
  color: var(--bone-dim);
  max-width: 50ch;
  text-wrap: pretty;
}

.spec {
  margin: clamp(26px, 3vw, 38px) 0 0;
  /* Keep the values off the spine. */
  padding-right: clamp(14px, 1.8vw, 28px);
  border-top: 1px solid var(--wire);
}

.spec > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--wire);
}

.spec dt { color: var(--bone-faint); }
.spec dd { margin: 0; color: var(--bone); text-align: right; }

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--amber);
  vertical-align: middle;
}

/* --- Studio -------------------------------------------------------------- */

.studio__lede {
  margin: 0;
  font-size: clamp(1.1rem, 1.3vw + 0.8rem, 1.45rem);
  line-height: 1.46;
  max-width: 44ch;
  text-wrap: pretty;
}

.studio__body {
  margin: clamp(20px, 2.4vw, 28px) 0 0;
  color: var(--bone-dim);
  max-width: 48ch;
}

/* --- Contact ------------------------------------------------------------- */

.contact {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--wire);
}

.contact li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px clamp(16px, 3vw, 40px);
  padding: clamp(16px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--wire);
}

.contact__label {
  flex: 0 0 auto;
  min-width: 76px;
  color: var(--bone-faint);
}

.contact__link {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 108%;
  font-size: clamp(1.05rem, 1.1vw + 0.8rem, 1.4rem);
  text-decoration: none;
  border-bottom: 1px solid var(--wire);
  padding-bottom: 2px;
  transition: color 160ms ease, border-color 160ms ease;
}

.contact__link:hover,
.contact__link:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}

/* --- Footer -------------------------------------------------------------- */

.footer { padding-block: 28px; }

.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

/* --- Reveal -------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 620ms cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 620ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

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

@media (max-width: 860px) {
  .hero__tally,
  .hero__lede,
  .band__rail,
  .band__body { grid-column: 1 / -1; }

  .wordmark__line--shift { margin-left: 0; }

  .hero__lede,
  .project__lede,
  .studio__lede { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
