/* =========================================================
   William Spencer Smith — editorial portfolio
   Colors, type, and spacing live in :root. Change them here.
   ========================================================= */
:root {
  --bg: #faf9f6;
  --ink: #141414;
  --muted: #6e6b66;
  --line: #e3dfd8;
  --ph: #e9e5de;          /* placeholder tone */
  --ph-2: #ddd7cd;
  --accent: #141414;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p a, .link { border-bottom: 1px solid var(--line); transition: border-color .2s; }
p a:hover, .link:hover { border-color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}
h1 { font-size: clamp(48px, 8vw, 112px); }
h2 { font-size: clamp(34px, 4.5vw, 60px); }
h3 { font-size: clamp(24px, 2.4vw, 32px); }
em { font-style: italic; }

.eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede {
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.35;
  max-width: 30ch;
}
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand { font-family: var(--serif); font-size: 22px; letter-spacing: .01em; }
.nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav a {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); transition: color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Sections ---------- */
section { padding: clamp(64px, 10vw, 140px) 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; margin-bottom: clamp(32px, 5vw, 64px);
}

/* ---------- Placeholders (swap for <img> later) ---------- */
.ph {
  position: relative;
  background: linear-gradient(160deg, var(--ph) 0%, var(--ph-2) 100%);
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute; left: 14px; bottom: 12px;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(20,20,20,.45);
}
.ph > img, .frame > img { width: 100%; height: 100%; object-fit: cover; }
.r-portrait { aspect-ratio: 4 / 5; }
.r-tall { aspect-ratio: 2 / 3; }
.r-land { aspect-ratio: 3 / 2; }
.r-square { aspect-ratio: 1 / 1; }

/* ---------- Home ---------- */
.hero { padding-top: clamp(56px, 9vw, 120px); padding-bottom: clamp(40px, 6vw, 80px); }
.hero h1 .line { display: block; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 40px; margin-top: 36px;
}
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.5vw, 36px);
}
.split-card { display: block; }
.split-card .ph { aspect-ratio: 4 / 5; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.split-card .frame { overflow: hidden; }
.split-card:hover .ph { transform: scale(1.025); }
.split-card .cap {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 18px; border-bottom: 1px solid var(--line); padding-bottom: 18px;
}
.split-card .cap h2 { font-size: clamp(30px, 3.4vw, 46px); }
.arrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); transition: color .2s, transform .2s; }
.split-card:hover .arrow { color: var(--ink); transform: translateX(4px); }

.about-grid {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 96px);
}
.about-grid p { max-width: 58ch; margin: 0 0 1.1em; }

/* ---------- Work ---------- */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.project {
  display: grid;
  grid-template-columns: 64px 1.1fr 1.4fr 120px;
  gap: 24px; align-items: baseline;
  padding: 32px 0; border-bottom: 1px solid var(--line);
}
.project .num { font-family: var(--serif); font-size: 20px; color: var(--muted); }
.project p { margin: 0; color: var(--muted); max-width: 52ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 11px; letter-spacing: .06em; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.project .links { display: flex; gap: 18px; white-space: nowrap; justify-content: flex-end; }
.project .links a { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.project .links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 64px); }
.cols-3 ul { list-style: none; padding: 0; margin: 14px 0 0; }
.cols-3 li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.timeline { border-top: 1px solid var(--line); }
.timeline .row {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}

/* ---------- Modeling ---------- */
.model-hero {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.stats { width: 100%; border-collapse: collapse; margin-top: 36px; }
.stats th, .stats td {
  text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.stats th { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); width: 45%; }
.stats td { font-family: var(--serif); font-size: 22px; }

.filters { display: flex; gap: 24px; flex-wrap: wrap; }
.filters button {
  background: none; border: 0; padding: 0 0 4px; cursor: pointer;
  font: inherit; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid transparent;
}
.filters button.active, .filters button:hover { color: var(--ink); border-bottom-color: var(--ink); }

.gallery { columns: 3; column-gap: clamp(12px, 1.6vw, 24px); }
.gallery figure {
  margin: 0 0 clamp(12px, 1.6vw, 24px); break-inside: avoid; cursor: zoom-in;
}
.gallery figure.hide { display: none; }
.gallery figcaption { font-size: 12px; color: var(--muted); padding-top: 8px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(250,249,246,.97); padding: 4vw;
}
.lightbox.open { display: flex; }
.lightbox .inner { max-height: 90vh; max-width: 90vw; }
.lightbox .inner .ph { height: 82vh; aspect-ratio: 4/5; }
.lightbox img { max-height: 88vh; width: auto; }
.lightbox button {
  position: absolute; top: 20px; right: 28px; background: none; border: 0;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border: 1px solid var(--ink);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.disabled { border-color: var(--line); color: var(--muted); pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Contact / Footer ---------- */
.contact { text-align: left; }
.contact h2 { font-size: clamp(26px, 5.4vw, 76px); overflow-wrap: anywhere; }
.contact h2 a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.contact h2 a:hover { border-color: var(--ink); }
.socials { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; }
.socials a { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.socials a:hover { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 12px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split, .about-grid, .model-hero, .cols-3 { grid-template-columns: 1fr; }
  .project { grid-template-columns: 40px 1fr; }
  .project > p, .project .links { grid-column: 2; }
  .gallery { columns: 2; }
  .timeline .row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 560px) {
  .nav a.hide-sm { display: none; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; justify-content: center; height: auto; padding-top: 14px; padding-bottom: 12px; gap: 6px; }
  .brand { font-size: 20px; white-space: nowrap; }
  .nav { gap: 20px; }
  .nav a { font-size: 11px; }
  .gallery { columns: 1; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
