/* ============================================
   Bayside Systems — Main Stylesheet
   Deep Navy & Sand Coastal Palette
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #1a2744;
  --navy-light: #2c3e5a;
  --sand: #d4a574;
  --sand-light: #f5f0e8;
  --white: #fafafa;
  --text: #3a3a3a;
  --font-stack: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy-light);
  text-decoration: none;
  transition: color 0.2s;
}

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

h1, h2, h3, h4 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-weight: 600; }

ul {
  list-style: none;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--sand);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-logo:hover {
  color: var(--sand);
}

.logo-img {
  width: 36px;
  height: 36px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu li a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--white);
  border-bottom-color: var(--sand);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #3a5a7c 100%);
  color: var(--white);
  padding: 5rem 1.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.btn-primary {
  display: inline-block;
  background: var(--sand);
  color: var(--navy);
  padding: 0.75rem 1.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: #c4955e;
  color: var(--navy);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  padding: 0.7rem 1.8rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.btn-outline:hover {
  border-color: var(--sand);
  color: var(--sand);
  background: rgba(255, 255, 255, 0.05);
}

.btn-secondary {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--navy-light);
  color: var(--white);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Geometric wave pattern overlay */
.hero-pattern {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.1) 40px,
      rgba(255,255,255,0.1) 42px
    );
  pointer-events: none;
}

/* --- Capabilities Overview (Homepage) --- */
.capabilities-overview {
  padding: 5rem 0;
  background: var(--sand-light);
}

.capabilities-overview h2,
.products-highlight h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

.section-cta {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.section-cta a {
  color: var(--navy-light);
  font-weight: 600;
  border-bottom: 1px solid var(--sand);
  padding-bottom: 1px;
}

.section-cta a:hover {
  color: var(--sand);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: 6px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--sand);
  border-radius: 6px 6px 0 0;
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text);
}

.card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-light);
  border-bottom: 1px solid var(--sand);
  padding-bottom: 1px;
}

.card-link:hover {
  color: var(--sand);
}

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Products Highlight (Homepage) --- */
.products-highlight {
  padding: 5rem 0;
}

/* --- Products Detail Page --- */
.products-detail {
  padding: 4rem 0 5rem;
}

.product-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #e0ddd5;
}

.product-section:last-of-type {
  border-bottom: none;
}

.product-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.product-header h2 {
  padding-left: 1rem;
  border-left: 4px solid var(--sand);
}

.product-badge {
  display: inline-block;
  background: var(--sand-light);
  color: var(--navy-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.product-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.product-meta {
  display: flex;
  gap: 2.5rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid #e0ddd5;
  border-bottom: 1px solid #e0ddd5;
}

.product-meta-item h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy-light);
  margin-bottom: 0.2rem;
}

.product-meta-item p {
  font-size: 0.9rem;
  margin-bottom: 0;
  font-weight: 500;
}

.repos-section {
  padding: 2.5rem 0 1rem;
}

.repos-section h2 {
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--sand);
}

.repos-section p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.repos-section a {
  color: var(--navy);
  font-weight: 600;
  border-bottom: 1px solid var(--sand);
}

.repos-section a:hover {
  color: var(--sand);
}

/* --- Value Proposition --- */
.value-prop {
  padding: 5rem 0;
}

.value-prop h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.value-item {
  text-align: center;
  padding: 1.5rem 1rem;
}

.value-item h3 {
  margin-bottom: 0.75rem;
  color: var(--navy);
}

.value-item p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Page Header (inner pages) --- */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 4rem 0;
  border-bottom: 3px solid var(--sand);
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.05rem;
}

/* --- Capabilities Detail --- */
.capabilities-detail {
  padding: 4rem 0 5rem;
}

.capability-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #e0ddd5;
}

.capability-section:last-child {
  border-bottom: none;
}

.capability-section h2 {
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 4px solid var(--sand);
}

.capability-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.capability-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--navy-light);
}

