/*
 * IC Industrial: "Black Steel" design. One stylesheet for every page.
 * Tokens are CSS custom properties on :root; test/scripts/contrast.test.ts checks the text
 * pairs against WCAG AA (4.5:1).
 */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/barlow-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/barlow-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
}

:root {
  --color-ground: #17191c;
  --color-panel: #2b3036;
  --color-panel-alt: #333940;
  --color-text: #ecedee;
  --color-muted: #b9bec5;
  --color-body: #d6d9dd;
  --color-line: #3a4048;
  --color-field-border: #7a828c;
  --color-accent: #e0b25a;
  --color-on-accent: #17191c;
  --color-error: #ff8a80;

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: 24px;
  --section-gap: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

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

a {
  color: var(--color-text);
}
a:hover {
  color: var(--color-accent);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  text-wrap: balance;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  padding: 12px 18px;
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
  color: var(--color-on-accent);
}

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  padding: 16px 30px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: center;
}
.btn--accent {
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.btn--accent:hover {
  background: var(--color-text);
  color: var(--color-on-accent);
}
.btn--dark {
  background: var(--color-ground);
  color: var(--color-text);
}
.btn--dark:hover {
  background: var(--color-panel);
  color: var(--color-text);
}
.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.text-link {
  font-size: 17px;
  font-weight: 500;
  padding: 12px 0;
  display: inline-block;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:not(.btn) {
  display: inline-block;
  padding: 12px 0;
  text-decoration: none;
}
.site-nav a[aria-current="page"]:not(.btn) {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 6px;
}
.site-nav .btn {
  font-size: 15px;
  padding: 14px 22px;
}

/* Hero */
.hero {
  min-height: 560px;
  background:
    linear-gradient(180deg, rgba(23, 25, 28, 0) 40%, rgba(23, 25, 28, 0.55) 100%),
    repeating-linear-gradient(135deg, var(--color-panel) 0 48px, var(--color-panel-alt) 48px 50px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  gap: 20px;
}
/* With a photo (manifest.hero), the image fills the panel and a dark scrim keeps text legible. */
.hero {
  position: relative;
  overflow: hidden;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.hero:has(.hero__img)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(23, 25, 28, 0.15) 0%,
    rgba(23, 25, 28, 0.55) 45%,
    rgba(23, 25, 28, 0.94) 100%
  );
}
/*
 * Hero video (content/site.json hero.video). It sits over the still photo and under the photo's
 * gradient scrim (::before, z-index 1), invisible until public/js/hero-video.js reports that it
 * is playing. Then the video and a flat 50% shade fade in together, so with the scrim the
 * footage is darkened by at least 50% everywhere (about 58% at the top, 97% at the bottom).
 */
.hero__video,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-out;
  pointer-events: none;
}
.hero__video {
  object-fit: cover;
  object-position: center;
}
.hero__shade {
  background: rgba(23, 25, 28, 0.5);
}
.hero--video-playing .hero__video,
.hero--video-playing .hero__shade {
  opacity: 1;
}
.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero h1 {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  font-size: clamp(52px, 11vw, 104px);
  line-height: 0.92;
  letter-spacing: 0.01em;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

/* Fact strip under the hero */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-line);
  font-size: 16px;
}
.facts__lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.facts a {
  text-decoration: none;
  padding: 8px 0;
  overflow-wrap: anywhere;
}
.facts a:hover {
  text-decoration: underline;
}

/* Sections */
.section {
  padding-top: var(--section-gap);
}
.section--first {
  padding-top: 40px;
}
.section-note {
  margin-top: 28px;
}
.h3 {
  font-weight: 600;
  font-size: 30px;
}
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 32px;
}
.section--stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.section-title {
  font-size: clamp(40px, 7vw, 56px);
}
.page-title {
  font-size: clamp(48px, 10vw, 88px);
  line-height: 0.95;
}
.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-body);
  max-width: 640px;
}
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}
.split > * {
  flex: 1 1 380px;
  min-width: 0;
}
.split--center {
  align-items: center;
}
.split__title {
  flex: 1 1 300px;
}
.split__body {
  flex: 2 1 520px;
}
.prose {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.prose p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-body);
  max-width: 560px;
}

