/* Allied Rail Solutions LLC — Mobile Welding Division */

:root {
  --bg-dark: #12161b;
  --bg-steel: #1c222a;
  --bg-steel-2: #252c36;
  --bg-light: #f4f1ea;
  --bg-light-2: #ebe6dc;
  --text-light: #f4f1ea;
  --text-muted: #b7bec8;
  --text-dark: #15191e;
  --text-dark-muted: #4a525c;
  --accent: #e87747;
  --accent-hot: #f68354;
  --accent-deep: #c85d30;
  --line: #2d3540;
  --line-light: #d8d2c8;
  --header-h: 4.5rem;
  --font-display: "Oswald", "Arial Narrow", "Franklin Gothic Medium", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  --radius: 10px;
  --max: 1140px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

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

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn .icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.btn-accent {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  color: var(--bg-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(244, 241, 234, 0.45);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
}

.btn-lg {
  padding: 0.9rem 1.4rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 22, 27, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-light);
  min-width: 0;
  flex: 0 1 auto;
}

.brand-badge {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f4f1ea;
  border-radius: 50%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-wordmark {
  width: 168px;
  height: auto;
  display: block;
}

.brand-tag {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-left: auto;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-call {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-steel);
  border-radius: 6px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-light);
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  min-height: 36rem;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow: hidden;
}

.hero-media {
  grid-column: 2;
  grid-row: 1;
  min-height: 36rem;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}

.hero-overlay {
  display: none;
}

.hero-content {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3.5rem 2rem 3.5rem 5vw;
  max-width: 38rem;
  background: linear-gradient(180deg, #12161b 0%, #171c23 100%);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.12rem;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.section-head h2,
.rig-copy h2,
.area h2,
.quote-info h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
}

.section-intro,
.rig-copy p,
.area p,
.quote-info > p {
  margin: 0 0 1rem;
  color: var(--text-dark-muted);
  font-size: 1.08rem;
}

/* Services */
.services {
  background: var(--bg-light);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

.service-card {
  background: #fff;
  border: 1px solid var(--line-light);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem 1.5rem;
  box-shadow: 0 6px 18px rgba(18, 22, 27, 0.05);
}

.service-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  color: var(--accent);
  background: #f8efe8;
  border-radius: 8px;
}

.service-icon svg {
  width: 1.85rem;
  height: 1.85rem;
}

.service-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dark);
}

.service-card p {
  margin: 0;
  color: var(--text-dark-muted);
  font-size: 0.98rem;
}

/* Mobile rig */
.rig {
  background: var(--bg-dark);
  color: var(--text-light);
}

.rig-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.rig-photo img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.rig-copy .eyebrow,
.rig-copy p {
  color: var(--text-muted);
}

.rig-copy h2 {
  color: var(--text-light);
}

.rig-copy .btn {
  margin-top: 0.6rem;
}

/* About */
.about {
  background: var(--bg-light-2);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.about-photo {
  margin: 0;
}

.about-photo img {
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(18, 22, 27, 0.14);
  background: var(--bg-steel);
}

.about-portrait img {
  aspect-ratio: 3 / 4;
  object-position: center top;
}

.about-field img {
  aspect-ratio: 4 / 5;
  object-position: center 20%;
}

.about-photo figcaption {
  margin-top: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark-muted);
  text-align: center;
}

.about-copy .btn {
  margin-top: 0.5rem;
}

/* Gallery */
.gallery {
  background: var(--bg-light);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}

.work-subhead {
  margin: 2.4rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.railing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.railing-grid .gallery-card.is-photo img,
.railing-grid .gallery-zoom img {
  aspect-ratio: 4 / 3;
}

.photo-rail-porch { object-position: center 55%; }
.photo-rail-steps { object-position: center 50%; }

.gallery-card {
  margin: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-light);
  box-shadow: 0 6px 18px rgba(18, 22, 27, 0.05);
}

.gallery-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-card.is-photo img,
.gallery-zoom img {
  aspect-ratio: 4 / 5;
  background: var(--bg-steel);
}

.photo-fab { object-position: center 58%; }
.photo-before { object-position: center 45%; }
.photo-after { object-position: center 40%; }
.photo-install { object-position: center 42%; }
.photo-install-detail { object-position: center 40%; }
.photo-trailer { object-position: 62% 48%; }

.gallery-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: zoom-in;
}

