/*--------------------------------------------------------------
# Mana Pasifiki — Honu Pacific Theme
# Overrides main.css variables with the Living Ngatu design system
--------------------------------------------------------------*/

:root {
  /* Honu Palette — Primary */
  --deep-ocean: #1C2E4A;
  --mid-ocean: #2A4F6E;
  --logo-brown: #7A5230;
  --warm-brown: #9B6B3D;
  --light-tapa: #C49A6C;
  --dark-earth: #5C3A1E;
  --white: #FFFFFF;
  --warm-cloud: #F5F0E8;

  /* Semantic Text */
  --text-primary: #1C2E4A;
  --text-secondary: #2A4F6E;
  --text-light: #F5F0E8;
  --text-light-muted: #C49A6C;

  /* Semantic Borders */
  --border-light: rgba(122, 82, 48, 0.2);
  --border-dark: rgba(196, 154, 108, 0.15);

  /* Override main.css variables */
  --default-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --heading-font: "Playfair Display", Georgia, "Times New Roman", serif;
  --nav-font: "Source Sans 3", system-ui, sans-serif;

  --background-color: var(--white);
  --default-color: var(--text-primary);
  --heading-color: var(--deep-ocean);
  --accent-color: var(--logo-brown);
  --surface-color: var(--white);
  --contrast-color: var(--white);
  --primary: var(--deep-ocean);
  --accent-light: var(--light-tapa);
  --text-muted: var(--text-secondary);
  --border: var(--border-light);

  /* Nav overrides */
  --nav-color: var(--light-tapa);
  --nav-hover-color: var(--logo-brown);
  --nav-mobile-background-color: var(--deep-ocean);
  --nav-dropdown-background-color: var(--deep-ocean);
  --nav-dropdown-color: var(--text-light);
  --nav-dropdown-hover-color: var(--logo-brown);
}

/* Typography Scale */
h1 { font-size: 52px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 36px; font-weight: 700; line-height: 1.2; }
h3 { font-size: 22px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 18px; font-weight: 600; line-height: 1.4; font-family: var(--nav-font); }
body { font-size: 17px; line-height: 1.6; }

@media (max-width: 767px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }
  body { font-size: 16px; }
}

/* Pacific Map — homepage */
.pacific-map-svg {
  width: 100%;
  height: auto;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3C!-- Double-hull vaka --%3E%3Cpath d='M4,20 Q8,18 16,17 Q24,18 28,20' fill='none' stroke='%237A5230' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M4,24 Q8,22 16,21 Q24,22 28,24' fill='none' stroke='%237A5230' stroke-width='1.5' stroke-linecap='round'/%3E%3Cline x1='10' y1='17' x2='10' y2='24' stroke='%237A5230' stroke-width='0.8'/%3E%3Cline x1='16' y1='17' x2='16' y2='24' stroke='%237A5230' stroke-width='0.8'/%3E%3Cline x1='22' y1='17' x2='22' y2='24' stroke='%237A5230' stroke-width='0.8'/%3E%3C!-- Sail --%3E%3Cpolygon points='16,5 16,17 24,14' fill='none' stroke='%237A5230' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") 16 16, pointer;
}

.map-dot {
  fill: var(--logo-brown);
  opacity: 0.85;
}

.map-dot-ref {
  fill: var(--light-tapa);
  opacity: 0.4;
}

.map-label {
  fill: var(--text-primary);
  font-family: var(--nav-font);
  font-size: 11px;
  font-weight: 600;
}

.map-label-sm {
  fill: var(--text-secondary);
  font-family: var(--nav-font);
  font-size: 9px;
  font-weight: 500;
}

/* Hero Cultural Icon Watermark — inner pages */
.hero-icon {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: hero-icon-appear 2s ease-out 0.5s forwards;
}

@keyframes hero-icon-appear {
  0%   { opacity: 0; transform: translateY(-50%) scale(0.85); }
  100% { opacity: 0.7; transform: translateY(-50%) scale(1); }
}

