@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,500;9..144,600&family=Inter:wght@400;500&display=swap');

:root {
  --bg: #f6f3ee;
  --ink: #1c1a17;
  --muted: #6f6a62;
  --accent: #c1502e;
  --line: #e2ddd3;
  --max: 68rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1rem;
}

.logo {
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.logo span { color: var(--accent); }

.site-header nav a {
  text-decoration: none;
  margin-left: 1.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.15s ease;
}
.site-header nav a:hover { color: var(--ink); }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.95;
}
.hero h1 .dot { color: var(--accent); }

.hero-sub {
  max-width: 32rem;
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: var(--muted);
}

section h2 {
  font-size: 1.9rem;
  margin-bottom: 2rem;
}

.work, .about, .contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.section-head h2 { margin-bottom: 0; }
.section-head a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  white-space: nowrap;
}
.section-head a:hover { color: var(--accent); }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.tile {
  display: block;
  background: var(--bg);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.tile:hover { background: #efe9df; }

.tile-tag {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.tile h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.tile p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.page-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 1rem;
}

.page-head h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
}

.page-head p {
  max-width: 34rem;
  margin-top: 1.25rem;
  font-size: 1.05rem;
  color: var(--muted);
}

/* Case detail pages */

.back-link {
  display: inline-block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--accent); }

.detail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.detail-tag {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1rem;
}

.detail h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  max-width: 42rem;
  margin-bottom: 0.75rem;
}

.detail-persona {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 2rem;
}

/* Lead hero image — a final project shot to open the page */
.detail-hero {
  margin: 1.5rem 0 2.75rem;
}
.detail-hero img {
  width: 100%;
  max-height: 34rem;
  object-fit: contain;
  background: #efe9df;
  display: block;
}
.detail-hero figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.detail-body p {
  max-width: 42rem;
  color: #3a362f;
  font-size: 1.05rem;
  margin: 0 0 1.2rem;
}

.detail-gallery {
  columns: 3 16rem;
  column-gap: 1.5rem;
  margin-top: 3rem;
}

.detail-gallery figure {
  margin: 0 0 1.5rem;
  break-inside: avoid;
}

.detail-gallery img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-gallery figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.detail-gallery.pages {
  columns: 2 26rem;
}

/* Uniform grid — every image the same size, fully visible (no crop) */
.detail-gallery.uniform {
  columns: unset;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
}
.detail-gallery.uniform.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}
.detail-gallery.uniform figure {
  margin: 0;
}
.detail-gallery.uniform img {
  height: 16rem;
  object-fit: contain;
  background: #efe9df;
  padding: 0.75rem;
}

/* Sub-section heading inside a case study */
.detail-subhead {
  margin: 4rem 0 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.4rem;
}
.detail-subhead + .detail-subhead-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.4rem 0 0;
  max-width: 42rem;
}
.detail-subhead + .detail-gallery,
.detail-subhead-note + .detail-gallery {
  margin-top: 2rem;
}

@media (max-width: 48rem) {
  .detail-gallery {
    columns: 1;
  }
  .detail-gallery.uniform img {
    height: 13rem;
  }
}

.about p {
  max-width: 38rem;
  font-size: 1.05rem;
}
.placeholder-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.placeholder-note code {
  background: var(--line);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.contact-link {
  display: inline-block;
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.15rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 30rem) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .site-header nav a:first-child { margin-left: 0; }
}
