/* Design tokens */
:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-text: #1a2332;
  --color-text-muted: #5c6578;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-soft: rgba(37, 99, 235, 0.12);
  --color-hero-end: #0ea5e9;
  --color-border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Sora", var(--font-sans);
  --max-content: 1120px;
  --nav-height: 72px;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

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

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  scroll-behavior: smooth;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.section-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
}

.section-intro,
.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 42rem;
  margin: 0 auto 1rem;
}

.section-subtitle {
  margin-bottom: 2.5rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), #3b82f6);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.cta-button:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

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

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: var(--safe-top) max(20px, var(--safe-right)) 0 max(20px, var(--safe-left));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  gap: 1rem;
}

.logo {
  flex-shrink: 0;
}

.logo img {
  height: 52px;
  width: auto;
  display: block;
}

/* Navigation Links */
.nav-links ul {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.nav-links li {
  display: inline-block;
}

.nav-links li a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.nav-links li a:hover {
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
}

.nav-links a.nav-cta {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.nav-links a.nav-cta:hover {
  background: var(--color-accent);
  color: #fff;
}

.hamburger-menu {
  display: none;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 12px 0;
    min-height: auto;
  }

  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    margin-left: auto;
    padding: 4px 0;
  }

  .hamburger-menu span {
    display: block;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    width: 100%;
  }

  .hamburger-menu.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger-menu.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .nav-links {
    flex-basis: 100%;
    order: 3;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: height 0.3s ease, margin 0.3s ease;
    margin-top: 0;
  }

  .nav-links.active {
    height: auto;
    margin-top: 12px;
    padding: 8px 0 16px;
  }

  .nav-links ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    width: 100%;
    max-width: 100%;
    padding: 14px 20px;
    justify-content: center;
    border-radius: 0;
  }

  .nav-links li a:hover {
    background-color: var(--color-accent);
    color: #fff;
  }

  .nav-links a.nav-cta {
    margin: 8px 16px 0;
    border-radius: var(--radius-sm);
    width: calc(100% - 32px);
  }

  /* iOS Safari: backdrop blur often glitches over scrolling content */
  .navbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.97);
  }

  .quote-form input,
  .quote-form textarea {
    font-size: 16px;
  }

  .hamburger-menu {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 8px;
    box-sizing: border-box;
  }

  .hamburger-menu span {
    width: 26px;
  }
}

/* Hero Section */
.hero {
  position: relative;
  color: #fff;
  padding: clamp(40px, 8vw, 96px) max(16px, var(--safe-left)) clamp(48px, 10vw, 120px) max(16px, var(--safe-right));
  text-align: left;
  background: linear-gradient(135deg, #1e3a8a 0%, var(--color-accent) 45%, var(--color-hero-end) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(255, 255, 255, 0.15), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(14, 165, 233, 0.25), transparent 45%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  width: 100%;
  min-width: 0;
}

.hero-content {
  max-width: 36rem;
  min-width: 0;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 1rem;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  animation: fadeInDown 0.8s ease;
}

.hero-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 1.75rem;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-visual {
  animation: fadeInUp 0.9s ease 0.15s both;
  min-width: 0;
  width: 100%;
}

/* Hero image carousel */
.hero-carousel {
  --hero-progress-ms: 6s;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.35);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  isolation: isolate;
}

.hero-carousel-viewport {
  position: relative;
  aspect-ratio: 3 / 2;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.hero-carousel-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition:
    opacity 0.85s cubic-bezier(0.33, 1, 0.68, 1),
    visibility 0s linear 0.85s;
  z-index: 0;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  transition:
    opacity 0.85s cubic-bezier(0.33, 1, 0.68, 1),
    visibility 0s linear 0s;
}

.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.15) 70%, transparent);
  text-align: left;
}

.hero-slide-theme {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: 0.02em;
}

.hero-photo-credit {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.55);
  margin-left: auto;
  white-space: nowrap;
}

.hero-carousel-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
}

.hero-carousel-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.95));
  border-radius: 0 2px 2px 0;
  will-change: transform;
}

.hero-carousel-progress-bar--run {
  animation: heroCarouselProgress var(--hero-progress-ms, 6s) linear forwards;
}

@keyframes heroCarouselProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.hero-carousel-ui {
  padding: 12px 16px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-carousel-label {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.03em;
}

.hero-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: width 0.35s cubic-bezier(0.33, 1, 0.68, 1), background 0.25s ease, transform 0.2s ease;
}

.hero-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.15);
}

