:root {
  --bg: #0a0a0a;
  --bg-raised: #131313;
  --fg: #f4f2ec;
  --fg-dim: #9a9890;
  --line: #2a2a28;
  --cover-yellow: #e8b920;
  --cover-yellow-fg: #1e3a1e;
  --cover-blue: #1b2a6b;
  --cover-red: #b8362a;
  --cover-olive: #8a8b3d;
  --display: "Archivo Black", Impact, sans-serif;
  --body: "Space Grotesk", Arial, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --gutter: clamp(20px, 4.5vw, 68px);
  --home-grid-columns: 2;
  --home-card-aspect: 14 / 9;
  --home-hero-height: 100svh;
  --contact-height: 68vh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible,
.project-card:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -6px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font: 500 12px/1 var(--mono);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px var(--gutter);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 94%, transparent), transparent);
}

.site-nav {
  display: flex;
  gap: clamp(18px, 2vw, 32px);
  justify-self: start;
}

.site-nav a,
.scroll-cue,
.contact-kicker,
footer {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.site-nav a {
  position: relative;
  padding-block: 4px;
  font-size: 12px;
  font-weight: 500;
}

.site-nav a::after,
.email::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  width: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transition: width 240ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.email:hover::after,
.email:focus-visible::after {
  right: auto;
  left: 0;
  width: 100%;
}

.brand {
  justify-self: center;
  font-family: var(--display);
  font-size: clamp(15px, 1.6vw, 20px);
  letter-spacing: 0.04em;
}

.header-spacer {
  width: 100%;
}

.hero {
  position: relative;
  display: flex;
  min-height: var(--home-hero-height);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 72px;
  text-align: center;
}

.hero::before {
  position: absolute;
  inset: 16% 20%;
  z-index: 0;
  background: radial-gradient(circle, rgba(244, 242, 236, 0.05), transparent 67%);
  content: "";
  pointer-events: none;
}

.hero-kicker {
  position: relative;
  margin-bottom: 16px;
  color: var(--fg-dim);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero h1 {
  position: relative;
  max-width: 16ch;
  font-family: var(--display);
  font-size: clamp(3rem, 8.3vw, 7.6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  white-space: pre-line;
}

.scroll-cue {
  position: absolute;
  bottom: clamp(28px, 5vh, 54px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--fg-dim);
  font-size: 10px;
}

.scroll-bar {
  width: 1px;
  height: 34px;
  background: var(--fg-dim);
  animation: pulse 1.8s ease-in-out infinite;
  transform-origin: top;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.35);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

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

.project-card {
  position: relative;
  aspect-ratio: var(--home-card-aspect);
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: default;
  isolation: isolate;
}

body[data-home-columns="1"] .project-card,
body[data-home-columns="2"] .project-card:nth-child(2n),
body[data-home-columns="3"] .project-card:nth-child(3n) {
  border-right: 0;
}

.project-cover,
.project-overlay {
  position: absolute;
  inset: 0;
}

.project-cover {
  display: flex;
  align-items: flex-end;
  padding: clamp(22px, 3.1vw, 48px);
  background-position: center;
  background-size: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-cover.has-image > :is(.project-tag, h2) {
  display: none;
}

.project-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover-image[hidden] {
  display: none;
}

.cover-yellow {
  background: var(--cover-yellow);
  color: var(--cover-yellow-fg);
}

.cover-blue {
  background: var(--cover-blue);
}

.cover-red {
  background: var(--cover-red);
}

.cover-olive {
  background: var(--cover-olive);
}

.project-cover h2 {
  max-width: 80%;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.2vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.project-tag {
  position: absolute;
  top: clamp(22px, 3vw, 42px);
  left: clamp(22px, 3vw, 42px);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.84;
}

.project-overlay {
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.9);
  opacity: 0;
  text-align: center;
  transition: opacity 280ms ease;
}

.project-overlay h3 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.5vw, 2.1rem);
  line-height: 1.08;
}

.project-overlay p {
  max-width: 38ch;
  margin-inline: auto;
  color: var(--fg-dim);
  font-size: clamp(12px, 1.25vw, 14px);
  line-height: 1.55;
}

.project-card:hover .project-cover,
.project-card:focus-visible .project-cover {
  transform: scale(1.035);
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-placeholder .project-cover {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  background: var(--bg-raised);
  color: var(--fg-dim);
}

.placeholder-plus {
  font-family: var(--display);
  font-size: 2rem;
}

.placeholder-label {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card.is-pending {
  opacity: 0;
  transform: translateY(26px);
}

.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms ease, transform 700ms ease;
}

.contact {
  display: flex;
  min-height: var(--contact-height);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: clamp(96px, 15vw, 180px) 24px;
  text-align: center;
}

.contact-kicker {
  color: var(--fg-dim);
  font-size: 10px;
}

.contact h2 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5.6vw, 4.75rem);
  letter-spacing: -0.025em;
}

.email {
  position: relative;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font: 400 clamp(13px, 1.7vw, 18px) / 1.4 var(--mono);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 9px;
  line-height: 1.5;
}

footer a:hover,
footer a:focus-visible {
  color: var(--fg);
}

.owner-editor-link {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.owner-editor-link:hover,
.owner-editor-link:focus-visible {
  background: var(--bg);
  color: var(--fg);
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding-block: 20px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .site-nav {
    grid-column: 2;
    justify-self: end;
  }

  .header-spacer {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3rem, 14vw, 5.6rem);
  }

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

  .project-card,
  .project-card:nth-child(2n) {
    border-right: 0;
  }

  .project-cover h2 {
    max-width: 88%;
    font-size: clamp(1.55rem, 7.4vw, 2.75rem);
  }

  .project-overlay p {
    font-size: 12px;
  }
}

@media (hover: none) {
  .project-card:not(.project-placeholder) .project-overlay {
    align-items: end;
    justify-items: start;
    padding: 22px;
    background: linear-gradient(transparent 45%, rgba(10, 10, 10, 0.88));
    opacity: 1;
    text-align: left;
  }

  .project-card:not(.project-placeholder) .project-overlay h3 {
    margin-bottom: 5px;
    font-size: 1.05rem;
  }

  .project-card:not(.project-placeholder) .project-overlay p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .project-card.is-pending {
    opacity: 1;
    transform: none;
  }
}
