/* JOAT Construction & Remodels — light/dark + mobile-first */
:root {
  --navy: #0f2744;
  --navy-deep: #0a1b30;
  --blue: #1e3a8a;
  --steel: #3582ac;
  --steel-light: #5ba8cc;
  --gold: #c9a227;
  --gold-soft: #f5c451;
  --ink: #1a2332;
  --muted: #5b6b7c;
  --line: #e2e8f0;
  --surface: #f5f7fa;
  --bg: #ffffff;
  --white: #ffffff;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.96);
  --hero-overlay: linear-gradient(120deg, rgba(10, 27, 48, 0.84) 0%, rgba(15, 39, 68, 0.55) 48%, rgba(53, 130, 172, 0.38) 100%);
  --shadow: 0 12px 40px rgba(15, 39, 68, 0.12);
  --shadow-sm: 0 4px 16px rgba(15, 39, 68, 0.08);
  --toggle-bg: #eef2f6;
  --toggle-fg: #0f2744;
  --footer-bg: #0a1b30;
  --footer-fg: rgba(255, 255, 255, 0.82);
  --radius: 14px;
  --max: 1160px;
  --header-h: 72px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Explicit light */
html[data-theme="light"],
html.theme-light {
  color-scheme: light;
  --navy: #0f2744;
  --navy-deep: #0a1b30;
  --blue: #1e3a8a;
  --steel: #3582ac;
  --steel-light: #5ba8cc;
  --gold: #c9a227;
  --gold-soft: #f5c451;
  --ink: #1a2332;
  --muted: #5b6b7c;
  --line: #e2e8f0;
  --surface: #f5f7fa;
  --bg: #ffffff;
  --white: #ffffff;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.96);
  --shadow: 0 12px 40px rgba(15, 39, 68, 0.12);
  --shadow-sm: 0 4px 16px rgba(15, 39, 68, 0.08);
  --toggle-bg: #eef2f6;
  --toggle-fg: #0f2744;
  --footer-bg: #0a1b30;
  --footer-fg: rgba(255, 255, 255, 0.82);
}

/* Explicit dark — higher specificity than :root */
html[data-theme="dark"],
html.theme-dark {
  color-scheme: dark;
  --navy: #e8eef5;
  --navy-deep: #060d16;
  --blue: #7ec0e0;
  --steel: #5eb3d6;
  --steel-light: #8fd0ea;
  --gold: #e0bc4a;
  --gold-soft: #f5c451;
  --ink: #e8eef5;
  --muted: #9aabbc;
  --line: #2a3d55;
  --surface: #0f1a2b;
  --bg: #0b1522;
  --white: #0b1522;
  --card: #132033;
  --header-bg: rgba(11, 21, 34, 0.96);
  --hero-overlay: linear-gradient(120deg, rgba(6, 13, 22, 0.92) 0%, rgba(15, 39, 68, 0.7) 50%, rgba(53, 130, 172, 0.4) 100%);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --toggle-bg: #1a2b40;
  --toggle-fg: #e8eef5;
  --footer-bg: #060d16;
  --footer-fg: rgba(232, 238, 245, 0.85);
}

/* OS preference when user has not chosen yet */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]):not(.theme-light):not(.theme-dark) {
    color-scheme: dark;
    --navy: #e8eef5;
    --navy-deep: #060d16;
    --blue: #7ec0e0;
    --steel: #5eb3d6;
    --steel-light: #8fd0ea;
    --gold: #e0bc4a;
    --gold-soft: #f5c451;
    --ink: #e8eef5;
    --muted: #9aabbc;
    --line: #2a3d55;
    --surface: #0f1a2b;
    --bg: #0b1522;
    --white: #0b1522;
    --card: #132033;
    --header-bg: rgba(11, 21, 34, 0.96);
    --hero-overlay: linear-gradient(120deg, rgba(6, 13, 22, 0.92) 0%, rgba(15, 39, 68, 0.7) 50%, rgba(53, 130, 172, 0.4) 100%);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
    --toggle-bg: #1a2b40;
    --toggle-fg: #e8eef5;
    --footer-bg: #060d16;
    --footer-fg: rgba(232, 238, 245, 0.85);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100dvh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.container {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

@media (min-width: 640px) {
  .container {
    width: min(100% - 2.5rem, var(--max));
  }
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 0.65rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  min-width: 0;
  flex-shrink: 1;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  height: 54px;
  width: 54px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  background: #3582ac;
  flex-shrink: 0;
}

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

.brand-text strong {
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
}

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

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  min-width: 44px;
  height: 44px;
  border-radius: 11px;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.65rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--steel);
}

