/* 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-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); }

.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;
}
/* ---------- Services (operator's six-item list) ---------- */

.services {
  position: relative;
  z-index: 1;
  list-style: none;
  max-width: var(--max-page);
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.25rem;
  background: var(--bg-base);
}
.service {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border-default);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.2vw + 1rem, 1.9rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}
.service__num {
  font-size: 0.8em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--spark-amber);
  flex: none;
}

/* ---------- Gallery: one tile per job, swipe inside a tile ---------- */

.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; }
.job {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.job__track {
  flex: 1;
  min-height: 0;
  aspect-ratio: 4 / 3;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.job__track::-webkit-scrollbar { display: none; }
.job__track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  filter: grayscale(0.45) sepia(0.06) hue-rotate(175deg) saturate(0.85) brightness(0.96);
  transition: filter var(--duration-reveal) var(--ease-standard);
}
.job--wide .job__track { aspect-ratio: 2 / 1; }
@media (hover: none) {
  .gallery__item.in-view .job__track img { filter: none; }
}
.job:hover .job__track img,
.job:focus-within .job__track img { filter: none; }
.job__nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  pointer-events: none;
}
.job__btn {
  pointer-events: auto;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(15, 17, 20, 0.72);
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.job__btn:hover { border-color: var(--accent-interact); color: var(--accent-interact); }
.job__btn[disabled] { opacity: 0.35; cursor: default; }
.job__count {
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  letter-spacing: 0.14em;
  color: var(--text-primary);
  background: rgba(15, 17, 20, 0.72);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}
.job figcaption {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border-default);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.job__hint {
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ---------- About ---------- */

.about {
  position: relative;
  z-index: 1;
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.about__text { background: var(--bg-base); padding: 0.5rem 0; }
.about__text .section__title { margin-bottom: 1.25rem; }
.about__text p { max-width: 36rem; }
.about__photos {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.about__photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
}

/* ---------- Contact ---------- */

.section--contact { border-top: 1px solid var(--border-strong); }
.contact {
  position: relative;
  z-index: 1;
  max-width: var(--max-page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.25rem;
  align-items: start;
}
.contact__direct { display: grid; gap: 1.25rem; }
.contact-item {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Tack welds: the two small beads that hold a plate before final weld-out */
.contact-item::before,
.contact-item::after,
.contact-form::before,
.contact-form::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D3DAE1, #666D75 72%);
}
.contact-item::before, .contact-form::before { top: 9px; left: 9px; }
.contact-item::after, .contact-form::after { bottom: 9px; right: 9px; }
.contact-item__label {
  font-family: var(--font-mono);
  font-size: var(--text-tag);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact-item__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw + 0.5rem, 3rem);
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-decoration: none;
  word-break: break-all;
}
.contact-item__value--email {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1rem, 1vw + 0.6rem, 1.25rem);
  letter-spacing: 0.04em;
}
.contact-item__value:hover { color: var(--accent-hot); }
.contact-item__actions { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.contact-item__actions .btn { flex: 1; text-align: center; }

.contact-form {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: grid;
  gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.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__optional { color: var(--text-dim); letter-spacing: 0.08em; }
.field input,
.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 textarea { resize: vertical; min-height: 7rem; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--accent-interact); outline-offset: 1px; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #C9564A; }
.contact-form__submit { justify-self: start; }
.contact-form__submit[disabled] { opacity: 0.6; cursor: default; }
.form-notice {
  margin: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--accent-interact);
  border-radius: 4px;
  background: rgba(63, 169, 142, 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);
}

/* ---------- Mobile call bar (phones only) ---------- */

.call-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  gap: 0.6rem;
  background: rgba(15, 17, 20, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-strong);
}
.call-bar__btn {
  flex: 1;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.call-bar__btn--call { background: var(--accent-hot); color: #17191B; }
.call-bar__btn--text { color: var(--text-primary); border: 1px solid var(--border-strong); }

/* ---------- 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%);
  }
  .services { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery__item--wide { grid-column: span 2; }
  .about, .contact { 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%;
    gap: 1.1rem;
    padding-bottom: 0.2rem;
  }
}

@media (max-width: 560px) {
  body { padding-bottom: 4.5rem; }
  .services, .gallery { grid-template-columns: 1fr; }
  .gallery__item--wide { grid-column: span 1; }
  .job--wide .job__track { aspect-ratio: 4 / 3; }
  .job__btn { display: none; }
  .job__nav { justify-content: flex-end; }
  .brand-tag__name { font-size: 1rem; }
  .brand-tag__logo { width: 34px; }
  .header-phone { display: none; }
  .call-bar { display: flex; }
  .draft-ribbon { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
}