.capability-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.capability-content li {
  padding: 0.25rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --- Contact --- */
.contact-info {
  padding: 4rem 0 5rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-card {
  background: var(--sand-light);
  padding: 2.5rem;
  border-radius: 6px;
}

.contact-card h2 {
  margin-bottom: 1rem;
}

.contact-card > p {
  margin-bottom: 2rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.contact-detail {
  margin-bottom: 1.5rem;
}

.contact-detail h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy-light);
  margin-bottom: 0.3rem;
}

.contact-detail a {
  color: var(--navy);
  font-weight: 600;
  border-bottom: 1px solid var(--sand);
}

.contact-detail a:hover {
  color: var(--sand);
}

.contact-aside {
  padding-top: 1rem;
}

.contact-aside h3 {
  margin-bottom: 1rem;
}

.contact-aside p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* --- Content Section (default) --- */
.content-section {
  padding: 4rem 0 5rem;
}

.content-section p,
.capabilities-detail p,
.products-detail p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
  font-size: 0.95rem;
}

/* --- Markdown Content Vertical Rhythm --- */
.content-section h1,
.capabilities-detail h1,
.products-detail h1 {
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
}

.content-section h2,
.capabilities-detail h2,
.products-detail h2 {
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  padding-top: 2.5rem;
  padding-left: 1rem;
  border-top: 1px solid #e0ddd5;
  border-left: 4px solid var(--sand);
}

.content-section h2:first-child,
.capabilities-detail h2:first-child,
.products-detail h2:first-child,
.content-section > h2:first-of-type,
.capabilities-detail > h2:first-of-type,
.products-detail > h2:first-of-type,
.content-section .container > h2:first-of-type,
.capabilities-detail .container > h2:first-of-type,
.products-detail .container > h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

.content-section h3,
.capabilities-detail h3,
.products-detail h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid #edebe6;
}

.content-section h3:first-child,
.capabilities-detail h3:first-child,
.products-detail h3:first-child,
.content-section h2 + h3,
.capabilities-detail h2 + h3,
.products-detail h2 + h3,
.content-section h2 + p + h3,
.capabilities-detail h2 + p + h3,
.products-detail h2 + p + h3 {
  border-top: none;
  padding-top: 0;
}

.content-section h4,
.capabilities-detail h4,
.products-detail h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--navy-light);
}

.content-section ul,
.content-section ol,
.capabilities-detail ul,
.capabilities-detail ol,
.products-detail ul,
.products-detail ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.75rem;
}

.content-section ol,
.capabilities-detail ol,
.products-detail ol {
  list-style: decimal;
}

.content-section li,
.capabilities-detail li,
.products-detail li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.content-section hr,
.capabilities-detail hr,
.products-detail hr {
  border: none;
  height: 0;
  margin: 0;
}

.content-section strong,
.capabilities-detail strong,
.products-detail strong {
  color: var(--navy);
}

.content-section table,
.capabilities-detail table,
.products-detail table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
}

.content-section th,
.capabilities-detail th,
.products-detail th {
  text-align: left;
  background: var(--sand-light);
  color: var(--navy);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--sand);
}

.content-section td,
.capabilities-detail td,
.products-detail td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #edebe6;
  line-height: 1.6;
}

.content-section tr:last-child td,
.capabilities-detail tr:last-child td,
.products-detail tr:last-child td {
  border-bottom: none;
}

.content-section blockquote,
.capabilities-detail blockquote,
.products-detail blockquote {
  border-left: 4px solid var(--sand);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  background: var(--sand-light);
  border-radius: 0 4px 4px 0;
}

.content-section a,
.capabilities-detail a,
.products-detail a {
  color: var(--navy);
  font-weight: 600;
  border-bottom: 1px solid var(--sand);
}

.content-section a:hover,
.capabilities-detail a:hover,
.products-detail a:hover {
  color: var(--sand);
}

/* --- Footer --- */
.footer-wave {
  line-height: 0;
}

.footer-wave svg {
  width: 100%;
  height: 60px;
  display: block;
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.footer-location {
  font-size: 0.85rem;
}

.footer-content a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-content a:hover {
  color: var(--sand);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-bottom: 3px solid var(--sand);
  }

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

  .nav-menu li a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .hero {
    padding: 3rem 1.5rem 4rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-grid-3 {
    grid-template-columns: 1fr;
  }

  .product-meta {
    flex-direction: column;
    gap: 1rem;
  }

  .value-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
