/* Contrast (WCAG) noted beside each pair it is used for. Walnut is reserved for interactive states. */
:root {
  color-scheme: light dark;
  --bg: #f5f1ea;
  --surface: #ece5da;
  --ink: #2f2c2b;          /* 12.3:1 on bg */
  --muted: #6e655d;        /* 5.07:1 on bg */
  --walnut: #5b3d2b;       /* 8.69:1 on bg — hover, focus */
  --line: #d9cfc1;         /* decorative dividers only */
  --field: #fbf9f5;
  --field-border: #8f8478; /* 3.25:1 on bg, 3.48:1 on field */
  --error: #9b2c1f;        /* 6.72:1 on bg */
  --band: #1f1b18;         /* photo band on project pages */
  --band-ink: #ece6dd;     /* 13.8:1 on band */
  --band-muted: #a99d90;   /* 6.4:1 on band */
  --shadow: rgba(47, 44, 43, 0.35);
  --sans: "Jost", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1916;
    --surface: #26221e;
    --ink: #ece6dd;          /* 14.1:1 */
    --muted: #a99d90;        /* 6.6:1 */
    --walnut: #c49a74;       /* 6.9:1 */
    --line: #3d3631;
    --field: #24201c;
    --field-border: #7a7064; /* 3.6:1 on bg, 3.3:1 on field */
    --error: #e8907e;        /* 7.3:1 */
    --band: #141210;         /* 15.1:1 with band-ink */
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* full-bleed photo band uses 100vw */
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--walnut); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 400; letter-spacing: 0.02em; line-height: 1.15; margin: 0; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid transparent;
  /* Full-width bar so content scrolls cleanly underneath; contents still align to --max */
  padding: 12px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 18px -14px var(--shadow); }
/* Keep in-page anchors (Work, About, Contact) clear of the sticky header */
[id] { scroll-margin-top: 88px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; transition: opacity .3s, visibility .3s; }
.brand .mark { width: 26px; height: auto; color: var(--ink); }
.brand span { font: 400 1.05rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.brand small { display: block; font-size: 0.62rem; letter-spacing: 0.32em; color: var(--muted); margin-top: 4px; }
/* Home page, wide screens: the big hero logo is the brand, so the header mark waits until it
   scrolls away. On phones the mark has its own row, and hiding it would leave a blank strip. */
@media (min-width: 521px) { .js .home .brand:not(.show) { opacity: 0; visibility: hidden; } }
.site-header nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.site-header nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 400 0.82rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
}
.site-header nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 72px;
  align-items: center;
}
.hero h1 { margin: 0; }
.hero-logo .logo { width: min(340px, 72vw); color: var(--ink); }
.tagline { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-style: italic; color: var(--muted); margin: 28px 0 0; max-width: 26ch; }
.button {
  display: inline-block; font: 400 0.82rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; padding: 16px 26px; border: 1px solid var(--ink); transition: background .2s, color .2s;
}
.button:hover { background: var(--ink); color: var(--bg); }
.hero-img { margin: 0; }
.hero-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 5fr 6fr; gap: 64px; padding-top: 40px; }
}

