/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --paper: #FFFFFF;
  --ink: #111111;
  --ink-soft: #8A8A8A;
  --placeholder: #DCE7F5;
  --line: #ECECEC;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --gutter: 10px;
  --tile-w: 220px;
  --col-gap: 50px;
  --row-gap: 72px;
  --nav-h: 150px;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: arial;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1 { margin: 0; }
p { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.wrap {
  max-width: calc(3 * var(--tile-w) + 2 * var(--col-gap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ==========================================================================
   Wordmark — centered, stacked logotype
   ========================================================================== */
.logo-container {
  width: 100%;
  text-align: center;
  padding: 24px 0 40px;
}
.logo {
  display: inline-block;
  width: 150px;
  max-width: 40vw;
  height: auto;
}

/* ==========================================================================
   Work grid — infinite, three across
   ========================================================================== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--tile-w));
  justify-content: center; /* centers the columns as a block within .wrap */
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
  padding-bottom: clamp(120px, 20vw, 220px); /* keeps last row clear of the fixed nav scrim */
}
.work-tile {
  display: block;
  width: var(--tile-w); /* fixed — never scales */
}
.work-frame {
  width: var(--tile-w);
  aspect-ratio: 4 / 5.4;
  background: var(--placeholder);
}
.work-caption { margin-top: 14px; }
.work-caption .title {
  display: block;
  font-size: 15px;
  color: var(--ink);
}
.work-caption .year {
  display: block;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Force exactly 2 columns below 900px, instead of letting auto-fit
   decide — auto-fit was dropping straight to 1 column earlier than
   you wanted. */
@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, var(--tile-w));
    justify-content: center;
  }
}

/* Tighten the gaps once things get narrower than 900px. */
@media (max-width: 900px) {
  .work-grid {
    column-gap: 28px;
    row-gap: 48px;
  }
}

/* Below 520px, tiles switch from fixed 220px to fluid — this is
   what lets 2 columns fit on a real phone screen without
   overflowing, matching your reference site. */
@media (max-width: 520px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
  }
  .work-tile { width: auto; }
  .work-frame { width: 100%; }
}

/* ==========================================================================
   Fixed bottom nav with gradient scrim
   ========================================================================== */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-h);
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.85) 55%, rgba(255,255,255,1) 85%);
  pointer-events: none;
  z-index: 10;
}
.site-footer .footer-inner {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 30px 23px; /* single source now — was fighting with a duplicate padding-bottom line */
}
.site-footer a {
  pointer-events: auto;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  position: relative;
}
.site-footer a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.site-footer a:hover::after,
.site-footer a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ==========================================================================
   HOME BUTTON
   ========================================================================== */
.home-link {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}
.home-icon {
  display: block;
  height: 35px;
  width: auto;
  padding-bottom: 10px;
}
.home-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.home-link:hover::after,
.home-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}