/* Moody Designs In Wood: shared styles for every page.
   Layout: tape-measure rule under the header; each page is one 1160px column of sections. */
:root {
  --bg: #eef0ea;          /* birch shaving */
  --surface: #f8f9f5;
  --fg: #1e241f;          /* pencil graphite */
  --muted: #5b645c;
  --line: #cfd4cb;
  --accent: #2b5a86;      /* chalk-line blue */
  --accent-fg: #ffffff;
  --rule: #e6c64a;        /* tape-measure yellow */
  --rule-ink: #1e241f;
  --scrim: rgba(14, 17, 15, 0.92);
  --mark-filter: none;
  --font-display: "Zilla Slab", "Rockwell", Georgia, serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.25rem, 5vw + 1rem, 3.75rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161a17; --surface: #1e2420; --fg: #e7ebe4; --muted: #9ba59c; --line: #333b35;
    --accent: #7fb0dd; --accent-fg: #0f1a24; --rule: #c9a935; --rule-ink: #161a17; --mark-filter: invert(0.92);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161a17; --surface: #1e2420; --fg: #e7ebe4; --muted: #9ba59c; --line: #333b35;
  --accent: #7fb0dd; --accent-fg: #0f1a24; --rule: #c9a935; --rule-ink: #161a17; --mark-filter: invert(0.92);
  color-scheme: dark;
}

* { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--step-0)/1.6 var(--font-body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.label { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Header */
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); color: var(--fg); text-decoration: none; }
.brand b { font-weight: inherit; }
/* Logo is black on transparent; flipped to light in dark mode */
.mark { width: 38px; height: 38px; flex: none; display: block; filter: var(--mark-filter); }
.brand span { color: var(--muted); font-weight: 500; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; }
.nav ul a { color: var(--fg); text-decoration: none; font-weight: 500; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav ul a:hover { color: var(--accent); }
.nav ul a[aria-current="page"] { border-bottom-color: var(--accent); }
.tape { height: 34px; background: var(--rule); overflow: hidden; }
.tape canvas { display: block; width: 100%; height: 34px; }

/* Page intro (inner pages) */
.intro { padding-block: 48px 40px; display: grid; gap: 14px; }
.intro p { color: var(--muted); font-size: var(--step-1); max-width: 46ch; line-height: 1.5; }

/* Hero (home) */
.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; padding-block: 56px 64px; }
.hero > * { min-width: 0; }
.hero h1 { margin-block: 12px 20px; }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 36ch; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 3px; text-decoration: none; border: 1.5px solid var(--accent); cursor: pointer; font: 600 var(--step-0) var(--font-body); }
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.ghost { background: transparent; color: var(--accent); }
.collage { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; aspect-ratio: 1 / 1; max-width: 100%; }
.collage a { background: var(--line); overflow: hidden; border-radius: 2px; min-height: 0; display: block; }
.collage a:first-child { grid-row: 1 / 3; }
.collage img { width: 100%; height: 100%; object-fit: cover; display: block; }

section { padding-block: 64px; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 52ch; }

/* What I build (home) */
.kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.kind { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.kind img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; display: block; transition: transform .25s ease; }
.kind:hover img { transform: scale(1.02); }
.kind h3 { font-size: 1.125rem; }
.kind span { color: var(--muted); font-size: 0.9375rem; }
@media (prefers-reduced-motion: reduce) { .kind img { transition: none; } }

/* Split block: photo beside text (home teaser, about, custom orders) */
.split { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 48px; align-items: start; }
.split > * { min-width: 0; }
.split > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; display: block; }
.split .body { display: grid; gap: 16px; max-width: 62ch; }
/* About: snapshot sits bottom-right, its bottom edge level with the portrait's */
.about-split { align-items: stretch; }
.about-split > img { align-self: start; }
.about-split .body { display: flex; flex-direction: column; gap: 16px; max-width: none; }
.about-split .body p { max-width: 62ch; }
/* Caption hangs below the photo without counting toward its height,
   so the photo's bottom edge can sit level with the portrait's */