.theme-toggle:active,
.nav-toggle:active {
  transform: scale(0.96);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
  line-height: 1;
}

/* Light mode: show sun (click to go dark) */
html[data-theme="light"] .theme-toggle .icon-sun,
html.theme-light .theme-toggle .icon-sun,
html:not([data-theme]):not(.theme-dark) .theme-toggle .icon-sun {
  display: inline;
}

/* Dark mode: show moon (click to go light) */
html[data-theme="dark"] .theme-toggle .icon-moon,
html.theme-dark .theme-toggle .icon-moon {
  display: inline;
}

html[data-theme="dark"] .theme-toggle .icon-sun,
html.theme-dark .theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .theme-label {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (min-width: 480px) {
  .theme-toggle .theme-label {
    display: inline;
  }
}

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

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.65rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  gap: 0.25rem;
  backdrop-filter: blur(14px);
}

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

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.98rem;
  min-height: 44px;
}

.nav-links a:hover,
.nav-links a.active {
  background: color-mix(in srgb, var(--steel) 16%, transparent);
  color: var(--blue);
}

.nav-links a.nav-cta {
  background: linear-gradient(135deg, #1e3a8a, #3582ac);
  color: #fff !important;
  justify-content: center;
  margin-top: 0.25rem;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.28);
}

.nav-links a.nav-cta:hover {
  transform: translateY(-1px);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .nav-links a {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    min-height: auto;
    font-size: 0.92rem;
  }

  .nav-links a.nav-cta {
    margin-top: 0;
    margin-left: 0.3rem;
    padding: 0.55rem 1rem;
  }

  .brand-logo {
    height: 58px;
    width: 58px;
  }

  .brand-text strong {
    font-size: 1.05rem;
  }
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: clamp(480px, 72dvh, 720px);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  background: #0a1b30;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) contrast(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100% - 1.5rem, 820px);
  text-align: center;
  padding: 2.5rem 0 3.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: #fff;
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.85rem, 6vw, 3.4rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
  color: #fff;
}

.hero-lead {
  margin: 0 auto 1.5rem;
  max-width: 620px;
  font-size: clamp(1rem, 2.6vw, 1.22rem);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 400;
}

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

.hero-dots {
  position: absolute;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.45rem;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  min-width: 10px;
  min-height: 10px;
}

.hero-dots button.active {
  background: var(--gold-soft);
  width: 26px;
  border-radius: 999px;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, #1e3a8a, #3582ac);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: #fff !important;
}

.btn-secondary {
  background: var(--card);
  color: var(--navy) !important;
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--steel);
  color: var(--blue) !important;
}

.btn-ghost {
  background: transparent;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.btn-sm {
  padding: 0.65rem 1.05rem;
  font-size: 0.88rem;
  min-height: 42px;
}

/* ========== Sections ========== */
.section {
  padding: clamp(2.75rem, 7vw, 5.25rem) 0;
}

.section-muted {
  background: var(--surface);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.25rem;
}

.section-head h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.kicker {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: var(--steel);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Trust bar */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: -1.75rem;
  position: relative;
  z-index: 4;
}

@media (min-width: 800px) {
  .trust-bar {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: -2.25rem;
  }
}

.trust-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.trust-item strong {
  display: block;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--navy);
  margin-bottom: 0.15rem;
}

