/* ============================================================
   Blue Haven — BHF Construction Inc
   Computer Systems Design — Santa Clara, CA
   Theme: Silicon Valley tech, blue skies, haven of innovation
   ============================================================ */

/* ----- Custom Properties ----- */
:root {
  --sky:        #4A90D9;
  --navy:       #0D1B3E;
  --steel:      #6B7C93;
  --warm-gray:  #F0EDE8;
  --white:      #FFFFFF;
  --coral:      #E8655E;

  --font-body:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-card: 0 4px 24px rgba(13, 27, 62, 0.10), 0 1px 4px rgba(13, 27, 62, 0.06);
  --shadow-float: 0 12px 40px rgba(13, 27, 62, 0.12), 0 2px 8px rgba(13, 27, 62, 0.06);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--sky); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--navy); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.625rem); }

/* ----- Skip Link ----- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--navy);
  color: var(--white);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ----- Navigation ----- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid rgba(13, 27, 62, 0.06);
  transition: box-shadow var(--transition), transform var(--transition);
}
.site-nav.scrolled { box-shadow: 0 2px 20px rgba(13, 27, 62, 0.08); }
.site-nav.nav-hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.nav-logo svg { width: 36px; height: 36px; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--steel);
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--navy); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition);
}
.nav-cta svg { width: 16px; height: 16px; }
.nav-cta:hover, .nav-cta:focus-visible {
  background: var(--sky);
  color: var(--white);
  transform: translateY(-1px);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ----- Hero — Angular Architecture ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--navy);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  padding: 120px 0 160px;
}

.hero-geo {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-geo .poly {
  position: absolute;
  background: var(--sky);
  opacity: 0.08;
}
.hero-geo .poly-1 {
  width: 500px; height: 500px;
  top: -120px; right: -80px;
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 70%);
}
.hero-geo .poly-2 {
  width: 340px; height: 340px;
  bottom: 40px; left: 8%;
  clip-path: polygon(0 0, 70% 0, 100% 100%, 0 100%);
}
.hero-geo .poly-3 {
  width: 200px; height: 200px;
  top: 40%; left: 55%;
  background: var(--coral);
  opacity: 0.06;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text { max-width: 580px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--sky);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
}
.hero-badge .dot {
  width: 8px; height: 8px;
  background: var(--coral);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-text h1 {
  color: var(--white);
  margin-bottom: 20px;
}
.hero-text h1 em {
  font-style: normal;
  color: var(--sky);
}

.hero-text p {
  color: rgba(255,255,255,0.65);
  font-size: 1.125rem;
  max-width: 440px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sky);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 14px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--coral);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 14px 30px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--white);
  color: var(--white);
  transform: translateY(-2px);
}

/* Hero visual — floating card stack */
.hero-visual {
  position: relative;
  height: 420px;
}

.float-card {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: float-card 6s ease-in-out infinite;
}
.float-card:nth-child(1) {
  top: 0; left: 10%;
  width: 280px;
  animation-delay: 0s;
}
.float-card:nth-child(2) {
  top: 140px; left: 35%;
  width: 260px;
  animation-delay: -2s;
}
.float-card:nth-child(3) {
  top: 280px; left: 5%;
  width: 240px;
  animation-delay: -4s;
}

@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float-card .fc-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.float-card .fc-icon.sky  { background: rgba(74,144,217,0.12); color: var(--sky); }
.float-card .fc-icon.navy { background: rgba(13,27,62,0.08); color: var(--navy); }
.float-card .fc-icon.coral { background: rgba(232,101,94,0.10); color: var(--coral); }

.float-card .fc-text h4 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}
.float-card .fc-text p {
  font-size: 0.8125rem;
  color: var(--steel);
  margin: 0;
}

/* ----- Diagonal Dividers ----- */
.section-divider {
  position: relative;
  height: 0;
}
.section-divider svg {
  position: absolute;
  left: 0;
  width: 100%;
  height: 80px;
}

/* ----- Section Shared ----- */
.section {
  padding: 120px 32px;
  position: relative;
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky);
  margin-bottom: 16px;
}

.section-heading {
  margin-bottom: 56px;
  max-width: 640px;
}
.section-heading p {
  color: var(--steel);
  margin-top: 12px;
  font-size: 1.125rem;
}

/* ----- Approach — Asymmetrical Offset Grid ----- */
.approach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.approach-grid > :nth-child(2) { margin-top: 60px; }
.approach-grid > :nth-child(3) { margin-top: -60px; }

.approach-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(13,27,62,0.04);
  transition: transform var(--transition), box-shadow var(--transition);
}
.approach-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
}

.approach-card .card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: var(--warm-gray);
  color: var(--navy);
}

.approach-card h3 { margin-bottom: 10px; }
.approach-card p { color: var(--steel); font-size: 0.9375rem; }

.approach-card.featured {
  border-left: 4px solid var(--sky);
  background: rgba(74,144,217,0.03);
}

/* ----- Capabilities — Floating Card Islands ----- */
.caps-island {
  position: relative;
  padding: 40px 0;
}

.caps-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(13,27,62,0.04);
  padding: 28px 28px 28px 32px;
  max-width: 340px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.caps-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: var(--shadow-float);
}
.caps-card:nth-child(even):hover { transform: translateY(-6px) rotate(0.5deg); }

.caps-card + .caps-card { margin-top: 24px; }
.caps-card:nth-child(odd)  { margin-left: 0; }
.caps-card:nth-child(even) { margin-left: auto; margin-right: 0; }

