/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/* 10. Create a root stacking context */
#root,
#__next {
  isolation: isolate;
}

/* --- CUSTOM SYSTEM STYLES --- */

:root {
  --primary: #0056b3;
  --accent: #f97316;
  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem; /* Prevents the fixed nav from covering the section title if you pin the header later */
}

::selection {
  background-color: var(--primary);
  color: #ffffff;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--text-main);
  background-color: var(--bg);
}

section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Navigation */
section.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
}

nav {
  display: flex;
  gap: 2.5rem;
}

nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  gap: 4rem;
}

/* Target all children (both the div and the img) */
.hero > * {
  flex: 1;
  min-width: 0;
}

.hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Update the existing .hero block */
.hero {
  display: flex;
  align-items: center;
  gap: 4rem;
  position: relative; /* Required for the absolute positioning below */
  padding-bottom: 6rem; /* Extra padding so the wave doesn't clip your image */
}

/* Force full-width background bypass */
/* 1. Increase bottom padding to physically push the content up */
.hero {
  display: flex;
  align-items: center;
  gap: 4rem;
  position: relative;
  padding-bottom: 12rem;
}

/* Force full-width background bypass */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-color: var(--surface);
  z-index: -1;
}

/* 2. Target ONLY the text div and image for flex, and pop them to the front */
.hero > div:not(.wave-container),
.hero > img {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* 3. Layer the wave in the middle and disable pointer events so it can't block clicks */
.wave-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 150px;
  overflow: hidden;
  line-height: 0;
  z-index: 0;
  pointer-events: none;
}

.wave-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Viewport Adjustments (Mobile/Tablet) */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }
}

/* CTAs */
.btn-primary {
  display: inline-block;
  background-color: var(--primary);
  color: var(--bg);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 1rem;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #004494;
}

/* Typography Scale */
.heading-lg {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 1rem 0 1.5rem;
  letter-spacing: -0.02em;
}

.heading-md {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Value Proposition */
section.value {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
}

/* Fluid Grid Cards */
.grid-container {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(400px, 1fr)
  ); /* Updated width */
  gap: 2rem;
  width: 100%;
}

.card {
  position: relative;
  margin-top: 2.5rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4rem 2.5rem 2.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  /* Added transition */
  transition: all 0.3s ease;
}

.icon-box {
  position: absolute;
  top: -2.5rem;
  left: 2.5rem;
  width: 5rem;
  height: 5rem;
  background-color: #0b1a30;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  /* Added transition */
  transition: background-color 0.3s ease;
}

/* --- NEW HOVER STATES --- */

.card:hover {
  background-color: var(--bg); /* Shifts to pure white */
  border-color: var(--primary); /* Snaps to brand blue */
  box-shadow: 0 20px 25px -5px rgba(0, 86, 179, 0.1); /* Adds a soft blue shadow */
  transform: translateY(-4px); /* Lifts the card towards the user */
  cursor: pointer;
}

/* Triggers the child icon box to change color when the parent card is hovered */
.card:hover .icon-box {
  background-color: var(--accent); /* Snaps to brand orange */
}

.card .heading-md {
  color: var(--text-main);
  text-transform: none;
  letter-spacing: normal;
  font-size: 1.5rem;
}

/* Footer Layouts */
section.contact {
  display: flex;
  gap: 4rem;
  background-color: var(--surface);
  padding: 5rem 2rem;
  max-width: 100%;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.contact-container {
  max-width: 500px;
  flex: 1;
  margin-bottom: 0.5rem;
}

.contact-container p strong {
  display: block;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/* Contact Layout Adjustments */
.footer-logo-wrapper {
  margin-bottom: 2rem; /* Forces gap between logo and text */
}

.contact-heading {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: var(--text-main);
}

.contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem; /* Tightens the spacing between contact items */
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
}

.contact-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-list a:hover {
  color: var(--primary);
}

.contact-icon {
  flex-shrink: 0;
  color: var(--primary); /* Syncs icon colors to your brand blue */
}

hr {
  display: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem;
}

.footer div {
  display: flex;
  gap: 2rem;
}

/* Viewport Adjustments (Mobile/Tablet) */
@media (max-width: 900px) {
  section {
    padding: 4rem 1.5rem;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  section.contact {
    flex-direction: column;
    padding: 4rem 1.5rem;
  }

  .footer {
    flex-direction: column-reverse;
    gap: 1.5rem;
    text-align: center;
    align-items: center;
  }
}

/* Tabs Container */
.faq-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

/* Tab Button Styling */
.tab-btn {
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.tab-btn:hover {
  border-color: var(--text-muted);
}

/* Active Tab State */
.tab-btn.active {
  background-color: var(--surface);
  border-color: var(--text-main);
  color: var(--text-main);
}

/* Enhanced Oak Harbor FAQ Styling */
.faq-item {
  background-color: #ffffff; /* Pure white card */
  border: 1px solid #f8fafc; /* Barely-there structural border */
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.03),
    0 4px 6px -2px rgba(0, 0, 0, 0.02); /* Soft elevation */
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05); /* Deeper shadow on hover */
  transform: translateY(-2px); /* Slight lift */
}

/* Hide default marker for cross-browser consistency */
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary {
  list-style: none;
  padding: 2rem; /* Generous breathing room */
  font-weight: 900;
  font-size: 1.125rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Refined Chevron */
.faq-item summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2.5px solid var(--text-main);
  border-bottom: 2.5px solid var(--text-main);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 2rem;
}

/* Chevron open state */
.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-content {
  padding: 0 2rem 2rem 2rem; /* Zero top padding, matching side/bottom padding */
}

.faq-content p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7; /* Improved readability for dense text */
}

/* Hide inactive panels */
.faq-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

/* Display active panel */
.faq-panel.active {
  display: flex;
}