.trust-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }
}

.service-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}

.service-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--steel) 18%, transparent);
  color: var(--blue);
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}

.service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  color: var(--navy);
}

.service-card p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  flex: 1;
  font-size: 0.96rem;
}

.service-card .btn {
  align-self: flex-start;
}

.service-thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  height: 170px;
  background: linear-gradient(135deg, #1e3a8a, #3582ac);
}

.service-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 1rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  background: #0a1b30;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

@media (hover: hover) {
  .gallery-item:hover img {
    transform: scale(1.04);
  }
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.3rem 0.9rem 0.85rem;
  background: linear-gradient(transparent, rgba(10, 27, 48, 0.9));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Reviews */
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 800px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}

.review-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.stars {
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.review-card p {
  margin: 0 0 0.9rem;
  color: var(--ink);
  font-size: 0.98rem;
}

.review-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Page hero / content */
.page-hero {
  background:
    linear-gradient(120deg, rgba(10, 27, 48, 0.9), rgba(53, 130, 172, 0.72)),
    url("../img/work-02.jpg") center/cover no-repeat;
  color: #fff;
  padding: clamp(2.75rem, 8vw, 5rem) 0;
}

.page-hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.75rem, 4.5vw, 2.7rem);
  letter-spacing: -0.02em;
  color: #fff;
}

.page-hero p {
  margin: 0;
  max-width: 640px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}

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

@media (min-width: 900px) {
  .content-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
  }
}

.prose h2,
.prose h3 {
  color: var(--navy);
  letter-spacing: -0.01em;
}

.prose h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
}

.prose h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1.12rem;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 1rem;
}

