:root {
  color-scheme: dark;
  --night: #142b56;
  --paper: #ead9aa;
  --gold: #d7b760;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--night);
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

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

.shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: clamp(230px, 29vw, 430px) 1fr;
}

.rail {
  min-height: 100svh;
  padding: clamp(28px, 4vw, 58px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--night);
  background: var(--paper);
  color: var(--night);
}

.rail::before,
.rail::after {
  content: "";
  position: absolute;
  z-index: 0;
  aspect-ratio: 1;
  border-radius: 50%;
}

.rail::before {
  left: 50%;
  top: 50%;
  width: clamp(180px, 19vw, 270px);
  transform: translate(-50%, -50%);
  background: var(--night);
}

.rail::after {
  left: calc(50% + clamp(25px, 3vw, 42px));
  top: calc(50% - clamp(12px, 1.5vw, 22px));
  width: clamp(155px, 16.3vw, 232px);
  transform: translate(-50%, -50%);
  background: var(--paper);
}

.brand {
  position: relative;
  z-index: 1;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(46px, 6vw, 100px);
  line-height: .79;
  letter-spacing: -.075em;
  text-transform: uppercase;
}

.rail-copy {
  position: relative;
  z-index: 4;
  grid-row: 3;
  max-width: 220px;
  margin: 0;
  font: 12px/1.5 monospace;
}

