/* ==========================================================================
   Record Engineering (Pty) Ltd
   Single stylesheet. Brand colours taken from the company logo.
   ========================================================================== */

:root {
  --red:        #EC1D25;
  --red-dark:   #C4141B;
  --blue:       #062E8E;
  --blue-dark:  #041F63;
  --blue-tint:  #F2F5FB;

  --ink:        #1A1D24;
  --ink-soft:   #4A5160;
  --rule:       #D8DDE6;
  --paper:      #FFFFFF;
  --paper-alt:  #F4F6F9;

  --display: 'Raleway', system-ui, sans-serif;
  --body:    'Roboto', system-ui, sans-serif;
  --slab:    'Roboto Slab', Georgia, serif;

  --wrap:  1180px;
  --gutter: 24px;
}

/* --- Reset ---------------------------------------------------------------- */

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

.sr-only {
  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 {
  position: absolute; left: -9999px;
  background: var(--blue); color: #fff;
  padding: 12px 20px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

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

.site-header {
  background: var(--paper);
  border-bottom: 4px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
}

.logo img { max-height: 56px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: 28px; }

.primary-nav ul {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  padding: 6px 0;
  border-bottom: 3px solid transparent;
}

.primary-nav a:hover { color: var(--blue); }
.primary-nav a.is-current { border-bottom-color: var(--red); color: var(--blue); }

.primary-nav .header-phone {
  font-family: var(--display);
  font-weight: 800;
  color: var(--paper);
  background: var(--red);
  padding: 10px 18px;
  border-radius: 2px;
  text-decoration: none;
  white-space: nowrap;
}
.primary-nav .header-phone:hover { background: var(--red-dark); color: var(--paper); }

.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  background: var(--blue);
  border: 0; cursor: pointer;
  position: relative;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  position: absolute; left: 13px; width: 20px; height: 2px;
  background: #fff; content: '';
}
.nav-toggle-bar { top: 22px; }
.nav-toggle-bar::before { top: -6px; left: 0; }
.nav-toggle-bar::after  { top:  6px; left: 0; }

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

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  padding: 15px 32px;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .15s ease;
}

.btn-primary { background: var(--red);  color: #fff; }
.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}
.btn-secondary:hover { background: rgba(255,255,255,.14); }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }

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

.hero {
  position: relative;
  background: var(--blue-dark) center/cover no-repeat;
  color: #fff;
  padding: clamp(90px, 14vw, 170px) 0;
}

.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4,31,99,.92) 0%, rgba(4,31,99,.72) 55%, rgba(4,31,99,.35) 100%);
}

.hero .wrap { position: relative; z-index: 2; }
.hero-inner { max-width: 720px; }

.hero-since {
  font-family: var(--slab);
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  padding-left: 56px;
  position: relative;
  margin-bottom: 22px;
}
.hero-since::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 40px; height: 3px;
  background: var(--red);
}

.hero h1 { color: #fff; margin-bottom: 24px; }

.hero-lead {
  font-size: 1.15rem;
  max-width: 54ch;
  color: rgba(255,255,255,.9);
  margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* --- Generic section ------------------------------------------------------ */

.section { padding: clamp(60px, 8vw, 100px) 0; }
.section-alt { background: var(--paper-alt); }
.section-blue { background: var(--blue); color: #fff; }
.section-blue h2 { color: #fff; }

.section-head { max-width: 62ch; margin-bottom: 48px; }

.eyebrow {
  font-family: var(--slab);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
  display: block;
}

/* --- Services ------------------------------------------------------------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.service {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--blue);
  display: flex;
  flex-direction: column;
}

.service:hover { border-top-color: var(--red); }

.service-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--blue-tint);
  position: relative;
}
.service-media img { width: 100%; height: 100%; object-fit: cover; }
.service-media-empty { width: 100%; height: 100%; background: var(--blue-tint); }

/* Slideshow — only applied when a service folder holds more than one image */

.service-media.is-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
}
.service-media.is-slideshow .slide.is-active { opacity: 1; }

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: 0;
  background: rgba(6, 46, 142, .78);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s ease, background-color .15s ease;
  z-index: 2;
}
.slide-prev { left: 8px; }
.slide-next { right: 8px; }

.service-media:hover .slide-nav,
.slide-nav:focus-visible { opacity: 1; }
.slide-nav:hover { background: var(--red); }

.slide-dots {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}
.slide-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.slide-dot.is-active { background: var(--red); }

/* Touch devices have no hover, so keep the arrows visible */
@media (hover: none) {
  .slide-nav { opacity: 1; }
}

.service-body { padding: 26px 24px 30px; flex: 1; }
.service-body h3 { color: var(--blue); }
.service-body p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }

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

.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.split-media img { width: 100%; }

.capability-list {
  list-style: none;
  margin: 26px 0 32px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 26px;
}

.capability-list li {
  position: relative;
  padding-left: 22px;
  font-weight: 500;
}
.capability-list li::before {
  content: '';
  position: absolute; left: 0; top: 0.62em;
  width: 10px; height: 2px;
  background: var(--red);
}

/* --- Quote form ----------------------------------------------------------- */

.quote-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.quote-intro p { color: rgba(255,255,255,.88); }

.equipment-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  font-size: 0.94rem;
  columns: 2;
  column-gap: 32px;
}
.equipment-list li {
  padding: 5px 0;
  break-inside: avoid;
  color: rgba(255,255,255,.9);
}