.about-split .snapshot { margin-top: auto; align-self: flex-end; text-align: right; justify-items: end; position: relative; }
.about-split .snapshot figcaption { position: absolute; top: calc(100% + 8px); right: 0; }
.snapshot { margin: 12px 0 0; display: grid; gap: 6px; max-width: 100%; }
.snapshot img { width: 165px; }
.snapshot figcaption { white-space: nowrap; }
.snapshot img { height: auto; border-radius: 2px; display: block; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.snapshot figcaption { font-size: 0.875rem; color: var(--muted); font-style: italic; }
.more { font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* Call-to-action band */
.cta { background: var(--surface); }
.cta .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; }
.cta p { color: var(--muted); max-width: 52ch; margin-top: 8px; }

/* Gallery (work) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button {
  font: 500 0.9375rem var(--font-body); color: var(--fg); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filters .n { font-family: var(--font-mono); font-size: var(--step--1); opacity: .7; margin-left: 6px; font-variant-numeric: tabular-nums; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile button { padding: 0; border: 0; background: var(--line); cursor: zoom-in; border-radius: 2px; overflow: hidden; display: block; width: 100%; }
.tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.tile figcaption { font-size: 0.875rem; color: var(--muted); line-height: 1.4; }

/* Cross callout (work) */
.cross { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 32px; }
.cross > * { min-width: 0; }
/* Show the whole photo, uncropped, at its own proportions */
.cross img { width: auto; max-width: 100%; height: auto; max-height: 480px; margin-inline: auto; border-radius: 2px; display: block; }
.cross blockquote { margin: 14px 0 0; font-family: var(--font-display); font-size: 1.1875rem; line-height: 1.5; font-weight: 500; max-width: 52ch; }
.woodkey { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; }
.woodkey span { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: var(--step--1); }
.chip { width: 26px; height: 12px; border-radius: 2px; display: inline-block; }

/* Process (custom orders) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--fg); padding-top: 14px; min-width: 0; }
.steps li::before { content: "Step " counter(step); display: block; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 0.9375rem; }
.checklist { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair figure { margin: 0; display: grid; gap: 6px; min-width: 0; }
.pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; display: block; }
.pair figcaption { font-size: 0.875rem; color: var(--muted); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
.contact > * { min-width: 0; }
.contact dl { margin: 0; display: grid; gap: 14px; }
.contact dt { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.contact dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.contact dt .note { text-transform: none; letter-spacing: normal; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--surface); padding: 28px; border: 1px solid var(--line); border-radius: 3px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 500; font-size: 0.9375rem; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
fieldset.files { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.files legend { font-weight: 500; font-size: 0.9375rem; padding: 0; margin-bottom: 2px; }
fieldset.files .opt, fieldset.files .hint { color: var(--muted); font-weight: 400; }
fieldset.files .hint { font-size: var(--step--1); }
input[type="file"] { padding: 8px; font-size: 0.875rem; cursor: pointer; }
.form-note { grid-column: 1 / -1; font-size: var(--step--1); color: var(--muted); }
.form-done { grid-column: 1 / -1; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--bg); }

footer { border-top: 1px solid var(--line); padding-block: 28px; color: var(--muted); font-size: var(--step--1); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
footer a { color: var(--muted); }

/* Lightbox (work) */
dialog.lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: #f1f3ee; }
dialog.lb::backdrop { background: var(--scrim); }
.lb-inner { height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 12px; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lb-stage { min-height: 0; display: flex; align-items: center; justify-content: center; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; width: 100%; margin: 0 auto; }
.lb-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; max-width: 70ch; }
.lb-bar p { font-size: 0.9375rem; min-width: 0; }
.lb-bar #lb-cap { font-weight: 600; }
.lb-bar .lb-desc { opacity: .85; line-height: 1.45; }
.lb-bar .count { font-family: var(--font-mono); font-size: var(--step--1); opacity: .7; margin-left: 10px; }
.lb-ctrl { display: flex; gap: 8px; }
.lb-ctrl button { font: 600 0.9375rem var(--font-body); color: #f1f3ee; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: 3px; padding: 8px 14px; cursor: pointer; }

@media (max-width: 960px) {
  .kinds { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero, .split, .contact, .cross { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .split > img, .cross img { max-width: 360px; }
}
@media (max-width: 560px) {
  .kinds, .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  form { grid-template-columns: 1fr; padding: 20px; }
  .cross { padding: 20px; }
  section { padding-block: 48px; }
}
