/* "Workshop" theme — dark espresso surfaces, cream text, cognac accent.
   Contrast (WCAG): text #efe4d2 vs bg 14.8:1 / surface-2 12.6:1; muted #b3a28c ≥ 6.0:1 on every surface;
   accent #c4874a vs bg 6.1:1 (≥ 4.9:1 on inputs); button text #17120e on accent 6.1:1;
   error #f28b7d ≥ 6.2:1; input borders #7a6754 ≥ 2.8:1 (≥ 3.2:1 on surface). */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/fraunces-400-italic.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #17120e;
  --surface: #221a14;
  --surface-2: #2a211a;
  --field: #2f251d;
  --text: #efe4d2;
  --muted: #b3a28c;
  --placeholder: #a39079;
  --accent: #c4874a;
  --accent-hover: #d39a5e;
  --accent-text: #17120e;
  --border: #3a2e24;
  --border-strong: #7a6754;
  --ring: #d5c4ad;
  --error: #f28b7d;
  --success: #9fd18f;
  --radius: 10px;
  --laser-font: Georgia, 'Times New Roman', serif;
  --display-font: 'Fraunces', Georgia, 'Times New Roman', serif;
  --page-max: 1100px;
  --gutter: max(16px, calc((100% - var(--page-max)) / 2));
}

html { scroll-padding-bottom: 96px; scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
h1, h2, h3, .display { font-family: var(--display-font); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--placeholder); opacity: 1; }

/* Buttons */
.btn-primary {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-small { padding: 7px 14px; font-size: 0.9rem; white-space: nowrap; }

/* Header & footer */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--gutter); border-bottom: 1px solid var(--border); background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display-font); font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn-primary) { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.site-nav a:not(.btn-primary):hover { color: var(--accent-hover); }
@media (max-width: 600px) {
  .site-nav a:not(.btn-primary) { display: none; }
  .brand { font-size: 1rem; }
}
@media (max-width: 380px) {
  .brand .brand-name { max-width: 9.5em; line-height: 1.2; }
}

.site-footer {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 64px; padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem;
}
.site-footer img { width: 24px; height: auto; opacity: 0.85; }
.site-footer .copy { margin-left: auto; }
.site-footer p { margin: 0; }

main { max-width: var(--page-max); margin: 0 auto; padding: 0 16px; }

/* ---------- Home ---------- */
main.home { max-width: none; padding: 0; }
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: 72px; }
.section > h2, .section-head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 8px; }
.section-lead { color: var(--muted); margin: 0 0 28px; max-width: 60ch; }

.hero { position: relative; display: flex; align-items: flex-end; min-height: 70vh; overflow: hidden; background: #0d0a08; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(13, 10, 8, 0.96) 0%, rgba(13, 10, 8, 0.7) 38%, rgba(13, 10, 8, 0.15) 75%, rgba(13, 10, 8, 0.3) 100%),
    linear-gradient(to right, rgba(13, 10, 8, 0.75) 0%, rgba(13, 10, 8, 0) 65%);
}
.hero-body { position: relative; z-index: 1; width: 100%; padding-top: 120px; padding-bottom: 56px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.8rem); margin: 0 0 14px; max-width: 15ch; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5); }
.hero p { font-size: clamp(1.05rem, 2.2vw, 1.25rem); margin: 0 0 26px; max-width: 46ch; color: var(--text); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.text-link { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.text-link:hover { color: var(--accent-hover); }
@media (max-width: 600px) {
  .hero { min-height: 520px; min-height: 78svh; max-height: 640px; }
  .hero > img { object-position: 45% 50%; }
  .hero-body { padding-bottom: 40px; }
}

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 24px; }
.step-n { display: block; font-family: var(--display-font); font-weight: 600; font-size: 2.4rem; line-height: 1; color: var(--accent); margin-bottom: 12px; }
.steps h3 { font-size: 1.25rem; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--muted); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }

/* Design cards */
.grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card-photo { overflow: hidden; aspect-ratio: 3 / 2; background: #0d0a08; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card-body { padding: 18px 20px 22px; }
.card h3 { font-size: 1.45rem; margin: 0 0 6px; }
.card-type, .design-type { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card .card-type { margin: 0 0 2px; }
.card p { margin: 0 0 14px; color: var(--muted); }
.card .more { color: var(--accent); font-weight: 600; }
.card:hover, .card:focus-visible { color: inherit; border-color: #5a4636; transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); }
.card:hover img, .card:focus-visible img { transform: scale(1.04); }
.card:hover .more { color: var(--accent-hover); }

/* Materials */
.materials { display: grid; gap: 16px; }
.material { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.material h3 { font-size: 1.3rem; margin: 0 0 4px; }
.material p { margin: 0; color: var(--muted); max-width: 70ch; }
.material .use { color: var(--text); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.chips:empty { display: none; }
.mchip {
  display: block; width: 26px; height: 26px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(239, 228, 210, 0.35);
}
.thread-line { margin-top: 4px; }

/* About */
.about { display: grid; gap: 28px; align-items: start; }
.about-logo { width: 96px; height: auto; opacity: 0.9; }
.about-text { max-width: 62ch; }
.about-text .lede { font-family: var(--display-font); font-style: italic; font-weight: 400; font-size: 1.35rem; line-height: 1.4; margin-top: 0; }
.about-text p { margin: 0 0 16px; }
.about-text .how-title { font-weight: 600; margin-bottom: 8px; }
.how-steps { margin: 0 0 20px; padding-left: 1.4em; }
.how-steps li { margin: 0 0 10px; padding-left: 4px; }
.how-steps li::marker { color: var(--accent); font-weight: 700; }
.about-text .sign { font-family: var(--display-font); font-style: italic; font-size: 1.2rem; color: var(--accent); }
@media (min-width: 760px) {
  .about { grid-template-columns: 160px 1fr; gap: 40px; }
  .about-logo { width: 140px; }
}

/* ---------- Design page ---------- */
.design-layout { display: block; }
.gallery { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 16px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.gallery img { flex: 0 0 85%; min-width: 0; max-width: 520px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); scroll-snap-align: start; }
.gallery img:only-child { flex-basis: 100%; }
.intro h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 20px 0 6px; }
.intro .design-type { margin: 20px 0 0; }
.intro .design-type + h1 { margin-top: 2px; }
.intro p { color: var(--muted); margin-top: 0; }

@media (min-width: 900px) {
  .design-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 28px; }
  .design-media { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
  .gallery { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; margin-top: 0; }
  .gallery img { flex: 1 1 0; min-width: 0; max-width: none; }
  .gallery img:first-child { flex-basis: 100%; }
  .gallery img:nth-child(2):last-child { aspect-ratio: 16 / 9; }
  .intro h1 { margin-top: 0; }
}

fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 16px; padding: 14px 18px 18px; min-width: 0; }
legend { font-family: var(--display-font); font-weight: 600; font-size: 1.1rem; padding: 0 6px; }
legend .step-num { color: var(--accent); }
legend .opt { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.opt, .hint { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.line-group h3 { font-family: inherit; margin: 10px 0 8px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; text-align: center; font-size: 0.85rem; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.chip { width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(239, 228, 210, 0.4); background-size: cover; background-position: center; transition: box-shadow 0.15s ease; }
.swatch:hover .chip { border-color: rgba(239, 228, 210, 0.75); }
.swatch input:checked + .chip { border-color: var(--surface); box-shadow: 0 0 0 3px var(--accent); }
.swatch input:checked ~ span:last-child { color: var(--text); font-weight: 600; }
.swatch input:focus-visible + .chip { outline: 3px solid var(--ring); outline-offset: 4px; }
.swatch.is-out { opacity: 0.4; cursor: not-allowed; }
.swatch.is-out:hover .chip { border-color: rgba(239, 228, 210, 0.4); }
.swatch em { display: block; font-size: 0.75rem; }

label { display: block; margin: 8px 0; }
input[type='text'], input[type='email'], input[type='tel'], input:not([type]), textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--field); color: var(--text);
}
input[type='text']:focus, input[type='email']:focus, input[type='tel']:focus, input:not([type]):focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
[aria-invalid='true'] { border-color: var(--error) !important; }
input[type='radio'], input[type='checkbox'] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
label.radio, label.toggle { display: flex; gap: 10px; align-items: center; }
.row { display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr; }

.laser-preview {
  margin-top: 10px; padding: 14px 16px; border-radius: 8px; min-height: 56px;
  background: linear-gradient(135deg, #c69a6c 0%, #b8885a 55%, #a87a4e 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.25);
}
.laser-preview span { font-family: var(--laser-font); font-size: 1.4rem; color: #2a1408; text-shadow: 0 1px 0 rgba(255, 240, 220, 0.3); letter-spacing: 0.04em; }

.estimate { position: sticky; bottom: 0; z-index: 2; background: var(--surface-2); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45); }
.estimate p { margin: 2px 0; }
.estimate .includes { color: var(--muted); font-size: 0.9rem; }
.estimate .total { font-family: var(--display-font); font-size: 1.35rem; font-weight: 600; color: var(--text); }
.estimate .total:empty { display: none; }
.estimate .fine { color: var(--muted); font-size: 0.85rem; }

.err { color: var(--error); margin: 4px 0 0; font-size: 0.9rem; }
.err:empty { display: none; }
.submit { width: 100%; padding: 14px; margin: 12px 0 24px; font: inherit; font-weight: 700; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); cursor: pointer; transition: background-color 0.15s ease; }
.submit:hover:not(:disabled) { background: var(--accent-hover); }
.submit:disabled { opacity: 0.6; cursor: wait; }
#turnstile { margin: 12px 0; }
.thanks { padding: 48px 0; max-width: 60ch; }
.thanks h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .estimate { padding: 6px 12px; margin: 8px 0; }
  .estimate .includes, .estimate .fine { display: none; }
  .estimate p { margin: 0; font-size: 0.9rem; }
  .estimate .total { font-size: 1.1rem; }
}

/* ---------- Landing ---------- */
.showcase { display: grid; gap: 24px; align-items: start; }
.showcase-photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.showcase-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.showcase-text h3 { font-size: 1.6rem; margin: 2px 0 8px; }
.showcase-text p { color: var(--muted); margin: 0 0 12px; max-width: 60ch; }
.showcase-text .card-type { margin: 0; }
@media (min-width: 900px) { .showcase { grid-template-columns: 3fr 2fr; gap: 40px; } }
.waitlist { max-width: 560px; }
.thanks-note { font-family: var(--display-font); font-style: italic; font-size: 1.35rem; max-width: 50ch; }
.signin .submit { max-width: 320px; }
.lead-time { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .card:focus-visible { transform: none; }
  .card:hover img, .card:focus-visible img { transform: none; }
}