.gallery-zoom:hover img {
  opacity: 0.92;
}

.gallery-card figcaption {
  padding: 0.75rem 0.9rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
}

.photo-tag {
  display: inline-block;
  margin-right: 0.45rem;
  padding: 0.1rem 0.45rem;
  background: var(--bg-steel);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 3px;
  vertical-align: 1px;
}

.photo-tag-after {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Service area */
.area {
  background: var(--bg-light);
}

.area-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3rem;
  align-items: start;
}

.area-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0;
  display: grid;
  gap: 0.65rem;
}

.area-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  font-weight: 600;
}

.area-list svg {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* Quote / contact */
.quote {
  background: var(--bg-steel);
  color: var(--text-light);
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.quote .eyebrow {
  color: var(--accent-hot);
}

.quote-info h2,
.hours-title {
  color: var(--text-light);
}

.quote-info > p,
.form-note {
  color: var(--text-muted);
}

.quote-info a,
.form-note a {
  color: var(--accent-hot);
}

.contact-details {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.contact-details .contact-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.contact-details a,
.contact-details span:not(.contact-label) {
  color: var(--text-light);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.contact-details a:hover {
  color: var(--accent-hot);
}

.hours-title {
  margin: 1.75rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hours {
  width: 100%;
  max-width: 22rem;
  border-collapse: collapse;
  font-size: 1rem;
}

.hours th,
.hours td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 500;
}

.hours th {
  font-weight: 600;
  padding-right: 1.5rem;
  color: var(--text-light);
}

.hours td {
  color: var(--text-muted);
  text-align: right;
}

.hours-wed td,
.hours-wed th {
  color: var(--accent-hot);
}

.quote-form {
  background: var(--bg-dark);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.6rem 1.5rem 1.4rem;
}

.field {
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-steel);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 1rem;
}

.field textarea {
  resize: vertical;
  min-height: 7.5rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23e87747' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
}

.form-note {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
}

.form-status {
  margin: 0.6rem 0 0;
  min-height: 1.2em;
  color: var(--accent-hot);
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: #0c0f13;
  color: var(--text-muted);
  padding: 2.75rem 1.5rem 2rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem 2rem;
  align-items: center;
}

.footer-brand img {
  width: 150px;
  height: auto;
}

.footer-name {
  margin: 0 0 0.25rem;
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-meta p {
  margin: 0.15rem 0;
}

.footer-meta a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--accent-hot);
}

.copyright {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 10, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem 1.25rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 4.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: var(--text-light);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1100px) {
  .nav {
    gap: 0.85rem;
  }

  .service-grid,
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .about-copy {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 920px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.85rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 1.4rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-media {
    grid-column: 1;
    grid-row: 1;
    min-height: 16.5rem;
    height: 16.5rem;
  }

  .hero-overlay {
    display: block;
    grid-column: 1;
    grid-row: 1;
    position: relative;
    background: linear-gradient(180deg, rgba(18, 22, 27, 0.15) 20%, rgba(18, 22, 27, 0.55) 100%);
    pointer-events: none;
  }

  .hero-content {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    padding: 1.75rem 1.25rem 2.1rem;
  }

  .rig-grid,
  .area-grid,
  .quote-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .about-copy {
    grid-column: auto;
    order: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.45rem 0.85rem;
    gap: 0.55rem;
  }

  .brand-badge {
    width: 42px;
    height: 42px;
  }

  .brand-wordmark {
    width: 128px;
  }

  .brand-tag {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
  }

  .btn-call-label {
    /* keep the number visible — it's the main CTA */
  }

  .btn-call {
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
  }

  .section-inner {
    padding: 3.25rem 1.1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-lead {
    font-size: 1.02rem;
  }

  .service-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .work-grid .gallery-card:nth-child(1),
  .work-grid .gallery-card:nth-child(6) {
    grid-column: 1 / -1;
  }

  .work-grid .gallery-card:nth-child(1) img,
  .work-grid .gallery-card:nth-child(6) img {
    aspect-ratio: 4 / 3;
  }

  .railing-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card figcaption {
    font-size: 0.8rem;
    padding: 0.55rem 0.6rem 0.7rem;
  }

  .quote-form {
    padding: 1.2rem 1rem 1.15rem;
  }

  .hero-media,
  .hero-media img {
    height: 14.5rem;
    min-height: 14.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .gallery-zoom img {
    transition: none;
  }
}
