/* ============================================
   SPILLWAY GROUP - Main Stylesheet
   Color Palette:
     Navy:    #1e2a4a
     Gold:    #c9a84c
     Teal:    #448c9a
     Light:   #e8f0ed
     Seafoam: #8bc2b1
   ============================================ */

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

:root {
  --navy: #1e2a4a;
  --navy-dark: #151e36;
  --gold: #c9a84c;
  --gold-light: #d4b96a;
  --teal: #448c9a;
  --teal-dark: #367280;
  --teal-light: #5ba3b0;
  --light: #e8f0ed;
  --seafoam: #8bc2b1;
  --seafoam-light: #a8d1c5;
  --white: #ffffff;
  --text-dark: #1e2a4a;
  --text-light: #f0f4f2;
  --text-muted: #6b7c93;
  --shadow: 0 4px 24px rgba(30, 42, 74, 0.12);
  --shadow-lg: 0 12px 48px rgba(30, 42, 74, 0.18);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
  background: var(--white);
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navy);
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: var(--navy-dark);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
}

/* --- Hero Sections --- */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30, 42, 74, 0.88) 0%,
    rgba(30, 42, 74, 0.7) 50%,
    rgba(68, 140, 154, 0.6) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  max-width: 720px;
  padding: 120px 24px 80px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--white);
  margin-bottom: 0;          /* FIX 1: removed gap below OVERFLOWING */
  letter-spacing: -0.5px;
  line-height: 1;
}

.hero h1 .accent {
  color: var(--gold);
}

/* --- Hero Text Rotator --- */
.hero-rotator {
  position: relative;
  height: 62px;              /* tight to the 58px font with ~1.0 line-height */
  overflow: hidden;
  margin-top: 2px;           /* FIX 1: minimal gap above the rotator */
  margin-bottom: 28px;       /* FIX 2: breathing room before the divider */
}

.rotator-word {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  font-family: 'Droid Serif', Georgia, serif;
  font-size: 58px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.0;          /* FIX 3: tight line-height */
  color: var(--gold);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  white-space: nowrap;
}

.rotator-word.active {
  opacity: 1;
  transform: translateY(0);
}

.rotator-word.exit {
  opacity: 0;
  transform: translateY(-40px);
}

@media (max-width: 768px) {
  .hero-rotator {
    height: 40px;
    margin-bottom: 22px;
  }
  .rotator-word {
    font-size: 36px;
  }
}

.hero-divider {
  width: 80px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 580px;
}

/* Page hero (shorter) */
.hero-page {
  min-height: 40vh;
  align-items: flex-end;
}

.hero-page .hero-content {
  padding: 140px 24px 60px;
}

.hero-page h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 24px;       /* page heroes don't have a rotator, so keep spacing */
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.35);
}

.btn-outline {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
  transform: translateY(-2px);
}

/* --- Section Styles --- */
.section {
  padding: 100px 0;
}

.section-light {
  background: var(--light);
}

.section-navy {
  background: var(--navy);
  color: var(--text-light);
}

.section-teal {
  background: var(--teal);
  color: var(--text-light);
}

.section-gold {
  background: var(--gold);
  color: var(--navy);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

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

.section-header .divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0 auto 20px;
}

.section-navy .section-header .divider,
.section-teal .section-header .divider {
  background: var(--gold);
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.section-navy .section-header p,
.section-teal .section-header p {
  color: rgba(255, 255, 255, 0.8);
}

/* --- CTA Banner --- */
.cta-banner {
  background: var(--gold);
  padding: 56px 0;
  text-align: center;
}

.cta-banner p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 28px;
}

.cta-banner .btn {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.cta-banner .btn:hover {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--teal);
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--teal);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Engagement Types (Strengths page) --- */
.engagement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.engagement-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--teal);
  transition: transform var(--transition), box-shadow var(--transition);
}

.engagement-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.engagement-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 16px;
}

.engagement-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--navy);
}

.engagement-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Capability Icons Grid --- */
.capabilities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.capability-item {
  text-align: center;
  padding: 32px 16px;
  background: var(--white);
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.capability-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.capability-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 28px;
}

.capability-icon.bg-navy { background: var(--navy); }
.capability-icon.bg-teal { background: var(--teal); }
.capability-icon.bg-seafoam { background: var(--seafoam); }
.capability-icon.bg-light { background: var(--seafoam-light); color: var(--navy); }

.capability-item h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
}

/* --- Solutions Section --- */
.solutions-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.solution-item {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.solution-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 32px;
}

.solution-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 12px;
}

.solution-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* --- Client Tags --- */
.client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.client-tag {
  background: var(--white);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all var(--transition);
}

.client-tag:hover {
  background: var(--teal);
  color: var(--white);
  transform: translateY(-2px);
}

/* --- About Page --- */
.about-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--navy);
}

.about-text-content .divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 20px;
}

.about-text-content p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.8;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Team Section --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.team-member {
  text-align: center;
  cursor: pointer;
}

.team-member:hover .team-photo {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(30, 42, 74, 0.3);
}

.team-member:hover h3 {
  color: var(--gold);
  transition: color var(--transition);
}

.team-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(30, 42, 74, 0.15);
  border: 4px solid var(--white);
  transition: transform var(--transition), box-shadow var(--transition);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-member h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}

/* --- Bio Modal --- */
.bio-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(21, 30, 54, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.bio-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bio-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s ease;
}

.bio-modal-overlay.open .bio-modal {
  transform: scale(1) translateY(0);
}

.bio-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--light);
  color: var(--navy);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 1;
  line-height: 1;
}

.bio-modal-close:hover {
  background: var(--navy);
  color: var(--white);
}

.bio-modal-photo {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 48px;
  background: var(--light);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.bio-modal-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--white);
  box-shadow: 0 4px 16px rgba(30, 42, 74, 0.15);
  margin-bottom: 16px;
}

.bio-modal-photo h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}

.bio-modal-text {
  padding: 48px 40px 40px 32px;
}

.bio-modal-text p {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.85;
  margin-bottom: 16px;
}

.bio-modal-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .bio-modal {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .bio-modal-photo {
    padding: 32px 24px 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .bio-modal-photo img {
    width: 120px;
    height: 120px;
  }

  .bio-modal-text {
    padding: 24px;
  }
}

/* --- Contact Form --- */
.contact-section {
  position: relative;
  overflow: hidden;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.contact-image {
  background-size: cover;
  background-position: center;
}

.contact-form-area {
  background: var(--teal-dark);
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-form-area h2 {
  color: var(--white);
  font-size: 1.75rem;
  margin-bottom: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-dark);
  transition: border-color var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.form-submit:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.4);
}

/* --- Footer --- */
.footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 32px 0;
  text-align: center;
  font-size: 0.85rem;
}

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

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

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .engagement-grid {
    grid-template-columns: 1fr;
  }

  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-text {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .contact-image {
    min-height: 250px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy-dark);
    padding: 24px;
    gap: 20px;
    text-align: center;
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: 80vh;
  }

  .hero-content {
    padding: 100px 24px 60px;
  }

  .section {
    padding: 64px 0;
  }

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

  .capabilities-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .solution-item {
    flex-direction: column;
    gap: 20px;
  }

  .contact-form-area {
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .capabilities-grid {
    grid-template-columns: 1fr;
  }
}