@media (max-width: 991px) {
  .hero-icon {
    right: 50%;
    transform: translate(50%, -50%);
    width: 200px;
    height: 200px;
  }
  @keyframes hero-icon-appear {
    0%   { opacity: 0; transform: translate(50%, -50%) scale(0.85); }
    100% { opacity: 0.5; transform: translate(50%, -50%) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon {
    animation: none;
    opacity: 0.7;
    transform: translateY(-50%);
  }
}

/* Hero Turtle Watermark — honu surfaces from the deep */
.hero-turtle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  max-width: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  filter: brightness(2);
  transform: translate(-130%, 80%) rotate(-15deg);
  animation: honu-arrive 6s cubic-bezier(0.25, 0.1, 0.25, 1) 1s forwards,
             honu-swim 35s ease-in-out 7s infinite;
}

/* Phase 1: Glide in from bottom-left, settle to center */
@keyframes honu-arrive {
  0%   { opacity: 0;    transform: translate(-130%, 80%) rotate(-15deg); }
  40%  { opacity: 0.04; transform: translate(-90%, 10%) rotate(-5deg); }
  70%  { opacity: 0.06; transform: translate(-60%, -35%) rotate(-1deg); }
  100% { opacity: 0.07; transform: translate(-50%, -50%) rotate(-2deg); }
}

/* Phase 2: Gentle drift once settled */
@keyframes honu-swim {
  0%   { transform: translate(-50%, -50%) rotate(-2deg); }
  15%  { transform: translate(-35%, -55%) rotate(1deg); }
  30%  { transform: translate(-45%, -45%) rotate(-1deg); }
  50%  { transform: translate(-55%, -52%) rotate(2deg); }
  70%  { transform: translate(-48%, -42%) rotate(-1.5deg); }
  85%  { transform: translate(-40%, -55%) rotate(1deg); }
  100% { transform: translate(-50%, -50%) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-turtle {
    animation: none;
    opacity: 0.07;
    transform: translate(-50%, -50%);
  }
}

/* Hero Video Background */
.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.35;
}

/* Tidal Section Base Classes */
.crest-section {
  background: linear-gradient(160deg, var(--deep-ocean), var(--mid-ocean));
  color: var(--text-light);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.crest-section h1,
.crest-section h2,
.crest-section h3,
.crest-section h4 {
  color: var(--text-light);
}

.crest-section .section-title p {
  color: var(--text-light-muted);
}

.crest-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 32px, rgba(196,154,108,0.03) 32px, rgba(196,154,108,0.03) 33px),
    repeating-linear-gradient(90deg, transparent, transparent 32px, rgba(196,154,108,0.03) 32px, rgba(196,154,108,0.03) 33px);
  pointer-events: none;
  z-index: 0;
}

.crest-section > .container {
  position: relative;
  z-index: 1;
}

.trough-section {
  background-color: var(--white);
  color: var(--text-primary);
  padding: 60px 0;
  position: relative;
}

.trough-section-alt {
  background-color: var(--warm-cloud);
  color: var(--text-primary);
  padding: 60px 0;
  position: relative;
}

.trough-section::before,
.trough-section-alt::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 44px, rgba(28,46,74,0.02) 44px, rgba(28,46,74,0.02) 45px),
    repeating-linear-gradient(90deg, transparent, transparent 44px, rgba(28,46,74,0.02) 44px, rgba(28,46,74,0.02) 45px);
  pointer-events: none;
  z-index: 0;
}

.trough-section > .container,
.trough-section-alt > .container {
  position: relative;
  z-index: 1;
}

/*--------------------------------------------------------------
# Navigation — Deep Ocean Header
--------------------------------------------------------------*/
.header {
  background-color: var(--deep-ocean);
  padding: 12px 0;
}

.header .logo .logo-text {
  font-family: var(--heading-font);
  color: var(--text-light);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header .logo img {
  max-height: 44px;
  position: relative;
  z-index: 1;
}

.header .logo {
  position: relative;
}

/* Tapa-inspired ring behind the turtle */
.header .logo img::after {
  content: '';
}

.header .logo::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 154, 108, 0.15) 40%, rgba(196, 154, 108, 0.08) 60%, transparent 72%);
  border: 1.5px solid rgba(196, 154, 108, 0.3);
  box-shadow:
    0 0 0 3px rgba(122, 82, 48, 0.1),
    0 0 12px rgba(196, 154, 108, 0.15);
  animation: tapa-ring-breathe 8s ease-in-out infinite;
  z-index: 0;
}

