/* Joshua ten Brink — personal site
   Palette: rainforest, sand, macaw red. Fast, responsive, no framework. */
:root {
  --forest: #132e22;
  --forest-mid: #1c4333;
  --forest-soft: #2a5a45;
  --sand: #f3ede3;
  --sand-deep: #e6dccb;
  --paper: #faf7f2;
  --ink: #1a1a17;
  --ink-soft: #4a4740;
  --macaw: #c4452d;
  --macaw-dark: #9a3420;
  --line: rgba(19, 46, 34, 0.14);
  --white: #fff;
  --shadow: 0 16px 40px rgba(19, 46, 34, 0.12);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
  --max: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--forest-soft); text-underline-offset: 0.15em; }
a:hover { color: var(--macaw); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--macaw);
  outline-offset: 3px;
}
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus {
  left: var(--pad); top: 0.5rem; z-index: 100;
  background: var(--white); padding: 0.4rem 0.8rem;
}
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--macaw);
  margin: 0 0 0.6rem;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; color: var(--forest); margin: 0 0 0.6em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 42rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem;
}
.logo img { height: 2.15rem; width: auto; }
.logo { display: flex; align-items: center; text-decoration: none; }
nav.primary { display: flex; gap: 0.15rem 1.35rem; flex-wrap: wrap; }
nav.primary a {
  color: var(--forest);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
nav.primary a:hover, nav.primary a[aria-current="page"] {
  border-bottom-color: var(--macaw);
  color: var(--forest);
}
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  border-radius: 6px; padding: 0.4rem 0.6rem;
  font: inherit; font-weight: 600; color: var(--forest); cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 52rem);
  display: grid;
  align-items: end;
  color: var(--sand);
  background: var(--forest);
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(19,46,34,0.15) 0%, rgba(19,46,34,0.25) 40%, rgba(19,46,34,0.82) 100%);
}
.hero .content { position: relative; z-index: 1; padding: clamp(3rem, 10vw, 6rem) 0 3.25rem; }
.hero h1 { color: var(--sand); margin-bottom: 0.35em; }
.hero .lede { color: var(--sand); opacity: 0.95; }
.hero-credit {
  position: relative; z-index: 1;
  font-size: 0.8rem; padding: 0 0 1rem;
}
.hero-credit a { color: var(--sand); }

/* Sections */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
section.alt { background: var(--sand); }
section.forest { background: var(--forest); color: var(--sand); }
section.forest h2, section.forest h3 { color: var(--sand); }
section.forest a { color: #f0c9b0; }
.section-head { margin-bottom: 2rem; max-width: 40rem; }

/* Cards / pillars */
.grid-3, .grid-projects, .grid-2 {
  display: grid;
  gap: 1.25rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-projects { grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
.card, .pillar, .project {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6);
  display: flex; flex-direction: column;
}
.pillar img, .project img, .photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.pillar .body, .project .body, .card .body { padding: 1.15rem 1.2rem 1.35rem; flex: 1; display: flex; flex-direction: column; }
.pillar h2, .project h3 { margin-bottom: 0.4rem; }
.card p:last-child, .project p:last-child { margin-bottom: 0; }
.meta { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-bottom: 0.35rem; }
.btn, .btn-secondary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: auto; padding: 0.7rem 1.15rem;
  border-radius: 999px; text-decoration: none; font-weight: 600;
  width: fit-content;
}
.btn { background: var(--macaw); color: var(--white); }
.btn:hover { background: var(--macaw-dark); color: var(--white); }
.btn-secondary { background: transparent; color: var(--forest); border: 1px solid var(--forest); }
.btn-secondary:hover { background: var(--forest); color: var(--sand); }
.hero .btn { margin-top: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }

/* Photo mosaic */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.mosaic a, .mosaic figure { margin: 0; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; border-radius: 10px; }
.mosaic .wide { grid-column: span 2; }
.mosaic .wide img { aspect-ratio: 2/1; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.photo-card figcaption {
  font-size: 0.9rem; color: var(--ink-soft);
  padding: 0.65rem 0.15rem 0;
}
.photo-card { margin: 0; }
.credit { font-size: 0.92rem; color: var(--ink-soft); margin-top: 1.25rem; }

/* About / prose */
.prose { max-width: 42rem; }
.prose p { font-size: 1.08rem; }
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}
.split img { border-radius: 14px; width: 100%; }

/* Contact */
.contact-block {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
}
.phone {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.phone:hover { color: var(--macaw); }
.social { display: flex; gap: 1rem; }
.social a { font-weight: 600; text-decoration: none; }

/* Footer */
.site-footer {
  background: var(--forest);
  color: var(--sand);
  padding: 2.5rem 0 2rem;
  font-size: 0.95rem;
}
.site-footer a { color: var(--sand); }
.site-footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; }
.site-footer small { display: block; opacity: 0.8; margin-top: 1.25rem; }

/* Domain logos */
.logo-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin: 1rem 0 1.5rem; }
.logo-row img { max-height: 64px; width: auto; }

/* Page hero compact */
.page-hero {
  background: var(--forest);
  color: var(--sand);
  padding: clamp(3.5rem, 10vw, 6rem) 0 3rem;
  position: relative;
  overflow: hidden;
}
.page-hero img.bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.38;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1, .page-hero .lede { color: var(--sand); }

@media (max-width: 900px) {
  .grid-3, .grid-2, .split { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: inline-flex; }
  nav.primary {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 0.5rem var(--pad) 1rem;
    gap: 0;
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