.caps-card h4 { font-size: 1.0625rem; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.caps-card h4 .caps-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.caps-card h4 .caps-dot.sky  { background: var(--sky); }
.caps-card h4 .caps-dot.navy { background: var(--navy); }
.caps-card h4 .caps-dot.coral { background: var(--coral); }

.caps-card p { color: var(--steel); font-size: 0.875rem; }

/* ----- Trust — Counter Banner (not stats bar) ----- */
.trust-strip {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
.trust-strip::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: var(--sky);
  opacity: 0.05;
  border-radius: 50%;
  top: -300px; right: -200px;
}

.trust-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px 20px;
  position: relative;
  z-index: 1;
}

.trust-item {
  text-align: left;
  min-width: 160px;
}
.trust-item .count {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1;
}
.trust-item .count .plus { color: var(--coral); }
.trust-item .label {
  font-size: 0.8125rem;
  font-weight: 550;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* ----- Clients — Horizontal scroll strip ----- */
.client-strip {
  padding: 64px 0;
  background: var(--warm-gray);
  overflow: hidden;
}
.client-track {
  display: flex;
  gap: 60px;
  animation: scroll-clients 30s linear infinite;
  width: max-content;
  padding: 0 32px;
}
.client-track span {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 550;
  color: var(--steel);
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0.7;
}
@keyframes scroll-clients {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----- Process — Diagonal section ----- */
.process {
  clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
  background: var(--navy);
  color: var(--white);
  padding: 160px 32px;
}
.process .section-label { color: var(--sky); }
.process .section-heading p { color: rgba(255,255,255,0.55); }

.process-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}

.process-step {
  position: relative;
  padding: 32px 24px 24px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.06);
  counter-increment: step;
  transition: background var(--transition);
}
.process-step:hover { background: rgba(255,255,255,0.08); }

.process-step::before {
  content: '0' counter(step);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sky);
  display: block;
  margin-bottom: 16px;
}
.process-step h4 { font-size: 1.0625rem; margin-bottom: 8px; }
.process-step p { font-size: 0.875rem; color: rgba(255,255,255,0.55); }

/* ----- Contact — Floating island form ----- */
.contact {
  background: var(--warm-gray);
}

.contact-island {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 56px 48px;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}
.contact-island::after {
  content: '';
  position: absolute;
  width: 120px; height: 6px;
  background: var(--sky);
  border-radius: 3px;
  top: 0; left: 48px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--navy);
  background: var(--warm-gray);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--sky);
  background: var(--white);
}
.form-group textarea { min-height: 130px; resize: vertical; }

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

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 14px 36px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.form-submit:hover, .form-submit:focus-visible {
  background: var(--sky);
  transform: translateY(-2px);
}
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.form-feedback {
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 550;
  display: none;
}
.form-feedback.success {
  display: block;
  background: rgba(74,144,217,0.08);
  color: var(--sky);
  border: 1px solid rgba(74,144,217,0.2);
}
.form-feedback.error {
  display: block;
  background: rgba(232,101,94,0.08);
  color: var(--coral);
  border: 1px solid rgba(232,101,94,0.2);
}

/* ----- Footer ----- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  padding: 0;
}
.footer-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 48px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-brand p {
  max-width: 300px;
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
}

/* ----- Legal Pages (Privacy & TOS) ----- */
.legal-page {
  padding: 140px 32px 100px;
  background: var(--white);
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
}
.legal-inner h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 8px;
}
.legal-meta {
  color: var(--steel);
  font-size: 0.9375rem;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(13,27,62,0.08);
}
.legal-inner h2 {
  font-size: 1.375rem;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--navy);
}
.legal-inner h3 {
  font-size: 1.125rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--navy);
}
.legal-inner p {
  font-size: 1rem;
  color: var(--steel);
  margin-bottom: 16px;
  line-height: 1.7;
}
.legal-inner ul {
  margin-bottom: 16px;
  padding-left: 24px;
}
.legal-inner li {
  font-size: 1rem;
  color: var(--steel);
  margin-bottom: 8px;
  line-height: 1.6;
}
.legal-inner strong { color: var(--navy); }
.legal-inner a { text-decoration: underline; }

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { height: 340px; margin-top: 20px; }
  .float-card:nth-child(1) { left: 0; }
  .float-card:nth-child(2) { left: 25%; }
  .float-card:nth-child(3) { left: 0; }

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

  .approach-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .approach-grid > :nth-child(2) { margin-top: 0; }
  .approach-grid > :nth-child(3) { margin-top: 0; }

  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--white);
    padding: 100px 32px 32px;
    gap: 28px;
  }
  .nav-links.open a { font-size: 1.125rem; }
  .nav-toggle { display: flex; }

  .hero { clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%); }
  .hero-visual { height: 280px; }
  .float-card { max-width: 260px; }
  .float-card:nth-child(1) { left: 0; width: 240px; }
  .float-card:nth-child(2) { left: 15%; width: 230px; }
  .float-card:nth-child(3) { left: 0; width: 220px; }

  .section { padding: 80px 20px; }
  .process { padding: 120px 20px; clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%); }

  .process-flow { grid-template-columns: 1fr; }
  .trust-inner { flex-direction: column; gap: 32px; }

  .form-row { grid-template-columns: 1fr; }
  .contact-island { padding: 40px 24px; }
  .contact-island::after { left: 24px; }

  .footer-main { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; }

  .caps-card { max-width: 100%; }
}

@media (max-width: 480px) {
  .hero-content { padding: 0 20px; }
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { justify-content: center; }
  .hero-visual { height: 240px; }
}

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