:root {
  --paper: #f1ebe0;
  --ink: #14151a;
  --muted: #5d5b57;
  --accent: #c9431f;
  --line: rgba(20, 21, 26, 0.16);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper);
  padding: 8px 14px; z-index: 50;
}
.skip:focus { left: 8px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 500 1.2rem var(--serif); text-decoration: none; letter-spacing: 0.01em; }
.top nav { display: flex; gap: clamp(14px, 3vw, 32px); font-size: 0.95rem; }
.top nav a { text-decoration: none; }

/* sections */
main > section { padding: clamp(56px, 9vw, 120px) var(--gutter); max-width: var(--max); margin: 0 auto; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 40px; }
.section-head h2 { font: 300 clamp(2rem, 4.5vw, 3.2rem)/1.05 var(--serif); margin: 0; letter-spacing: -0.01em; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }

/* hero */
.hero { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 24px; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.hero h1 {
  font: 300 clamp(3rem, 10vw, 8rem)/0.98 var(--serif);
  letter-spacing: -0.025em; margin: 0 0 28px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(1.1rem, 2vw, 1.35rem); max-width: 40ch; margin: 0 0 36px; color: #2a2a2e; }
.cta {
  align-self: flex-start; padding: 13px 26px; border: 1px solid var(--ink);
  text-decoration: none; font-weight: 500; transition: background .2s, color .2s;
}
.cta:hover { background: var(--ink); color: var(--paper); }

/* gallery */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 40px); }
.work { margin: 0; }
.open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.open img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(20, 21, 26, 0.45);
  transition: transform .35s ease;
}
.open:hover img { transform: translateY(-3px); }
figcaption { padding-top: 16px; }
figcaption h3 { font: 500 1.5rem/1.2 var(--serif); margin: 0; }
.sys { margin: 2px 0 10px; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
figcaption p { margin: 0 0 12px; font-size: 0.98rem; }
dl { margin: 0; font-size: 0.86rem; border-top: 1px solid var(--line); }
dl div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; }

/* process */
.process-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.story p { margin: 0 0 1.1em; max-width: 62ch; }
.story .links { font-size: 0.95rem; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; border-top: 1px solid var(--line); }
.steps li { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps span { font: 300 2rem/1 var(--serif); color: var(--accent); min-width: 1.6ch; }
.steps h3 { font: 500 1.2rem var(--serif); margin: 0 0 2px; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.lab { display: grid; grid-template-columns: 1fr minmax(0, 420px); gap: clamp(24px, 5vw, 64px); align-items: center; margin-top: clamp(56px, 8vw, 96px); padding: clamp(20px, 4vw, 40px); background: var(--ink); color: var(--paper); }
.lab h3 { font: 300 2rem var(--serif); margin: 0 0 8px; }
.lab p { margin: 0 0 20px; color: #cfc9bd; max-width: 40ch; }
.lab-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lab-form label { font-size: 0.85rem; letter-spacing: .12em; text-transform: uppercase; color: #cfc9bd; }
.lab-form input { width: 7rem; padding: 9px 12px; font: inherit; color: var(--paper); background: transparent; border: 1px solid #6b6a66; }
.lab-form button { padding: 9px 18px; font: inherit; font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--paper); cursor: pointer; }
.lab-form button#rand { background: transparent; color: var(--paper); border-color: #6b6a66; }
.lab-form button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
#lab { width: 100%; height: auto; aspect-ratio: 4 / 5; background: #14151a; }

/* about */
.about-body { columns: 2 340px; column-gap: clamp(28px, 5vw, 72px); }
.about-body p { margin: 0 0 1.1em; break-inside: avoid; }

/* footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 28px var(--gutter); border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted);
}
.foot p { margin: 0; }

/* viewer */
dialog {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
}
dialog::backdrop { background: rgba(14, 14, 18, 0.92); }
dialog[open] { display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 16px; }
dialog img { max-height: calc(100vh - 110px); width: auto; max-width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog p { color: #e9e3d6; margin: 10px 0 0; font: 400 1.1rem var(--serif); }
.close {
  position: fixed; top: 14px; right: 16px; z-index: 2; padding: 9px 16px; font: 500 0.9rem var(--sans);
  background: var(--paper); border: 0; cursor: pointer;
}
.close:hover { background: var(--accent); color: #fff; }

@media (max-width: 820px) {
  .process-grid, .lab { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .open img { transition: none; }
}