.prose ul {
  padding-left: 1.15rem;
  margin: 0.45rem 0 1.15rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 900px) {
  .side-card {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

.side-card h3 {
  margin: 0 0 0.7rem;
  color: var(--navy);
}

.side-card p,
.side-card li {
  color: var(--muted);
  font-size: 0.96rem;
}

.side-card ul {
  margin: 0 0 1.1rem;
  padding-left: 1.1rem;
}

.side-card .btn {
  width: 100%;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem;
  }
}

.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.contact-card h3 {
  margin: 0 0 0.3rem;
  color: var(--navy);
}

.contact-card.cta-panel {
  background: linear-gradient(145deg, #0f2744, #3582ac);
  color: #fff;
  border: 0;
}

.contact-card.cta-panel h3 {
  color: #fff;
}

.contact-card.cta-panel p {
  color: rgba(255, 255, 255, 0.9);
}

.contact-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

.contact-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.contact-list strong {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.contact-list a {
  font-weight: 600;
  color: var(--steel);
  word-break: break-word;
}

.cta-band {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.1rem;
  padding: 1.4rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, #0f2744, #3582ac);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

@media (min-width: 720px) {
  .cta-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 1.65rem 1.85rem;
  }
}

.cta-band h2 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: #fff;
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.cta-band .btn-secondary {
  border: 0;
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 2.5rem 0 1.35rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
  }
}

.site-footer h3 {
  margin: 0 0 0.8rem;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0 0 0.7rem;
  font-size: 0.94rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: var(--gold-soft);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.footer-brand img {
  height: 52px;
  width: 52px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.84rem;
}

@media (min-width: 720px) {
  .footer-bottom {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

.detail-hero-img {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
}

.detail-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== Dark mode hard overrides (hardcoded light values) ========== */
html[data-theme="dark"] body,
html.theme-dark body {
  background: var(--bg) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .site-header,
html.theme-dark .site-header {
  background: var(--header-bg) !important;
  border-bottom-color: var(--line);
}

html[data-theme="dark"] .site-header.scrolled,
html.theme-dark .site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .brand-text strong,
html.theme-dark .brand-text strong {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .brand-text span,
html.theme-dark .brand-text span {
  color: #7ec0e0 !important;
}

html[data-theme="dark"] .nav-links a,
html.theme-dark .nav-links a {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a.active,
html.theme-dark .nav-links a:hover,
html.theme-dark .nav-links a.active {
  background: rgba(94, 179, 214, 0.18) !important;
  color: #7ec0e0 !important;
}

html[data-theme="dark"] .nav-links a.nav-cta,
html.theme-dark .nav-links a.nav-cta {
  background: linear-gradient(135deg, #1e3a8a, #3582ac) !important;
  color: #fff !important;
}

html[data-theme="dark"] .section-muted,
html.theme-dark .section-muted {
  background: var(--surface) !important;
}

html[data-theme="dark"] .service-card,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .trust-item,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .side-card,
html[data-theme="dark"] .agreement-card,
html.theme-dark .service-card,
html.theme-dark .review-card,
html.theme-dark .trust-item,
html.theme-dark .contact-card,
html.theme-dark .side-card,
html.theme-dark .agreement-card {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}

html[data-theme="dark"] .service-card h3,
html[data-theme="dark"] .review-card h3,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .prose h2,
html[data-theme="dark"] .prose h3,
html.theme-dark .service-card h3,
html.theme-dark .section-head h2,
html.theme-dark .prose h2,
html.theme-dark .prose h3 {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .service-card p,
html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .prose p,
html[data-theme="dark"] .prose li,
html[data-theme="dark"] .cp-muted,
html.theme-dark .service-card p,
html.theme-dark .section-head p,
html.theme-dark .prose p,
html.theme-dark .prose li {
  color: var(--muted) !important;
}

html[data-theme="dark"] .btn-secondary,
html.theme-dark .btn-secondary {
  background: var(--card) !important;
  color: #e8eef5 !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .btn-secondary:hover,
html.theme-dark .btn-secondary:hover {
  border-color: var(--steel) !important;
  color: #7ec0e0 !important;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select,
html.theme-dark .field input,
html.theme-dark .field textarea,
html.theme-dark .field select {
  background: #0b1522 !important;
  color: #e8eef5 !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .agreement-doc,
html.theme-dark .agreement-doc {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .agreement-toolbar,
html.theme-dark .agreement-toolbar {
  background: var(--card) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .agreement-letterhead .co h1,
html.theme-dark .agreement-letterhead .co h1 {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .agreement-section h3,
html.theme-dark .agreement-section h3 {
  color: #7ec0e0 !important;
  border-bottom-color: var(--line) !important;
}

html[data-theme="dark"] .sig-block,
html.theme-dark .sig-block {
  background: var(--surface) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] .notice,
html.theme-dark .notice {
  background: rgba(94, 179, 214, 0.12) !important;
  border-color: rgba(94, 179, 214, 0.3) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .kicker,
html.theme-dark .kicker {
  color: #7ec0e0 !important;
}

html[data-theme="dark"] .trust-item strong,
html.theme-dark .trust-item strong {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .trust-item span,
html.theme-dark .trust-item span {
  color: var(--muted) !important;
}

html[data-theme="dark"] .site-footer,
html.theme-dark .site-footer {
  background: var(--footer-bg) !important;
  color: var(--footer-fg) !important;
}

/* prefers-color-scheme without explicit choice mirrors dark overrides */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]):not(.theme-light):not(.theme-dark) body {
    background: #0b1522 !important;
    color: #e8eef5 !important;
  }
  html:not([data-theme]):not(.theme-light):not(.theme-dark) .site-header {
    background: rgba(11, 21, 34, 0.96) !important;
  }
  html:not([data-theme]):not(.theme-light):not(.theme-dark) .service-card,
  html:not([data-theme]):not(.theme-light):not(.theme-dark) .review-card,
  html:not([data-theme]):not(.theme-light):not(.theme-dark) .trust-item,
  html:not([data-theme]):not(.theme-light):not(.theme-dark) .contact-card {
    background: #132033 !important;
    border-color: #2a3d55 !important;
  }
}
