:root {
  --bg: #fff;
  --text: #000;
  --muted: #a8a6a1;
  --footer-bg: #000;
  --footer-text: #fff;
  --gutter: clamp(16px, 3vw, 30px);
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* Header */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px var(--gutter);
}
.site-nav { display: flex; gap: 1.1em; font-size: 15px; }
.site-nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: currentColor; }
.logo img { height: 57px; width: auto; }
.social { justify-self: end; display: flex; padding: 4px; }
.social:hover { opacity: .6; }

/* Work grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
  padding: 30px var(--gutter) 60px;
}
.tile { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: #eee; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }

/* Project pages */
.project--grey { background: #dfe0e1; }
.project-head { max-width: 600px; margin: 0 auto; padding: 50px var(--gutter) 30px; text-align: center; }
.project-head h1 { margin: 0 0 .9em; font-size: clamp(26px, 3.4vw, 36px); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.project-desc { margin: 0; font-size: 14px; }
.project-images { display: flex; flex-direction: column; align-items: center; gap: var(--gutter); padding: 10px var(--gutter) 30px; }
.project-images img { max-width: min(100%, 950px); max-height: 92vh; width: auto; }
.pager {
  display: flex; justify-content: space-between; gap: 2em;
  padding: 30px var(--gutter) 40px;
  font-size: clamp(18px, 2.4vw, 26px); line-height: 1.2;
}
.pager a { display: flex; align-items: center; gap: .8em; text-decoration: none; max-width: 45%; }
.pager .next { text-align: right; }
.pager a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.pager svg { flex: none; }

/* About */
.about { max-width: 420px; margin: 0 auto; padding: 30px var(--gutter) 80px; font-size: 14px; }
.portrait { width: 150px; margin: 0 auto 18px; }
.about h1 { font-size: 16px; font-weight: 500; text-align: center; margin: 0 0 .6em; }
.about p { margin: 0 0 1.2em; }

/* Contact / 404 */
.contact { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px var(--gutter); font-size: 14px; }
.contact p { margin: 0 0 1.4em; }
.email { font-size: clamp(20px, 3.6vw, 32px); text-decoration: none; overflow-wrap: anywhere; }
.email:hover { text-decoration: underline; text-underline-offset: 5px; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); text-align: center; padding: 40px var(--gutter); font-size: 14px; }
.site-footer nav { display: flex; justify-content: center; gap: .6em; margin-bottom: 1.6em; }
.site-footer nav a { text-underline-offset: 3px; }
.site-footer p { margin: 0; font-size: 12px; }

@media (max-width: 640px) {
  .site-header { grid-template-columns: 1fr auto; row-gap: 12px; padding-top: 18px; }
  .logo { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .logo img { height: 44px; }
  .site-nav { grid-row: 2; }
  .social { grid-row: 2; }
  .grid { grid-template-columns: 1fr; padding-top: 16px; }
  .project-head { padding-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile img { transition: none; }
}
