/* ============================================================
   Repair Titans — static site styles
   ============================================================ */
:root {
  --navy: #1A2532;
  --navy-dark: #0F1621;
  --gold: #C9A240;
  --gold-light: #E4C566;
  --gold-deep: #8A6D1F; /* darker gold, passes WCAG AA (4.9:1) as body text on white */
  --contact-bg: #F3F5F7;
  --muted: #52637A;
  --border: #DAE0E7;
  --white: #FFFFFF;
  --hero-text: #E0E1E3;
  --container: 1320px;
  --radius: 16px;
  --radius-sm: 10px;
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-head); margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(201, 162, 64, .25);
}
.btn:hover { background: var(--gold-light); }
.btn:active { transform: scale(.98); }
.btn-primary { padding: 0 32px; height: 48px; font-size: 18px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.icon { flex: none; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 81px;
  background: rgba(26, 37, 50, .95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 162, 64, .18);
}
.header-inner {
  height: 81px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 48px; height: 48px; }
.brand-name {
  font-family: "Montserrat", var(--font-body);
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 24px;
}
.primary-nav { display: flex; gap: 32px; }
.primary-nav a {
  color: rgba(201, 162, 64, .85);
  font-size: 16px;
  font-weight: 500;
  transition: color .2s ease, transform .2s ease;
}
.primary-nav a:hover { color: var(--gold-light); transform: scale(1.05); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background:
    radial-gradient(1200px 600px at 75% 40%, rgba(201,162,64,.06), transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 96px 0 112px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}
.hero-title {
  color: var(--gold);
  font-size: 60px;
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 28px;
}
.hero-sub {
  color: var(--hero-text);
  font-size: 20px;
  line-height: 1.5;
  max-width: 560px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats {
  display: flex;
  gap: 64px;
  margin: 0;
}
.stat { margin: 0; }
.stat-num {
  color: var(--gold);
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-body);
}
.stat-label {
  margin: 4px 0 0;
  color: var(--hero-text);
  font-size: 14px;
}
.hero-emblem { display: flex; justify-content: center; }
.hero-emblem img {
  width: 448px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5));
}

/* ============================================================
   SERVICES
   ============================================================ */
.services { background: var(--white); padding: 96px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-title { color: var(--navy); font-size: 48px; font-weight: 700; }
.section-sub { color: var(--muted); font-size: 18px; margin: 12px 0 0; }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(201, 162, 64, .14);
  color: var(--gold);
}

.service-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  background: var(--white);
  transition: box-shadow .25s ease, transform .25s ease;
}
.service-card:hover {
  box-shadow: 0 18px 40px rgba(26, 37, 50, .12);
  transform: translateY(-4px);
}

.service-title {
  color: var(--navy);
  font-size: 30px;
  font-weight: 600;
  margin: 20px 0 12px;
}
.service-desc { color: var(--gold-deep); font-size: 16px; margin: 0 0 18px; }
.service-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.service-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--gold-deep);
}
.service-card .service-list li { color: var(--gold-deep); }
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* Dark navy tile (Appliance Repair cards) */
.service-card--dark {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border: none;
}
.service-card--dark .icon-tile { background: rgba(201, 162, 64, .18); }
.service-card--dark .service-title { color: var(--gold); }
.service-card--dark .service-desc,
.service-card--dark .service-list li { color: var(--hero-text); }
.service-card--dark .service-list li::before { background: var(--gold); }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  align-items: start;
}

.service-grid--repair { grid-template-columns: repeat(3, 1fr); margin-bottom: 32px; }
.service-grid--install { grid-template-columns: repeat(3, 1fr); margin-bottom: 32px; }
.service-grid--install .service-card { border: 2px solid var(--navy); }

.service-group-head { text-align: center; margin: 56px 0 32px; }
.service-group-head--first { margin-top: 0; }
.service-group-title { color: var(--navy); font-size: 28px; font-weight: 700; font-family: var(--font-head); margin: 0; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { background: var(--contact-bg); padding: 96px 0; }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 796px) 373px;
  grid-template-rows: auto auto;
  column-gap: 48px;
  row-gap: 24px;
  justify-content: center;
  align-items: stretch;
}
/* The aside wrapper stays in the markup for structure/accessibility, but
   its children (info-card, emergency-card) participate directly in the
   contact-grid so the form card's row can be stretched to match the
   contact-information card's height specifically, independent of the
   emergency-card below it. */
.contact-aside { display: contents; }
.contact-form-card { grid-column: 1; grid-row: 1; }
.info-card { grid-column: 2; grid-row: 1; }
.emergency-card { grid-column: 2; grid-row: 2; }
.contact-form-card,
.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 12px 30px rgba(26, 37, 50, .06);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 20px; display: flex; flex-direction: column; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}
.field label span { color: var(--gold); }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: none; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 64, .18);
}

/* Invalid field state: red outline + inline message, set by js/main.js
   after a failed submission. Typed values are never cleared. */
.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: #B3261E;
}
.field--invalid input:focus,
.field--invalid select:focus,
.field--invalid textarea:focus {
  border-color: #B3261E;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .14);
}
.field-error-msg {
  display: block;
  color: #B3261E;
  font-size: 12px;
  margin-top: 6px;
}
.field-char-count {
  display: block;
  color: var(--text-muted, #767676);
  font-size: 12px;
  margin-top: 6px;
  text-align: right;
}
.field-char-count--limit { color: #B3261E; }

.form-status {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.form-status--ok { background: #E3F3E1; color: #1A1A1A; }
.form-status--error,
.form-status--invalid { background: #FBEAEA; color: #B3261E; }

/* Contact aside — display: contents is set earlier so info-card/emergency-card
   are laid out directly by .contact-grid; the 24px gap between them comes
   from the grid's row-gap. */
.info-title { color: var(--navy); font-size: 20px; margin-bottom: 20px; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.info-item:last-child { margin-bottom: 0; }
.info-item .icon-tile { flex: none; }
.info-text { display: flex; flex-direction: column; }
.info-label { font-weight: 700; color: var(--navy); font-size: 16px; }
.info-text a, .info-text span:not(.info-label) { color: var(--muted); font-size: 15px; margin-top: 2px; }
.info-text a:hover { color: var(--gold); }

.emergency-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 30px rgba(26, 37, 50, .18);
}
.emergency-title { color: var(--gold); font-size: 20px; margin-bottom: 12px; }
.emergency-text { color: rgba(228, 197, 102, .8); font-size: 14px; margin: 0 0 18px; }
.emergency-link { color: var(--gold); font-weight: 600; font-size: 15px; }
.emergency-link:hover { color: var(--gold-light); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(201, 162, 64, .18);
  padding: 30px 0;
}
.site-footer p { margin: 0; color: rgba(201, 162, 64, .75); font-size: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-emblem { order: 1; }
  .hero-emblem img { width: 320px; }
  .hero-title { font-size: 44px; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .contact-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .contact-form-card,
  .info-card,
  .emergency-card { grid-column: 1; grid-row: auto; }
  .service-grid--repair { grid-template-columns: repeat(2, 1fr); }
  .service-grid--install { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 81px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(26, 37, 50, .98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201, 162, 64, .18);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .primary-nav.open { max-height: 240px; }
  .primary-nav a { padding: 16px 32px; border-top: 1px solid rgba(201,162,64,.1); }

  .service-grid { grid-template-columns: 1fr; }
  .service-grid--repair { grid-template-columns: 1fr; }
  .service-grid--install { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 24px; align-items: center; }
  .section-title { font-size: 36px; }
  .hero-title { font-size: 36px; }
  .container { padding: 0 20px; }
}