.projects {
  min-height: 100svh;
  display: grid;
  background-color: var(--night);
  background-image:
    radial-gradient(circle, #f4e5b5 0 1px, transparent 1.6px),
    radial-gradient(circle, #f4e5b5 0 .6px, transparent 1.1px),
    linear-gradient(145deg, #1c3d72, #101f42);
  background-size: 223px 181px, 137px 163px, 100% 100%;
  background-position: 17px 31px, 73px 11px, 0 0;
}

.project {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: clamp(24px, 3.4vw, 55px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--paper);
  text-decoration: none;
}

.project:hover { background: var(--paper); color: var(--night); }
.project:focus-visible { outline: 3px solid currentColor; outline-offset: -6px; }

.eyebrow { font: 12px/1 monospace; letter-spacing: .06em; }

h2 {
  margin: 8px 0 0;
  font-size: clamp(30px, 3.8vw, 66px);
  line-height: .78;
  letter-spacing: -.075em;
  text-transform: uppercase;
}

.desc { max-width: 360px; margin: 20px 0 0; font: 13px/1.45 monospace; }

.mark {
  align-self: flex-end;
  width: clamp(90px, 11vw, 175px);
  max-height: 22vh;
  filter: invert(88%) sepia(30%) saturate(530%);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .4s;
}

.mark.wide { width: clamp(170px, 20vw, 350px); }
.project:hover .mark { transform: scale(1.04) rotate(-1deg); filter: none; }
.go { display: inline-block; transition: transform .2s; }
.project:hover .go { transform: translate(7px, -4px); }

.count {
  position: absolute;
  right: 24px;
  top: 20px;
  font: 10px/1 monospace;
  letter-spacing: .18em;
  opacity: .55;
}

/* Two projects retain the original stacked composition. */
.export-grid[data-count="2"] .projects {
  grid-template: 1fr 1fr / 1fr;
  background-image:
    radial-gradient(circle, #f4e5b5 0 1.2px, transparent 1.7px),
    radial-gradient(circle, #f4e5b5 0 .7px, transparent 1.2px),
    radial-gradient(circle, var(--gold) 0 .5px, transparent 1px),
    linear-gradient(145deg, #1c3d72, #101f42);
  background-size: 223px 181px, 137px 163px, 89px 107px, 100% 100%;
  background-position: 17px 31px, 73px 11px, 29px 67px, 0 0;
}

.export-grid[data-count="2"] .project:first-child { border-bottom: 1px solid; }
.export-grid[data-count="2"] .count { display: none; }

.export-grid[data-count="2"] .project::after {
  content: "✦";
  position: absolute;
  right: 5%;
  bottom: 8%;
  color: var(--gold);
  font-size: 22px;
}

.export-grid[data-count="2"] .project:last-child::after {
  content: "✧";
  inset: 10% auto auto 48%;
}

/* Future three-to-five project grids. */
.export-grid[data-count="3"] .projects { grid-template: 1fr / repeat(3, minmax(0, 1fr)); }
.export-grid[data-count="3"] .project:not(:last-child) { border-right: 1px solid; }
.export-grid[data-count="4"] .projects { grid-template: 1fr 1fr / 1fr 1fr; }
.export-grid[data-count="4"] .project:nth-child(-n+2) { border-bottom: 1px solid; }
.export-grid[data-count="4"] .project:nth-child(odd) { border-right: 1px solid; }
.export-grid[data-count="5"] .projects { grid-template: 1fr 1fr / repeat(3, minmax(0, 1fr)); }
.export-grid[data-count="5"] .project:nth-child(-n+3) { border-bottom: 1px solid; }

.export-grid[data-count="5"] .project:nth-child(1),
.export-grid[data-count="5"] .project:nth-child(2),
.export-grid[data-count="5"] .project:nth-child(4),
.export-grid[data-count="5"] .project:nth-child(5) { border-right: 1px solid; }

.export-grid[data-count="5"] .projects::after {
  content: "THE NIGHT IS NEVER EMPTY";
  grid-column: 3;
  grid-row: 2;
  display: grid;
  place-items: center;
  padding: 30px;
  background: radial-gradient(circle at center, var(--gold) 0 2px, transparent 3px);
  background-size: 47px 47px;
  color: var(--gold);
  text-align: center;
  font: 10px/1.5 monospace;
  letter-spacing: .25em;
}

.export-grid[data-count="3"] h2,
.export-grid[data-count="5"] h2 { font-size: clamp(28px, 3.1vw, 52px); }

@media (min-width: 721px) {
  .export-grid[data-count="2"] .project {
    padding: clamp(32px, 5vw, 78px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
  }

  .export-grid[data-count="2"] .project:first-child { padding-top: 90px; }
  .export-grid[data-count="2"] h2 { font-size: clamp(46px, 7vw, 112px); line-height: .76; }
  .export-grid[data-count="2"] .mark { width: clamp(110px, 16vw, 250px); max-height: 30vh; }
  .export-grid[data-count="2"] .mark.wide { width: clamp(220px, 31vw, 540px); }
}

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }

  .rail {
    min-height: 360px;
    padding: 28px;
    border-right: 0;
    border-bottom: 1px solid;
  }

  .rail::before {
    right: 12px;
    left: auto;
    top: 54%;
    width: 140px;
    transform: translateY(-50%);
  }

  .rail::after {
    right: -2px;
    left: auto;
    top: calc(54% - 10px);
    width: 120px;
    transform: translateY(-50%);
  }

  .brand { max-width: 88%; font-size: clamp(48px, 15vw, 76px); }
  .rail-copy { margin-top: 42px; }

  .projects,
  .export-grid[data-count] .projects { min-height: 0; display: block; }

  .project {
    min-height: 50svh;
    padding: 30px 28px;
    border-right: 0 !important;
    border-bottom: 1px solid !important;
  }

  .project:last-child { border-bottom: 0 !important; }

  h2,
  .export-grid[data-count="3"] h2,
  .export-grid[data-count="5"] h2 { font-size: clamp(42px, 13vw, 68px); }

  .mark, .mark.wide { max-width: 72vw; }
  .export-grid[data-count="5"] .projects::after { display: none; }
}

@media (min-width: 721px) and (max-height: 500px) and (orientation: landscape) {
  .export-grid[data-count="2"] .mark:not(.wide) {
    width: min(16vw, 30vh);
    height: auto;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