@keyframes tapa-ring-breathe {
  0%, 100% { opacity: 0.7; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.04); }
}

.scrolled .header {
  background-color: var(--deep-ocean);
  box-shadow: 0 2px 20px rgba(28, 46, 74, 0.3);
}

#navmenu a {
  font-family: var(--nav-font);
  font-weight: 600;
  font-size: 15px;
  color: var(--light-tapa);
}

#navmenu a:hover {
  color: var(--text-light);
}

#navmenu a.active,
#navmenu .active > a {
  color: var(--white);
  box-shadow: inset 0 -2px 0 var(--light-tapa);
}

#navmenu .dropdown ul {
  background: var(--deep-ocean);
  border: 1px solid var(--border-dark);
}

#navmenu .dropdown ul a {
  color: var(--light-tapa);
}

#navmenu .dropdown ul a:hover {
  color: var(--logo-brown);
  background: rgba(196, 154, 108, 0.08);
}

#navmenu .dropdown ul a.active {
  color: var(--white);
  background: rgba(196, 154, 108, 0.12);
}

.mobile-nav-toggle {
  color: var(--light-tapa);
}

@media (max-width: 1199px) {
  #navmenu ul {
    background: var(--deep-ocean);
  }

  #navmenu a {
    color: var(--text-light);
    border-bottom: 1px solid var(--border-dark);
  }

  #navmenu a:hover {
    color: var(--light-tapa);
  }

  #navmenu a.active,
  #navmenu .active > a {
    color: var(--white);
    background: rgba(196, 154, 108, 0.12);
    border-left: 3px solid var(--light-tapa);
  }
}

.btn-getstarted {
  background: var(--logo-brown);
  color: var(--white);
  font-family: var(--nav-font);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 24px;
  border-radius: 2px !important;
  border: none;
  letter-spacing: 0.5px;
  transition: background 200ms ease;
}

.btn-getstarted:hover {
  background: var(--warm-brown);
  color: var(--white);
}

/*--------------------------------------------------------------
# Buttons — Honu Style
--------------------------------------------------------------*/
.btn-get-started {
  background: var(--logo-brown);
  color: var(--white);
  font-family: var(--nav-font);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 2px;
  border: 2px solid var(--logo-brown);
  letter-spacing: 1px;
  transition: all 200ms ease;
  display: inline-block;
}

.btn-get-started:hover {
  background: var(--warm-brown);
  border-color: var(--warm-brown);
  color: var(--white);
}

.btn-get-started:active {
  transform: scale(0.97);
  transition: transform 100ms ease;
}

.btn-get-started:focus-visible {
  outline: 2px solid var(--light-tapa);
  outline-offset: 2px;
}

.btn-get-started.btn-outline {
  background: transparent;
  border: 2px solid var(--logo-brown);
  color: var(--logo-brown);
}

.btn-get-started.btn-outline:hover {
  background: var(--logo-brown);
  color: var(--white);
}

.crest-section .btn-get-started {
  background: var(--light-tapa);
  color: var(--deep-ocean);
  border-color: var(--light-tapa);
}

.crest-section .btn-get-started:hover {
  background: var(--warm-cloud);
  border-color: var(--warm-cloud);
}

.crest-section .btn-get-started.btn-outline {
  background: transparent;
  border-color: var(--light-tapa);
  color: var(--light-tapa);
}

.crest-section .btn-get-started.btn-outline:hover {
  background: var(--light-tapa);
  color: var(--deep-ocean);
}

.btn-cta {
  background: var(--light-tapa);
  color: var(--deep-ocean);
  font-family: var(--nav-font);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 2px !important;
  letter-spacing: 1px;
  transition: all 200ms ease;
  display: inline-block;
}

.btn-cta:hover {
  background: var(--warm-cloud);
  color: var(--deep-ocean);
}

