/* Tamburri Fabrication: Night Shift (Cinematic Dark)
   Palette and every visual decision trace to DESIGN_THESIS.md */

:root {
  /* Brand colors (photo-sampled, see thesis) */
  --gun-bluing: #0F1114;
  --mill-shadow: #1B1E23;
  --arc-white: #E8F1FA;
  --brushed-steel: #A7ADB5;
  --spark-amber: #F2892C;
  --torch-smoke: #3FA98E;

  /* Applied roles */
  --bg-base: var(--gun-bluing);
  --bg-surface: var(--mill-shadow);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-primary: var(--arc-white);
  --text-secondary: var(--brushed-steel);
  --text-dim: rgba(167, 173, 181, 0.78);
  --accent-hot: var(--spark-amber);
  --accent-interact: var(--torch-smoke);
  --seam-steel: #3A4048;

  /* Typography */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --text-hero: clamp(2.4rem, 6.5vw + 0.9rem, 5.6rem);
  --text-section: clamp(2rem, 3.5vw + 1rem, 3.75rem);
  --text-plate-title: 1.25rem;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-tag: 0.72rem;
  --leading-display: 0.95;
  --leading-body: 1.6;

  /* Spacing and layout */
  --space-section: clamp(4rem, 3rem + 5vw, 7rem);
  --space-lg: 2rem;
  --space-md: 1rem;
  --space-sm: 0.5rem;
  --max-page: 1200px;
  --radius: 8px;
  --seam-width: 18px;

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --duration-reveal: 600ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { color: var(--text-primary); }

a { color: var(--accent-interact); }

:focus-visible {
  outline: 2px solid var(--accent-interact);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-hot);
  color: var(--gun-bluing);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Spec tags (grafted signature detail) ---------- */

.spec-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.spec-tag > span::before { content: "/ "; color: var(--seam-steel); }
.spec-tag > span:first-child::before { content: ""; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(15, 17, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--gun-bluing); }
}

.brand-tag {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  line-height: 1.2;
}
.brand-tag__logo {
  width: 42px;
  height: auto;
  flex: none;
}
.brand-tag__text { display: flex; flex-direction: column; }
.brand-tag__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.brand-tag__loc {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}
.site-nav a:hover { color: var(--accent-interact); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--duration-reveal) var(--ease-standard), box-shadow var(--duration-reveal) var(--ease-standard);
}
.btn--primary {
  background: var(--accent-hot);
  color: #17191B;
  box-shadow: 0 0 24px rgba(242, 137, 44, 0.25);
}
.btn--primary:hover { box-shadow: 0 0 36px rgba(242, 137, 44, 0.45); }
.btn--ghost {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent-interact); color: var(--accent-interact); }
.btn--nav { padding: 0.55rem 1.1rem; font-size: var(--text-sm); }

.header-phone {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { color: var(--accent-interact); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: calc(92svh - 64px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Arc-light atmosphere (Cinematic Dark pack recipe): static light fields
   in the two photo hues, spark amber and arc blue. Never animated. */
.hero__atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero__atmosphere::before {
  content: "";
  position: absolute;
  left: -12%;
  top: -25%;
  width: 72vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 42%, rgba(242, 137, 44, 0.13), transparent 60%),
    radial-gradient(circle at 72% 58%, rgba(101, 155, 255, 0.11), transparent 62%);
  filter: blur(80px);
}
.hero__stage {
  position: relative;
  width: 100%;
  max-width: var(--max-page);
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 4rem) clamp(1rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-lg);
  align-items: center;
}
.hero__eyebrow { margin-bottom: 1.5rem; }
.hero__headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-hero);
  line-height: var(--leading-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.hero__headline-accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--arc-white);
}
.hero__subhead {
  margin-top: 1.4rem;
  max-width: 34rem;
  font-size: 1.05rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: 1.75rem;
}
.hero__proofline {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero__image-wrap {
  position: relative;
  height: min(72svh, 640px);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 22%;
  transform: scale(1.16);
  transform-origin: 60% 25%;
  filter: saturate(0.8) contrast(1.03) brightness(0.96);
}
.hero__image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--gun-bluing) 0%, rgba(15, 17, 20, 0.35) 30%, transparent 60%),
    linear-gradient(0deg, rgba(15, 17, 20, 0.55) 0%, transparent 35%);
}