.hero-carousel-dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.hero-carousel-dot.is-active {
  width: 26px;
  background: rgba(255, 255, 255, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel-progress {
    display: none;
  }

  .hero-slide {
    transition: opacity 0.01ms, visibility 0.01ms;
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: clamp(24px, 5vw, 40px);
  }

  .hero-content {
    max-width: none;
    margin: 0 auto;
  }

  .hero-eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 6.5vw, 2.35rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .hero-lead {
    font-size: 1rem;
    padding: 0 2px;
  }
}

@media (max-width: 480px) {
  .hero-slide-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px 12px;
  }

  .hero-slide-theme {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .hero-photo-credit {
    white-space: normal;
    margin-left: 0;
    font-size: 0.5625rem;
    line-height: 1.3;
    text-align: left;
  }

  .hero-carousel-label {
    font-size: 0.8125rem;
    line-height: 1.35;
    padding: 0 4px;
  }

  .hero-carousel-ui {
    padding: 10px 12px 14px;
  }
}

/* Touch devices: larger carousel dot hit targets (avoids tiny taps on Safari) */
@media (pointer: coarse) {
  .hero-carousel-dot {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-pill);
    background: transparent;
    flex-shrink: 0;
  }

  .hero-carousel-dot::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.32);
    transition: width 0.3s ease, height 0.3s ease, background 0.25s ease;
  }

  .hero-carousel-dot.is-active {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .hero-carousel-dot.is-active::after {
    width: 26px;
    height: 8px;
    background: rgba(255, 255, 255, 0.95);
  }

  .hero-carousel-dot:hover {
    transform: none;
  }

  .hero-carousel-dots {
    gap: 4px;
  }
}

/* About Section */
.about-section {
  padding: clamp(64px, 10vw, 100px) 0;
  text-align: center;
  background: var(--color-surface);
}

.about-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 1.25rem;
}

.about-section .section-inner > p {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 40rem;
  margin: 0 auto 1rem;
}

.about-section p.about-highlight {
  font-weight: 600;
  color: var(--color-text);
  font-size: 1.25rem;
}

/* Services Section */
.services-section {
  padding: clamp(64px, 10vw, 100px) 0;
  text-align: center;
  background: var(--color-bg);
}

.services-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.services-container {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.service {
  background: var(--color-surface);
  padding: 2rem 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 320px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}

.service-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
}

.service i {
  font-size: 1.5rem;
  color: var(--color-accent);
}

.service h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.service p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

.section-divider {
  border: none;
  border-top: 2px solid var(--color-accent);
  width: min(200px, 40%);
  margin: 0 auto 1.5rem;
  opacity: 0.35;
  border-radius: 2px;
}

.decorative-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-hero-end));
  margin: 1.25rem auto;
  border-radius: var(--radius-pill);
}

/* FAQ Section */
.faq-section {
  padding: clamp(64px, 10vw, 100px) 0;
  text-align: center;
  background: var(--color-surface);
}

.faq-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 2.5rem;
}

.faq-container {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.faq-item {
  margin-bottom: 0;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 16px;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h3 {
  font-size: 1.0625rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
}

.faq-item p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.65;
}

/* Quote Section */
.quote-section {
  padding: clamp(64px, 10vw, 100px) 0;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg) 0%, #e8ecf3 100%);
}

.quote-section-inner {
  max-width: 640px;
}

.quote-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}

.quote-section > .section-inner > p,
.quote-section .quote-section-inner > p {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  margin: 0 auto 2rem;
  max-width: 36rem;
}

.quote-form {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.quote-form input,
.quote-form textarea {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quote-form input:focus,
.quote-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.quote-form button {
  margin-top: 4px;
}

.quote-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Scroll-to-Top Button (created in script.js) */
.scroll-to-top {
  position: fixed;
  bottom: max(20px, var(--safe-bottom));
  right: max(20px, var(--safe-right));
  z-index: 1100;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-accent);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  /* visibility controlled in script.js together with display */
  transition: opacity 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.nav-links a.active {
  color: var(--color-accent);
  font-weight: 700;
}

/* Why Choose Us Section */
.why-choose-us-section {
  padding: clamp(64px, 10vw, 100px) 0;
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.why-choose-us-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: 2.5rem;
}

.features-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.feature {
  text-align: center;
  max-width: 300px;
  padding: 0 8px;
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
}

.feature i {
  font-size: 1.5rem;
  color: var(--color-accent);
}

.feature h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* Logo in Get a Free Quote Section */
.quote-logo {
  text-align: center;
  padding: 24px 16px 0;
}

.quote-logo img {
  height: min(200px, 40vw);
  width: auto;
}

/* Footer */
.footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 28px max(20px, var(--safe-right)) max(28px, var(--safe-bottom)) max(20px, var(--safe-left));
  margin-top: 0;
  font-size: 0.875rem;
}

.footer p {
  margin: 0;
}