/* Sections */
.work, .about { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.section-title {
  font-size: 0.82rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 40px;
}
.grid { display: grid; grid-template-columns: 1fr; gap: 56px 40px; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { text-decoration: none; display: block; }
.card-img { overflow: hidden; background: var(--surface); }
.card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card:hover h3 { color: var(--walnut); }
.card-text { padding-top: 18px; }
.card-text h3 { font-size: 1.45rem; transition: color .2s; }
.card-text p { margin: 8px 0 10px; color: var(--muted); }
.card-text span { font: 400 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.prose { max-width: 62ch; }
.prose p { margin: 0 0 1em; }
.about .prose { font-size: 1.3rem; line-height: 1.55; }
.contact { font-family: var(--sans); letter-spacing: 0.04em; }

/* Project pages */
.project { max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 96px; }
.project-hero { margin: 0 0 48px; }
.project-hero a { display: block; cursor: zoom-in; }
.project-hero .g-item { background: none; overflow: visible; }
.project-hero img, .project-hero .g-item img { width: auto; max-width: 100%; max-height: 82vh; margin: 0 auto; aspect-ratio: auto; object-fit: contain; }
.project-hero .g-item:hover img { transform: none; }
.project-intro { margin-bottom: 56px; }
.project-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 24px; }
.eyebrow { font: 400 0.8rem/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }

/* Dark band behind project photos: the walnut reads warmer on a workshop-dark ground */
.photo-band {
  margin: 0 calc(50% - 50vw) 64px;
  padding: clamp(32px, 5vw, 64px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  background: var(--band); color: var(--band-ink);
}
.project-photos + .project-photos { margin-top: 48px; }
.project-photos h2, .piece h2 { font-size: 1.4rem; margin-bottom: 20px; }
.shop h2 { padding-top: 28px; border-top: 1px solid rgba(236, 230, 221, 0.16); }
.photo-band .g-item { background: rgba(255, 255, 255, 0.04); }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.g-item { display: block; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.g-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.g-item:hover img { transform: scale(1.04); }

.piece { display: grid; gap: 20px; padding: 40px 0; border-top: 1px solid var(--line); }
.piece-text p { color: var(--muted); margin: 0; max-width: 46ch; }
@media (min-width: 900px) { .piece { grid-template-columns: 1fr 2.4fr; gap: 48px; } }

.back { font-family: var(--sans); letter-spacing: 0.06em; }
.back a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.back a:hover { color: var(--walnut); }
.notfound { max-width: var(--max); margin: 0 auto; padding: 64px var(--gutter); }

/* Footer */
.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  font: 400 0.85rem/1.4 var(--sans); letter-spacing: 0.06em; color: var(--muted);
}
.site-footer p { margin: 0; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 17, 15, 0.96); color: #f5f1ea;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 140px); object-fit: contain; }
.lb-caption { margin: 0 24px; max-width: 60ch; text-align: center; font: italic 400 1.05rem/1.4 var(--serif); opacity: .9; }
.lb-caption:empty { display: none; }
.lightbox button {
  position: absolute; background: none; border: 0; color: inherit; cursor: pointer;
  font: 300 2.6rem/1 var(--sans); padding: 16px 20px; min-width: 44px; min-height: 44px; opacity: .75;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: 4px; right: 4px; }
.lb-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; margin: 0; font: 400 0.8rem/1 var(--sans); letter-spacing: .16em; opacity: .7; }
body.lb-open { overflow: hidden; }

@media (max-width: 520px) {
  .site-header { flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 4px; }
  .site-header nav { gap: 22px; }
  [id] { scroll-margin-top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Contact form */
.contact-form { display: grid; gap: 18px; max-width: 640px; margin: 8px 0 32px; }
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } .contact-form .wide, .contact-form .form-status { grid-column: 1 / -1; } }
.contact-form label { display: grid; gap: 8px; font: 400 0.78rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: 400 1.05rem/1.4 var(--serif); color: var(--ink); background: var(--field);
  border: 1px solid var(--field-border); border-radius: 0; padding: 12px 14px; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--walnut); outline-offset: 1px; border-color: var(--walnut); }
.contact-form button { justify-self: start; background: none; cursor: pointer; color: var(--ink); }
.contact-form button[disabled] { opacity: .5; cursor: wait; }
.form-status { margin: 0; font-family: var(--sans); }
.form-status.error { color: var(--error); }
.hp { position: absolute; left: -9999px; }

/* Social icons */
.social { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-left: -11px; color: var(--muted); transition: color .2s; }
.social:hover { color: var(--walnut); }
.social svg { display: block; }
.site-footer .social { margin: -11px -11px -11px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