/*--------------------------------------------------------------
# Cards — Tapa Corner Motifs
--------------------------------------------------------------*/
.pacific-card {
  background: var(--warm-cloud);
  border: 1px solid var(--border-light);
  border-radius: 0;
  padding: 24px;
  position: relative;
  transition: box-shadow 300ms ease;
}

.trough-section-alt .pacific-card {
  background: var(--white);
}

.pacific-card:hover {
  box-shadow: 0 4px 20px rgba(28, 46, 74, 0.08);
}

.pacific-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--logo-brown);
  border-left: 2px solid var(--logo-brown);
  opacity: 0.6;
  transition: all 300ms ease;
}

.pacific-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-bottom: 2px solid var(--logo-brown);
  border-right: 2px solid var(--logo-brown);
  opacity: 0.6;
  transition: all 300ms ease;
}

.pacific-card:hover::before,
.pacific-card:hover::after {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

/*--------------------------------------------------------------
# Section Titles — Tatau Divider
--------------------------------------------------------------*/
.section-title h2 {
  font-family: var(--heading-font);
  font-size: 36px;
  font-weight: 700;
  color: var(--heading-color);
}

.section-title p {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.crest-section .section-title h2 {
  color: var(--text-light);
}

.crest-section .section-title p {
  color: var(--text-light-muted);
}

.section-title h2::after {
  content: '';
  width: 50px;
  height: 2px;
  background: var(--logo-brown);
  display: inline-block;
  margin: 0 0 10px 15px;
}

.crest-section .section-title h2::before,
.crest-section .section-title h2::after {
  background: var(--light-tapa);
}

/*--------------------------------------------------------------
# Footer — Deep Ocean with Wave Border
--------------------------------------------------------------*/
.footer {
  background: var(--deep-ocean);
  color: var(--text-light);
  padding: 40px 0 20px;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 20' preserveAspectRatio='none'%3E%3Cpath d='M0,10 Q150,0 300,10 T600,10 T900,10 T1200,10' fill='none' stroke='%237A5230' stroke-width='1' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 1200px 20px;
  background-repeat: repeat-x;
}

.footer .copyright p {
  color: var(--text-light-muted);
}

.footer .social-links a {
  color: var(--light-tapa);
  font-size: 18px;
  margin: 0 8px;
  transition: color 200ms ease;
}

.footer .social-links a:hover {
  color: var(--logo-brown);
}

.cta-banner {
  background: linear-gradient(160deg, var(--deep-ocean), var(--mid-ocean));
  color: var(--text-light);
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner h2 {
  font-family: var(--heading-font);
  color: var(--text-light);
}

.cta-banner p {
  color: var(--text-light-muted);
}

/*--------------------------------------------------------------
# Specificity Overrides — Fix conflicts with main.css
--------------------------------------------------------------*/

/* 1. Hero buttons: override border-radius: 50px from main.css */
.hero .btn-get-started {
  border-radius: 2px;
  font-family: var(--nav-font);
  background: var(--light-tapa);
  color: var(--deep-ocean);
  border-color: var(--light-tapa);
  font-weight: 600;
}

.hero .btn-get-started:hover {
  background: var(--warm-cloud);
  border-color: var(--warm-cloud);
  color: var(--deep-ocean);
}

.hero .btn-get-started.btn-outline {
  background: transparent;
  border: 2px solid var(--light-tapa);
  color: var(--light-tapa);
}

.hero .btn-get-started.btn-outline:hover {
  background: rgba(196, 154, 108, 0.15);
  border-color: var(--light-tapa);
  color: var(--light-tapa);
}

/* 2. About/Why section icon-box on dark crest background */
.crest-section .icon-box i {
  color: var(--light-tapa);
  font-size: 40px;
}

.crest-section .icon-box h4 {
  color: var(--text-light);
}

.crest-section .icon-box h4 a {
  color: var(--text-light);
}

.crest-section .icon-box h4 a:hover {
  color: var(--light-tapa);
}

.crest-section .icon-box p {
  color: rgba(245, 240, 232, 0.75);
  font-size: 15px;
}

.crest-section .content p {
  color: var(--text-light);
}

.crest-section .content strong {
  color: var(--text-light);
}

/* 3. Service card icon — keep brown circle, ensure contrast */
.services .service-item i {
  background: var(--logo-brown);
  color: var(--white);
}

/* Service card hover — use ocean instead of old accent fill */
.services .service-item:hover:before,
.services .service-item:hover:after {
  background: var(--deep-ocean);
}

.services .service-item:hover h4 a,
.services .service-item:hover p {
  color: var(--text-light);
}

.services .service-item:hover i {
  background: var(--light-tapa);
  color: var(--deep-ocean);
}

/* 4. Team member role text — improve readability */
.team .team-member .member-info span {
  color: var(--text-secondary);
  font-size: 14px;
}

.team .team-member .member-info h4 {
  color: var(--text-primary);
}

/* 5. Solution preview links — use logo brown for visibility */
.solution-preview-link {
  color: var(--logo-brown);
  font-weight: 600;
}

.solution-preview-link:hover {
  color: var(--warm-brown);
}

/* 6. Solution preview icon backgrounds — update to Honu palette */
.solution-preview-icon {
  border-radius: 50%;
}

/* 7. Section title old accent lines — remove, our ::after bar handles it */
.section-title h2 .accent-line,
.section-title .accent-line {
  display: none;
}

/* 8. Global link color on trough sections — exclude buttons */
.trough-section a:not(.btn-get-started):not(.btn-cta):not(.btn-getstarted),
.trough-section-alt a:not(.btn-get-started):not(.btn-cta):not(.btn-getstarted) {
  color: var(--logo-brown);
}

.trough-section a:not(.btn-get-started):not(.btn-cta):not(.btn-getstarted):hover,
.trough-section-alt a:not(.btn-get-started):not(.btn-cta):not(.btn-getstarted):hover {
  color: var(--warm-brown);
}

/* Ensure button text is always white on brown background */
a.btn-get-started {
  color: var(--white) !important;
}

a.btn-get-started.btn-outline {
  color: var(--logo-brown) !important;
  background: transparent;
}

a.btn-get-started.btn-outline:hover {
  color: var(--white) !important;
}

.crest-section a.btn-get-started {
  color: var(--deep-ocean) !important;
}

.crest-section a.btn-get-started.btn-outline {
  color: var(--light-tapa) !important;
}

/* 9. Scroll-top button */
.scroll-top {
  background: var(--logo-brown);
  color: var(--white);
}

.scroll-top:hover {
  background: var(--warm-brown);
  color: var(--white);
}

/* 10. Breadcrumb on inner pages */
.crest-section .breadcrumbs a {
  color: var(--light-tapa);
}

.crest-section .breadcrumbs .current {
  color: var(--text-light);
}

/* 11. All general buttons outside hero — ensure sharp corners */
.btn-get-started {
  border-radius: 2px !important;
}

/* 12. Fix AOS visibility — main.css overflow:clip on .section clips
   AOS elements that start translated outside section bounds */
.trough-section,
.trough-section-alt,
.crest-section {
  overflow: visible;
}

/* Restore overflow:hidden only where explicitly needed (hero/cta banner star fields) */
.page-header.crest-section,
.cta-banner.crest-section {
  overflow: hidden;
}

/* 13. Quote highlight on dark crest sections — fix dark-on-dark contrast */
.crest-section .quote-highlight p {
  color: var(--text-light);
}

/* Pinned Three Pillars — services.html
   Default = stacked layout (works on all viewports).
   Only switches to absolute/pinned when there's enough room for the GSAP timeline
   (matches the matchMedia query in pacific-animations.js). */
.pillars-pinned-container {
  position: relative;
}

.pillars-pinned-container .pillar-feature {
  position: relative;
  opacity: 1;
}

@media (min-width: 992px) and (min-height: 850px) {
  .pillars-pinned-container {
    min-height: 60vh;
  }
  .pillars-pinned-container .pillar-feature {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
  }
}

/* Pinned Service Cards spotlight — index.html */
@media (min-width: 768px) {
  .services-pinned .service-item {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
}
