:root {
  color-scheme: dark;

  --paper: #0c0e0f;
  --ink: #ede6d6;
  --ink-soft: #c8c0b0;
  --muted: #8c8477;
  --rule: #343938;
  --rule-dark: #b5ab9a;
  --ghost: rgba(237, 230, 214, 0.06);
  --wrong-blue: #7e93ff;
  --wrong-pink: #ff5abc;
  --oxidized: #77c9ad;

  --measure: 64rem;
  --unit-0: 0;
  --unit-1: 0.25rem;
  --unit-2: 0.5rem;
  --unit-3: 1rem;
  --unit-4: 2rem;
  --unit-5: 4rem;
  --unit-6: 8rem;

  --font-00: 0.64rem;
  --font-0: 0.8rem;
  --font-1: 1rem;
  --font-2: 1.25rem;
  --font-3: 1.5625rem;
  --font-4: 1.953125rem;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Latin Modern Roman", "CMU Serif", "Computer Modern Serif", "STIX Two Text", "Iowan Old Style", Georgia, serif;
  font-size: 100%;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: var(--unit-0);
  min-width: 320px;
  overflow-x: hidden;
}

.reality-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 2;
  pointer-events: none;
}

body::before {
  inset: var(--unit-2);
  border: 1px solid rgba(237, 230, 214, 0.14);
}

body::after {
  top: calc(var(--unit-4) + var(--unit-1));
  right: calc(var(--unit-4) + var(--unit-1));
  width: var(--unit-2);
  height: var(--unit-2);
  background: var(--wrong-pink);
  opacity: 0.75;
  animation: phase-slip 23s steps(1, end) infinite;
}

@keyframes phase-slip {
  0%, 92%, 100% { transform: translate(0, 0); }
  93% { transform: translate(-0.25rem, 0.25rem); }
}

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

a:hover {
  color: var(--wrong-blue);
}

.chrome,
.sheet,
footer {
  position: relative;
  z-index: 1;
  width: min(100% - var(--unit-4), var(--measure));
  margin: var(--unit-0) auto;
}

.chrome {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--unit-3);
  padding: var(--unit-3) var(--unit-0);
  border-bottom: 1px solid var(--rule-dark);
}

.site-id,
.chrome nav,
.project-meta,
footer {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.site-id {
  color: var(--ink);
  font-size: var(--font-0);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.chrome nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unit-3);
  color: var(--muted);
  font-size: var(--font-00);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chrome nav a {
  text-decoration: none;
}

.sheet {
  padding: var(--unit-4) var(--unit-0) var(--unit-5);
}

.projects {
  display: grid;
}

h2,
p {
  margin: var(--unit-0);
}

h2 {
  color: var(--ink);
  font-size: var(--font-2);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule-dark);
  border-left: 1px solid var(--rule);
}

.project-card,
.contact-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(var(--unit-5), 1fr) auto;
  gap: var(--unit-2);
  min-height: calc(var(--unit-6) + var(--unit-4));
  padding: var(--unit-3);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--ghost);
  color: inherit;
  overflow: hidden;
  text-decoration: none;
}

.project-card::after,
.contact-card::after {
  content: "";
  position: absolute;
  right: var(--unit-3);
  bottom: var(--unit-3);
  width: var(--unit-3);
  height: var(--unit-3);
  border-right: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  opacity: 0.4;
}

.project-card:hover,
.contact-card:hover {
  background: rgba(126, 147, 255, 0.05);
  color: inherit;
}

.project-card:hover h2,
.contact-card:hover h2 {
  color: var(--wrong-blue);
}

.project-meta {
  color: var(--muted);
  font-size: var(--font-00);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card p,
.contact-card p {
  max-width: 28ch;
  color: var(--ink-soft);
  font-size: var(--font-1);
  line-height: 1.5;
}

.project-meta {
  color: var(--muted);
  align-self: end;
}

.contact-card p {
  color: var(--wrong-blue);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-page .project-grid {
  grid-auto-flow: dense;
}

.project-card.is-wide {
  grid-column: 1 / -1;
}

.project-card.is-compact {
  min-height: var(--unit-6);
}

.project-card.is-media,
.project-card.is-shot-gallery {
  grid-template-rows: auto auto auto;
}

.project-card .lead {
  color: var(--ink);
  font-size: var(--font-3);
  line-height: 1.2;
}

.project-card .copy-stack {
  display: grid;
  gap: var(--unit-3);
}

.project-card .copy-stack p {
  max-width: 48ch;
}

.project-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unit-2) var(--unit-3);
  margin: var(--unit-0);
  padding: var(--unit-0);
  list-style: none;
}

.project-card li {
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card li:nth-child(3n + 1) {
  color: var(--wrong-pink);
}

.project-card li:nth-child(3n + 2) {
  color: var(--wrong-blue);
}

.project-card li:nth-child(3n) {
  color: var(--oxidized);
}

.project-card img {
  display: block;
  width: 100%;
  background: #050606;
  border: 1px solid var(--rule-dark);
}

.project-card img.phone-shot,
.project-card img.carplay-shot {
  object-fit: cover;
}

.project-card img.phone-shot {
  aspect-ratio: 1179 / 2556;
  border-radius: var(--unit-3);
}

.project-card img.wide-shot,
.project-card img.carplay-shot {
  aspect-ratio: 1280 / 720;
}

.shot-gallery {
  display: grid;
  gap: var(--unit-3);
}

.shot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--unit-3);
}

.shot-frame {
  display: grid;
  margin: var(--unit-0);
  min-width: var(--unit-0);
}

.shot-row .phone-shot {
  max-width: none;
}

.carplay-frame {
  padding-top: var(--unit-3);
  border-top: 1px solid var(--rule);
}

.store-link {
  display: inline-grid;
  width: max-content;
  min-width: calc(var(--unit-6) + var(--unit-4));
  min-height: var(--unit-4);
  align-content: center;
  padding: var(--unit-2) var(--unit-3);
  border: 1px solid var(--rule-dark);
  background: var(--ink);
  color: var(--paper);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: var(--font-00);
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.store-link strong {
  display: block;
  font-size: var(--font-1);
  line-height: 1.2;
}

footer {
  padding: var(--unit-3) var(--unit-0) var(--unit-4);
  border-top: 1px solid var(--rule-dark);
  color: var(--muted);
  font-size: var(--font-00);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer p {
  margin: var(--unit-0);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--unit-3);
  margin-top: var(--unit-2);
}

footer a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 760px) {
  .chrome,
  .sheet,
  footer {
    width: min(100% - var(--unit-4), var(--measure));
  }

  .chrome {
    display: block;
  }

  .chrome nav {
    margin-top: var(--unit-2);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card,
  .contact-card {
    min-height: var(--unit-6);
  }

  .project-card.is-wide {
    grid-column: auto;
  }

  .shot-row {
    grid-template-columns: 1fr;
  }
}