.quote-form {
  background: var(--paper);
  padding: clamp(26px, 4vw, 40px);
  border-radius: 2px;
  color: var(--ink);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.83rem;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(6,46,142,.18);
  outline-offset: 0;
}

.field textarea { min-height: 110px; resize: vertical; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.form-message {
  padding: 14px 18px;
  border-radius: 2px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}
.form-message.is-success { background: #E8F5EC; border-left: 4px solid #2E7D46; }
.form-message.is-error   { background: #FDECEC; border-left: 4px solid var(--red); }

.honeypot { position: absolute; left: -9999px; }

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gallery-item {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-alt);
  border: 1px solid var(--rule);
}

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-empty {
  padding: 48px 24px;
  border: 2px dashed var(--rule);
  text-align: center;
  color: var(--ink-soft);
}

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

.site-footer { background: var(--ink); color: rgba(255,255,255,.78); margin-top: 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 44px;
  padding-top: 64px;
  padding-bottom: 52px;
}

.footer-logo { max-height: 54px; width: auto; margin-bottom: 20px; }
.footer-brand p { font-size: 0.95rem; max-width: 42ch; }

.footer-heading {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  margin-bottom: 18px;
}

.footer-links, .legal-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 9px; }

.footer-links a,
.footer-contact a {
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-links a:hover,
.footer-contact a:hover { color: #fff; }

.footer-contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.95rem;
}

.footer-bar { border-top: 1px solid rgba(255,255,255,.14); }

.footer-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 0.85rem;
}
.footer-bar p { margin: 0; }

.legal-links { display: flex; flex-wrap: wrap; gap: 20px; }
.legal-links a { color: rgba(255,255,255,.62); text-decoration: none; }
.legal-links a:hover { color: #fff; }

/* --- Page header (interior pages) ---------------------------------------- */

.page-head {
  background: var(--blue-dark);
  color: #fff;
  padding: clamp(56px, 8vw, 90px) 0 clamp(48px, 7vw, 72px);
  border-bottom: 5px solid var(--red);
}
.page-head h1 { color: #fff; margin-bottom: 0; }
.page-head-lead {
  color: rgba(255,255,255,.86);
  max-width: 58ch;
  margin-top: 16px;
  font-size: 1.1rem;
}

/* --- Prose columns -------------------------------------------------------- */

.prose-columns { columns: 2; column-gap: 48px; max-width: 100%; }
.prose-columns p { break-inside: avoid; }

/* --- Timeline ------------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--rule);
}

.timeline-item {
  position: relative;
  padding: 0 0 34px 40px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px; top: 9px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--paper);
}
.section-alt .timeline-item::before { box-shadow: 0 0 0 4px var(--paper-alt); }

.timeline-year {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--blue);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.timeline-text { color: var(--ink-soft); margin: 0; max-width: 68ch; }

/* --- Team ----------------------------------------------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
}

.team-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--blue);
  padding: 30px 24px;
  text-align: center;
}

.team-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.team-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.team-role {
  font-family: var(--slab);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  margin: 0;
}

/* --- CTA band ------------------------------------------------------------- */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.85); margin: 0; }

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

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.contact-details .quote-form,
.contact-layout .quote-form {
  border: 1px solid var(--rule);
  padding: clamp(26px, 4vw, 38px);
}
.contact-layout .quote-form h2 { margin-bottom: 24px; }

.contact-block {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-label {
  font-family: var(--slab);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
}
.contact-value {
  font-size: 1.06rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
a.contact-value:hover { color: var(--blue); }
.contact-sub { font-size: 0.92rem; color: var(--ink-soft); }

.contact-details .btn { margin-top: 26px; }

/* --- Document list -------------------------------------------------------- */

.doc-list { list-style: none; margin: 0 0 32px; padding: 0; }

.doc-item {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--red);
  background: var(--paper);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  background: var(--blue-tint);
  color: var(--blue);
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.doc-meta { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }

.doc-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
}
.doc-desc { font-size: 0.95rem; color: var(--ink-soft); }
.doc-sub { font-size: 0.88rem; color: var(--ink-soft); }

.doc-note { color: var(--ink-soft); font-size: 0.96rem; }

/* --- Legal pages ---------------------------------------------------------- */

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 110px;
  border-left: 3px solid var(--red);
  padding-left: 20px;
}

.legal-toc-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.legal-toc ol {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  counter-reset: toc;
}
.legal-toc li { counter-increment: toc; margin-bottom: 8px; }
.legal-toc a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  display: block;
}
.legal-toc a::before {
  content: counter(toc) '.';
  color: var(--red);
  font-weight: 700;
  margin-right: 7px;
}
.legal-toc a:hover { color: var(--blue); }