/* ---------- The Seam (signature element) ---------- */

.seam, .section { position: relative; }

.seam {
  width: var(--seam-width);
  height: 6rem;
  margin: 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='13'%3E%3Cpath d='M2 13 A 7.5 7.5 0 0 1 16 13' fill='none' stroke='%234A525B' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: center top;
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--seam-width);
  transform: translateX(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='13'%3E%3Cpath d='M2 13 A 7.5 7.5 0 0 1 16 13' fill='none' stroke='%234A525B' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: center top;
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Sections ---------- */

.section {
  padding: var(--space-section) clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--border-default);
}
.section__head {
  position: relative;
  z-index: 1;
  max-width: var(--max-page);
  margin: 0 auto 3rem;
  background: var(--bg-base);
  padding: 0.5rem 0;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-section);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.75rem;
}
/* Heat-affected zone: the temper-color band steel shows next to a weld,
   amber through purple to blue, used as the title underline everywhere. */
.section__title::after {
  content: "";
  display: block;
  width: 5.5rem;
  height: 3px;
  margin-top: 0.9rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #F2892C 0%, #C05B3A 30%, #8A4A8F 60%, #4A5FC0 85%, #3FA98E 100%);
}
.section__title--sm { font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem); }
.section__intro {
  margin-top: 1rem;
  max-width: 40rem;
}
.inquiry-alt {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
}
.inquiry-alt a {
  color: var(--accent-interact);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ---------- Gallery ---------- */

.gallery {
  position: relative;
  z-index: 1;
  list-style: none;
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 1.25rem;
}
.gallery__item--wide { grid-column: span 2; }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--tall img { aspect-ratio: auto; height: 100%; flex: 1; }
.gallery figure {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: grayscale(0.45) sepia(0.06) hue-rotate(175deg) saturate(0.85) brightness(0.96);
  transition: filter var(--duration-reveal) var(--ease-standard);
}
/* Touch devices: reveal true color when the card scrolls into view (observer-driven) */
@media (hover: none) {
  .gallery__item.in-view img { filter: none; }
}
.gallery__item--wide img { aspect-ratio: 8 / 3; }
.gallery figure:hover img,
.gallery figure:focus-within img { filter: none; }
.gallery figcaption {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border-default);
}
.spec-tag__note {
  flex-basis: 100%;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}
.spec-tag__note::before { content: "" !important; }

/* ---------- Capability plates ---------- */

.plates {
  position: relative;
  z-index: 1;
  list-style: none;
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.plate {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.75rem;
}
/* Tack welds: the two small beads that hold a plate before final weld-out */
.plate::before,
.plate::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D3DAE1, #666D75 72%);
}
.plate::before { top: 9px; left: 9px; }
.plate::after { bottom: 9px; right: 9px; }
.plate--feature { grid-column: 1 / -1; }
.plate--feature p { max-width: 60ch; }
.plate a { color: var(--accent-interact); }

.commercial__cta {
  position: relative;
  z-index: 1;
  max-width: var(--max-page);
  margin: 2.25rem auto 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: var(--bg-base);
  padding: 0.5rem 0;
}
.commercial__note {
  font-size: var(--text-sm);
  color: var(--text-dim);
  max-width: 26rem;
}
.plate h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-plate-title);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.plate p { font-size: var(--text-sm); }

/* ---------- Process steps ---------- */

.steps {
  position: relative;
  z-index: 1;
  list-style: none;
  max-width: 44rem;
  margin: 0 auto;
  background: var(--bg-base);
  padding: 0 1rem;
}
.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-default);
}
.step:last-child { border-bottom: none; }
.step__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(167, 173, 181, 0.8);
  min-width: 3.5rem;
}
/* Weld cooling sequence: numerals temper from spark amber (hot inquiry)
   through purple and blue to torch smoke (finished install). */