/* Photo and placeholder tiles (Home: first three, Gallery: all) */
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile {
  flex: 1 1 340px;
  min-width: 0;
  height: 440px;
  margin: 0;
  background: var(--color-panel);
  position: relative;
  overflow: hidden;
}
.tile:nth-child(even) {
  background: var(--color-panel-alt);
}
.tile--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  gap: 4px;
}
.tile__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.tile__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  text-transform: uppercase;
}
.tile__meta {
  font-size: 15px;
  color: var(--color-muted);
}
.tile--photo a {
  display: block;
  height: 100%;
}
.tile--photo a:focus-visible {
  outline-offset: -3px;
}
.tile figure {
  margin: 0;
  height: 100%;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 24px;
  background: rgba(23, 25, 28, 0.85);
  color: var(--color-text);
  font-size: 15px;
}
/* /gallery: square thumbnails in a grid; width/height attributes reserve the space. */
.tiles--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tiles--grid .tile {
  height: auto;
  aspect-ratio: 1 / 1;
}
.tiles--grid .tile--placeholder {
  aspect-ratio: 4 / 5;
}
/* Home and About: a gallery photo beside the "Since 2007" text. */
.panel-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  background: var(--color-panel);
}

/* Services list */
.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-line);
}
.service-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--color-line);
}
.service-list h3,
.service-list .h3 {
  font-weight: 600;
  font-size: 30px;
}
.service-list p {
  font-size: 16px;
  color: var(--color-muted);
}

/* Brass call-to-action block */
.cta {
  margin-top: var(--section-gap);
}
.cta__inner {
  background: var(--color-accent);
  color: var(--color-on-accent);
  padding: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.cta h2 {
  flex: 1 1 380px;
  min-width: 0;
  font-size: clamp(44px, 8vw, 60px);
  line-height: 0.95;
}
.cta__contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
}
.cta a:not(.btn) {
  color: var(--color-on-accent);
  overflow-wrap: anywhere;
}
.cta :focus-visible {
  outline-color: var(--color-on-accent);
}

/* Contact details list */
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
}
.contact-list a {
  overflow-wrap: anywhere;
}
.contact-list span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Quote form */
.quote-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-weight: 600;
}
.field__hint {
  font-size: 14px;
  color: var(--color-muted);
}
.field input,
.field textarea {
  font: inherit;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-field-border);
  border-radius: 0;
  padding: 12px 14px;
  width: 100%;
}
.field textarea {
  min-height: 180px;
  resize: vertical;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--color-accent);
}
.field [aria-invalid="true"] {
  border-color: var(--color-error);
}
.field__error {
  color: var(--color-error);
  font-size: 15px;
}
.field__error:empty {
  display: none;
}
.form-status {
  padding: 16px 20px;
  border-left: 4px solid var(--color-accent);
  background: var(--color-panel);
}
.form-status--error {
  border-left-color: var(--color-error);
}
.form-status[hidden] {
  display: none;
}
.turnstile-slot {
  min-height: 65px;
}

/* Footer */
.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--color-line);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 14px;
  color: var(--color-muted);
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a {
  color: var(--color-muted);
  display: inline-block;
  padding: 4px 0;
}
.site-footer a:hover {
  color: var(--color-accent);
}

/* Narrow screens, down to 360px */
@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --section-gap: 56px;
  }
  .site-nav {
    gap: 4px 20px;
  }
  .hero {
    min-height: 440px;
    padding: 28px 20px;
  }
  .tile {
    height: 320px;
  }
  .cta__inner {
    padding: 32px 20px;
  }
  .service-list h3,
  .service-list .h3 {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  /* No hero video: the still photo only (hero-video.js also never loads it). */
  .hero__video,
  .hero__shade {
    display: none;
  }
}