.legal-toc-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 12px;
}

.btn-small { padding: 10px 18px; font-size: 0.8rem; }

.legal-body { max-width: 74ch; }
.legal-body h2 {
  font-size: 1.35rem;
  margin-top: 44px;
  padding-top: 10px;
  color: var(--blue);
  scroll-margin-top: 110px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 1rem; margin-bottom: 6px; }
.legal-body p { color: var(--ink-soft); }

.legal-list { color: var(--ink-soft); padding-left: 22px; margin-bottom: 1.1em; }
.legal-list li { margin-bottom: 8px; }

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 0.95rem;
}
.legal-table th, .legal-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.legal-table thead th {
  background: var(--blue-tint);
  color: var(--blue);
  font-family: var(--display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.legal-table tbody th {
  width: 38%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.legal-table td { color: var(--ink-soft); }

.legal-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
  background: var(--paper-alt);
  border-left: 3px solid var(--blue);
  margin: 20px 0 28px;
}
.legal-contact .contact-value { font-size: 1rem; }

.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 20px 0 28px;
}
.legal-contact-grid .legal-contact { margin: 0; }

.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 24px 0 28px;
}
.record-cat {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--blue);
  padding: 18px 20px;
}
.record-cat h3 { color: var(--blue); }
.record-cat p { font-size: 0.9rem; margin: 0; }

.legal-cta {
  background: var(--blue-tint);
  border-left: 4px solid var(--red);
  padding: 26px 28px;
  margin: 36px 0 24px;
}
.legal-cta p { margin-bottom: 18px; }

.legal-meta {
  font-size: 0.9rem;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  margin-top: 34px;
}

/* --- Split reverse -------------------------------------------------------- */

.split-reverse .split-media { order: 2; }
.split-reverse .split-text  { order: 1; }

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

@media (max-width: 900px) {
  .split, .quote-layout { grid-template-columns: 1fr; }
  .equipment-list { columns: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .prose-columns { columns: 1; }
  .contact-layout { grid-template-columns: 1fr; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; }
  .split-reverse .split-media { order: 0; }
  .split-reverse .split-text  { order: 0; }
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }

  .primary-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 4px solid var(--blue);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 22px;
  }
  .primary-nav.is-open { display: flex; }

  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav li { border-bottom: 1px solid var(--rule); }
  .primary-nav a { display: block; padding: 14px 0; border-bottom: 0; }

  .header-phone { margin-top: 16px; text-align: center; }
  .site-header .header-inner { position: relative; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