.step:nth-child(1) .step__num { -webkit-text-stroke-color: #F2892C; }
.step:nth-child(2) .step__num { -webkit-text-stroke-color: #E0763A; }
.step:nth-child(3) .step__num { -webkit-text-stroke-color: #C05B52; }
.step:nth-child(4) .step__num { -webkit-text-stroke-color: #9A4E7E; }
.step:nth-child(5) .step__num { -webkit-text-stroke-color: #6E55AC; }
.step:nth-child(6) .step__num { -webkit-text-stroke-color: #4A5FC0; }
.step:nth-child(7) .step__num { -webkit-text-stroke-color: #3FA98E; }
.step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.step p { font-size: var(--text-sm); }

/* ---------- Split (service area / about) ---------- */

.split {
  position: relative;
  z-index: 1;
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
.split__col > .section__title { margin: 0.75rem 0 1rem; }
.split__col { background: var(--bg-base); padding: 0.5rem 0; }

/* ---------- Inquiry form ---------- */

.section--inquiry { border-top: 1px solid var(--border-strong); }
.inquiry-form {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  background: var(--gun-bluing);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  padding: 0.7rem 0.8rem;
}
.field select { appearance: auto; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent-interact);
  outline-offset: 1px;
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #C9564A; }
.field--consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
}
.field--consent input { margin-top: 0.3rem; accent-color: var(--accent-interact); }
.field--consent label {
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.inquiry-form__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.inquiry-form__note {
  font-size: var(--text-sm);
  color: var(--text-dim);
  max-width: 24rem;
}
.form-notice {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent-hot);
  border-radius: 4px;
  background: rgba(242, 137, 44, 0.08);
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.form-notice--error { border-color: #C9564A; background: rgba(201, 86, 74, 0.08); }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem 5rem;
  border-top: 1px solid var(--border-default);
}
.seam-terminus {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.seam-terminus__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--spark-amber);
  box-shadow: 0 0 24px rgba(242, 137, 44, 0.8), 0 0 60px rgba(242, 137, 44, 0.35);
}
.site-footer__logo {
  width: min(240px, 60vw);
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  opacity: 0.95;
}
.site-footer__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.site-footer__phone { margin-top: 0.6rem; }
.site-footer__phone a {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-decoration: none;
}
.site-footer__phone a:hover { color: var(--accent-interact); }
.site-footer__legal {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Draft ribbon (cannot ship: remove at deploy gate) ---------- */

.draft-ribbon {
  position: fixed;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 60;
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0.7rem;
  background: #A63A2F;
  color: #fff;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

/* ---------- Reveal choreography (4 moments, IO-driven) ---------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--duration-reveal) var(--ease-standard), transform var(--duration-reveal) var(--ease-standard);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
/* No-JS fallback: content is never hidden without the observer */
.no-observer .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero__stage { grid-template-columns: 1fr; }
  .hero__image-wrap { height: 34svh; order: -1; }
  .hero__image-wrap::after {
    background: linear-gradient(0deg, var(--gun-bluing) 0%, rgba(15, 17, 20, 0.2) 45%, transparent 70%);
  }
  .gallery, .plates { grid-template-columns: 1fr 1fr; }
  .gallery__item--wide { grid-column: span 2; }
  .split { grid-template-columns: 1fr; }
  .section::before { left: var(--space-md); transform: none; }
  .site-header { flex-wrap: wrap; row-gap: 0.4rem; }
  .site-nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    gap: 1.1rem;
    padding-bottom: 0.2rem;
  }
}

@media (max-width: 560px) {
  .gallery, .plates, .field-grid { grid-template-columns: 1fr; }
  .gallery__item--wide { grid-column: span 1; }
  .gallery__item--wide img { aspect-ratio: 4 / 3; }
  .gallery__item--tall { grid-row: span 1; }
  .gallery__item--tall img { aspect-ratio: 4 / 3; height: auto; }
  .step { gap: 1rem; }
  .brand-tag__name { font-size: 1rem; }
  .brand-tag__logo { width: 34px; }
  .btn--nav { padding: 0.5rem 0.8rem; font-size: 0.78rem; }
  .header-phone { font-size: 0.78rem; }
}
