/* Spark Hut — site styles
   Palette: forge black, steel gray, raw-steel paper, Corten rust accent.
   Type: Arts & Crafts — Dyer Arts and Crafts (display, public domain, self-hosted)
   + Goudy Bookletter 1911 (text, Google Fonts). Both ship a single 400 weight;
   font-synthesis is off so nothing renders faux-bold.
   Dyer's lowercase glyphs are decorative alternates (e.g. i → "!"), so every
   display-font element is uppercased — see the text-transform rule below. */

@font-face {
  font-family: "Dyer Arts and Crafts";
  src: url("../fonts/dyer-arts-and-crafts.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --forge: #141414;
  --steel: #24272b;
  --steel-line: #3a3e44;
  --paper: #eceae6;
  --paper-2: #e2dfd9;
  --ink: #1a1a1a;
  --ink-soft: #55534f;
  --on-dark: #f1efeb;
  --on-dark-soft: #a9a6a0;
  --rust: #b4541e;
  --rust-hover: #9a4517;
  --rust-light: #e07a3f;   /* rust for text on dark backgrounds */
  --line: #cfcbc4;

  --font-head: "Dyer Arts and Crafts", "Palatino Linotype", Georgia, serif;
  --font-body: "Goudy Bookletter 1911", "Goudy Old Style", Georgia, serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  /* Brand lockup scales with the viewport: as large as fits, capped at 2.1rem */
  --brand-fs: clamp(1.05rem, calc((100vw - 140px) / 12.5), 2.1rem);
  --header-h: clamp(64px, calc(var(--brand-fs) * 1.9 + 20px), 86px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1c1f;
    --paper-2: #202226;
    --ink: #ebe8e3;
    --ink-soft: #a9a6a0;
    --line: #34373c;
    --rust: #c96229;
    --rust-hover: #d8733a;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--forge);
  color: var(--on-dark);
  font: 400 1.125rem/1.6 var(--font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: .03em;
  line-height: 1.05;
  margin: 0 0 .5em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }

/* Everything set in the display font is uppercase — keep this list in sync with --font-head uses */
h1, h2, h3, .kicker, .btn, .brand-name, .brand-place, .site-nav a, .chip, .tile-title,
.more-link a, .contact-list span, .hero-figure figcaption {
  text-transform: uppercase;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--rust); color: #fff; padding: 8px 14px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--rust-light); outline-offset: 3px; }

.kicker {
  font: 400 .85rem/1.2 var(--font-head);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: .9rem;
}
.rust { color: var(--rust-light); }
.lede { font-size: 1.2rem; color: var(--on-dark-soft); max-width: 34em; }
.stars { color: var(--rust-light); letter-spacing: .12em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px;
  font: 400 1.05rem/1 var(--font-head); letter-spacing: .03em;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn-rust { background: #b4541e; color: #fff; }
.btn-rust:hover { background: #9a4517; }
.btn-ghost { border-color: var(--steel-line); color: var(--on-dark); background: transparent; }
.btn-ghost:hover { border-color: var(--on-dark); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background .25s, border-color .25s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(20, 20, 20, .94); border-color: var(--steel-line); backdrop-filter: blur(8px); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
/* All brand sizes are in em of --brand-fs so the lockup scales as one piece */
.brand { display: flex; align-items: center; gap: .3em; font-size: var(--brand-fs); text-decoration: none; margin-right: auto; }
.brand-mark { width: 1.15em; height: 1.55em; flex: none; fill: var(--rust-light); }
.brand-mark-end { transform: rotate(180deg); } /* trailing bolt, turned 180° */
.brand-text { display: flex; flex-direction: column; align-items: center; gap: .14em; }
/* Negative right margins cancel the trailing letter-spacing so each line centers optically */
.brand-name { font: 400 1em/1 var(--font-head); letter-spacing: .08em; margin-right: -.08em; white-space: nowrap; }
.brand-place {
  --ls: .28em;
  font: 400 .74em/1 var(--font-head); letter-spacing: var(--ls); margin-right: calc(-1 * var(--ls));
  color: var(--rust-light);
}
/* Arts & Crafts crossed "O": the real letter stays in the text, two strokes draw the cross */
.o-cross { position: relative; display: inline-block; letter-spacing: 0; margin-right: var(--ls); }
.o-cross::before, .o-cross::after {
  content: ""; position: absolute; left: 50%; top: calc(50% + .07em); /* optical center of Dyer's O */
  background: currentColor; transform: translate(-50%, -50%);
}
.o-cross::before { width: .1em; height: .68em; }
.o-cross::after { width: .56em; height: .1em; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a:not(.btn) {
  font-family: var(--font-head); font-size: 1rem; text-decoration: none; color: var(--on-dark-soft);
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover, .site-nav a.is-active { color: var(--on-dark); border-color: var(--rust-light); }
.nav-cta { min-height: 38px; padding: 0 16px; font-size: .85rem; }
.mail-pill { display: none; }
.nav-toggle { display: none; }

/* Nav collapses earlier than other layouts because the brand lockup is wide */
@media (max-width: 1100px) {
  .mail-pill {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
    font-size: .85rem; font-weight: 600; padding: 8px 12px; border: 1px solid var(--steel-line);
  }
  .mail-pill svg { width: 16px; height: 16px; fill: var(--rust-light); }
  .nav-toggle {
    display: grid; place-items: center; width: 44px; height: 44px; order: 3;
    background: none; border: 1px solid var(--steel-line); color: var(--on-dark); cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform .2s; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; } .bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--forge); border-bottom: 1px solid var(--steel-line); padding: 8px var(--gutter) 20px;
    transform: translateY(-120%); visibility: hidden; transition: transform .25s, visibility .25s;
  }
  .site-nav.is-open { transform: none; visibility: visible; }
  .site-nav a:not(.btn) { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--steel-line); }
  .nav-cta { margin-top: 16px; min-height: 46px; }
}
@media (max-width: 900px) { .mail-pill span { display: none; } }
@media (max-width: 420px) {
  .brand-name { letter-spacing: .05em; margin-right: -.05em; }
  .brand-place { --ls: .2em; font-size: .82em; }
  .header-inner { gap: 10px; }
  .mail-pill { padding: 8px 10px; }
}
@media (max-width: 359px) { .brand-mark-end { display: none; } }

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + clamp(32px, 7vw, 88px)) 0 clamp(40px, 6vw, 72px);
  background:
    radial-gradient(ellipse 60% 70% at 85% 40%, rgba(180, 84, 30, .16), transparent 70%),
    var(--forge);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero .kicker { font-size: clamp(1.05rem, 1.8vw, 1.4rem); letter-spacing: .16em; margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.25rem, 4.8vw, 4rem); margin-bottom: .35em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.proof { font-size: .9rem; color: var(--on-dark-soft); margin: 0; }
.hero-figure { margin: 0; position: relative; }
.hero-figure img { width: 100%; border: 1px solid var(--steel-line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); }
.hero-figure figcaption {
  position: absolute; left: 0; bottom: -1px; padding: 8px 14px; background: var(--forge);
  font: 400 .8rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-soft);
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
}

/* ---------- Filmstrip ---------- */
.filmstrip { overflow: hidden; border-block: 1px solid var(--steel-line); padding: 14px 0; background: #0f0f0f; }
.filmstrip-track { display: flex; gap: 14px; width: max-content; animation: strip 60s linear infinite; }
.filmstrip:hover .filmstrip-track, .filmstrip:focus-within .filmstrip-track { animation-play-state: paused; }
.film-item { flex: none; padding: 0; border: 0; background: none; cursor: zoom-in; opacity: .82; transition: opacity .2s; }
.film-item:hover, .film-item:focus-visible { opacity: 1; }
.film-item img { height: clamp(140px, 18vw, 220px); width: auto; }
@keyframes strip { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .filmstrip { overflow-x: auto; scroll-snap-type: x mandatory; }
  .filmstrip-track { animation: none; padding-inline: var(--gutter); }
  .film-item { scroll-snap-align: start; }
  .film-item[aria-hidden="true"] { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; }
.paper, .paper-2 { color: var(--ink); }
.paper { background: var(--paper); }
.paper-2 { background: var(--paper-2); }
.steel { background: var(--steel); }
.forge { background: var(--forge); }
.paper p, .paper-2 p { color: var(--ink-soft); }
.steel .kicker, .forge .kicker { color: var(--rust-light); }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.section-head h2 { margin: 0; }
.more-link { margin: 32px 0 0; }
.more-link a { font-family: var(--font-head); color: var(--rust); text-decoration: none; border-bottom: 1px solid currentColor; }

/* ---------- Gallery ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 400 .95rem/1 var(--font-head); padding: 10px 16px; min-height: 40px; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--rust); border-color: var(--rust); color: #fff; }

.gallery { columns: 3 300px; column-gap: 20px; }
.tile { break-inside: avoid; margin: 0 0 20px; }
.tile[hidden] { display: none; }
.tile-btn { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-2); cursor: zoom-in; overflow: hidden; }
.tile-btn img { width: 100%; transition: transform .5s ease; }
.tile-btn:hover img { transform: scale(1.035); }
.tile figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px 0; border-top: 0; }
.tile-title { font: 400 1.2rem/1.15 var(--font-head); }
.tile-cat { font-size: .78rem; color: var(--ink-soft); white-space: nowrap; padding-top: 2px; }

/* ---------- Cards ---------- */
/* flex-wrap so a short last row stretches instead of leaving an empty cell */
.cards { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 36px; }
.card { flex: 1 1 200px; background: var(--paper-2); padding: 28px 24px 22px; position: relative; }
.card::before { content: ""; position: absolute; top: 0; left: 24px; width: 32px; height: 3px; background: var(--rust); }
.card p { margin: 0; font-size: 1rem; }
/* From 900px up, all five cards share one row (titles and padding shrink to fit) */
@media (min-width: 900px) {
  .cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .card { padding: 26px 20px 20px; }
  .card::before { left: 20px; }
  .card h3 { font-size: clamp(1.1rem, 1.55vw, 1.4rem); }
}

/* ---------- Process ---------- */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.steps li { border-top: 1px solid var(--steel-line); padding-top: 18px; }
.steps h3 { color: var(--rust-light); }
.steps p { color: var(--on-dark-soft); font-size: 1rem; margin: 0; }

/* ---------- About ---------- */
.about p:not(.kicker) { max-width: 40em; font-size: 1.05rem; }

/* ---------- Reviews ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 36px; }
.quotes:empty { display: none; }
.quote { margin: 0; padding: 24px 24px 20px; background: var(--paper); border-left: 3px solid var(--rust); display: flex; flex-direction: column; }
.quote blockquote { margin: 0 0 16px; flex: 1; }
.quote blockquote p { margin: 0; color: var(--ink); font-size: 1.1rem; line-height: 1.55; }
.quote figcaption { font: 400 .9rem/1.3 var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--rust); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--steel-line); }
.contact-list span { width: 80px; flex: none; font-family: var(--font-head); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-soft); padding-top: 3px; }
.contact-list a { font-weight: 600; text-decoration: none; color: var(--rust-light); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.contact-form label { display: grid; gap: 6px; font-size: .85rem; font-weight: 500; color: var(--on-dark-soft); }
.contact-form small { font-weight: 400; }
.contact-form .full { grid-column: 1 / -1; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: 1rem; color: var(--on-dark); background: var(--steel);
  border: 1px solid var(--steel-line); border-radius: 0; padding: 12px 14px; width: 100%;
}
.contact-form input[type="file"] { padding: 10px; font-size: .9rem; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--rust-light); }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-form button:disabled { opacity: .6; cursor: progress; }
.form-status { margin: 0; min-height: 1.6em; font-size: 1rem; color: var(--on-dark-soft); }
.form-status[data-state="ok"] { color: #8fc58f; }
.form-status[data-state="error"] { color: var(--rust-light); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .contact-form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--steel-line); padding: 24px 0; font-size: .85rem; color: var(--on-dark-soft); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-inner a { color: var(--on-dark-soft); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 10, 10, .96); color: var(--on-dark);
  display: none; grid-template-columns: 64px 1fr 64px; align-items: center;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 18px; max-height: 100%; padding: 56px 0 24px; }
.lb-figure img { max-width: min(100%, 1400px); max-height: calc(100vh - 220px); max-height: calc(100svh - 220px); width: auto; object-fit: contain; touch-action: pan-y; user-select: none; }
.lb-figure figcaption { max-width: 640px; text-align: center; padding: 0 8px; }
.lb-meta { display: flex; justify-content: center; gap: 16px; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rust-light); margin-bottom: 6px; }
.lb-figure h3 { margin-bottom: 6px; }
.lb-figure p:last-child { color: var(--on-dark-soft); font-size: 1.05rem; margin: 0; }
.lb-btn {
  width: 48px; height: 48px; justify-self: center; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--steel-line); color: var(--on-dark);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover { border-color: var(--on-dark); }
.lb-btn[hidden] { visibility: hidden; display: grid; }
.lb-close { position: absolute; top: 12px; right: 12px; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; }
  .lb-prev, .lb-next { position: absolute; bottom: 16px; }
  .lb-prev { left: 16px; } .lb-next { right: 16px; }
  .lb-figure { padding: 64px 12px 80px; }
}
