/* ============================================================
   TIDAL TECH — CSS
   ATLANTIC TECH, LLC | Portland, Maine
   Computer Systems Design
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --deep-ocean: #0A3D62;
  --tidal-blue: #3E92CC;
  --seafoam: #7ED8C4;
  --sand: #F5E6D3;
  --white: #FCFDFD;
  --navy: #061A2E;
  --text-dark: #061A2E;
  --text-body: #1a2e3b;
  --text-muted: #3d5a6e;
  --border-soft: #d0e4f0;
  --shadow-card: 0 4px 24px rgba(10, 61, 98, 0.08);
  --shadow-elevated: 0 12px 40px rgba(10, 61, 98, 0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-xl: 40px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --transition-fast: 180ms ease;
  --transition-smooth: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --max-width: 1200px;
  --nav-height: 72px;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--tidal-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--deep-ocean);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--navy);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  font-size: 1.0625rem;
}

/* --- Focus & Accessibility --- */
:focus-visible {
  outline: 3px solid var(--tidal-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--navy);
  color: var(--white);
  padding: 10px 20px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  z-index: 1000;
  transition: box-shadow var(--transition-smooth);
}

.site-nav.scrolled {
  box-shadow: var(--shadow-card);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.nav-brand svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 24px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-body);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--sand);
  color: var(--deep-ocean);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--navy);
  border-radius: 3px;
  transition: transform var(--transition-smooth), opacity var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--deep-ocean);
  color: var(--white);
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--seafoam);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 24px;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  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.6); }
}

.hero h1 {
  color: var(--white);
  max-width: 780px;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--seafoam);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--sand);
  max-width: 560px;
  margin-bottom: 36px;
  opacity: 0.9;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 28px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  letter-spacing: -0.01em;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: #6ccbb5;
  box-shadow: 0 6px 24px rgba(126, 216, 196, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--tidal-blue);
}

.btn-outline:hover {
  background: var(--tidal-blue);
  border-color: var(--tidal-blue);
  box-shadow: 0 6px 24px rgba(62, 146, 204, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--tidal-blue);
  padding: 10px 20px;
}

.btn-ghost:hover {
  background: var(--sand);
}

/* Hero wave shapes */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  opacity: 0.15;
}

.hero-blob--1 {
  width: 600px;
  height: 600px;
  top: -120px;
  right: -180px;
  border-color: var(--seafoam);
  animation: float-blob 14s ease-in-out infinite;
}

.hero-blob--2 {
  width: 400px;
  height: 400px;
  bottom: -80px;
  left: -100px;
  border-color: var(--tidal-blue);
  animation: float-blob 12s ease-in-out 2s infinite reverse;
}

.hero-blob--3 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 15%;
  border-color: var(--sand);
  animation: float-blob 10s ease-in-out 4s infinite;
}

@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -20px) rotate(5deg); }
  50% { transform: translate(-10px, 10px) rotate(-3deg); }
  75% { transform: translate(15px, 15px) rotate(2deg); }
}

/* Hero wave divider */
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 2;
  pointer-events: none;
}

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

/* --- Section Common --- */
.section {
  position: relative;
  padding: 100px 24px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tidal-blue);
  margin-bottom: 12px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading span {
  color: var(--tidal-blue);
}

.section-lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 48px;
}

/* --- Wave Dividers --- */
.wave-divider {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}

.wave-divider--top {
  top: -1px;
}

.wave-divider--bottom {
  bottom: -1px;
}

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

/* --- About Section --- */
.about {
  background: var(--white);
}

.about-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--seafoam);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.about-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.about-eyebrow svg {
  width: 32px;
  height: 32px;
  color: var(--tidal-blue);
}

.about-eyebrow span {
  font-weight: 700;
  color: var(--tidal-blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 36px;
}

.about-stat {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: #f0f7fb;
  border: 1px solid var(--border-soft);
}

.about-stat .count {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--deep-ocean);
  letter-spacing: -0.03em;
  line-height: 1;
  display: block;
}

.about-stat .count-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 8px;
  display: block;
}

.about-detail {
  padding: 20px 0;
}

.about-detail dt {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about-detail dd {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 1rem;
}

/* --- Services Section --- */
.services {
  background: #f4f9fc;
  position: relative;
}

.services-wave-top {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.services-wave-top svg {
  display: block;
  width: 100%;
  height: auto;
}

.services-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.service-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  overflow: hidden;
}

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

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--seafoam);
  opacity: 0.12;
  transform: translate(30px, 30px);
  transition: opacity var(--transition-smooth), transform var(--transition-bounce);
}

.service-card:hover::after {
  opacity: 0.25;
  transform: translate(15px, 15px);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #eaf6fa;
  color: var(--tidal-blue);
  margin-bottom: 20px;
}

.service-card h3 {
  margin-bottom: 10px;
}

.service-card p {
  color: var(--text-muted);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* --- Approach Section --- */
.approach {
  background: var(--white);
  position: relative;
}

.approach-wave-bottom {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.approach-wave-bottom svg {
  display: block;
  width: 100%;
  height: auto;
}

.approach-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.approach-step {
  flex: 1 1 220px;
  max-width: 260px;
  text-align: center;
  position: relative;
}

.approach-step::after {
  content: '';
  position: absolute;
  top: 36px;
  right: -30px;
  width: 40px;
  height: 2px;
  background: var(--seafoam);
}

.approach-step:last-child::after {
  display: none;
}

.approach-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--deep-ocean);
  color: var(--seafoam);
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 auto 20px;
  letter-spacing: -0.02em;
}

.approach-step h4 {
  margin-bottom: 8px;
}

.approach-step p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* --- Contact Section --- */
.contact {
  background: var(--navy);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.contact .section-label {
  color: var(--seafoam);
}

.contact .section-heading {
  color: var(--white);
}

.contact .section-heading span {
  color: var(--seafoam);
}

.contact .section-lede {
  color: var(--sand);
}

.contact-wave-top {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.contact-wave-top svg {
  display: block;
  width: 100%;
  height: auto;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--sand);
}

.contact-info-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--seafoam);
}

.contact-info-item strong {
  display: block;
  color: var(--white);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-address {
  font-style: normal;
  line-height: 1.6;
  color: var(--sand);
}

/* Contact Form */
.contact-form {
  background: rgba(10, 61, 98, 0.4);
  border: 1px solid rgba(126, 216, 196, 0.2);
  border-radius: var(--radius-lg);
  padding: 36px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--seafoam);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(126, 216, 196, 0.3);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--seafoam);
  box-shadow: 0 0 0 3px rgba(126, 216, 196, 0.25);
}

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

.form-submit {
  width: 100%;
  justify-content: center;
  padding: 16px 28px;
  font-size: 1.05rem;
}

.form-feedback {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  min-height: 24px;
}

.form-feedback.success {
  color: var(--seafoam);
}

.form-feedback.error {
  color: #f4a0a0;
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(126, 216, 196, 0.15);
  padding: 48px 24px 32px;
  color: var(--sand);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.footer-branding p {
  font-size: 0.9rem;
  color: var(--sand);
  opacity: 0.85;
  max-width: 300px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand svg {
  width: 30px;
  height: 30px;
}

.footer-nav h4,
.footer-legal h4 {
  color: var(--seafoam);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-nav ul,
.footer-legal ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav a,
.footer-legal a {
  color: var(--sand);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-nav a:hover,
.footer-legal a:hover {
  color: var(--seafoam);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(126, 216, 196, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--sand);
  opacity: 0.7;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- Policy Pages --- */
.policy-page {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
  background: var(--white);
}

.policy-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.policy-container h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 8px;
}

.policy-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.policy-container h2 {
  font-size: 1.4rem;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--deep-ocean);
}

.policy-container h3 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--navy);
}

.policy-container p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  margin-bottom: 16px;
}

.policy-container ul,
.policy-container ol {
  margin: 0 0 20px 24px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
}

.policy-container li {
  margin-bottom: 8px;
}

.policy-container strong {
  color: var(--navy);
}

.policy-container a {
  word-break: break-word;
}

.policy-container .contact-block {
  background: #f4f9fc;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.policy-container .contact-block p {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .services-flow {
    grid-template-columns: 1fr;
  }

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

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

  .approach-flow {
    flex-direction: column;
    align-items: center;
  }

  .approach-step {
    max-width: 320px;
  }

  .approach-step::after {
    top: auto;
    bottom: -18px;
    right: 50%;
    transform: translateX(50%) rotate(90deg);
    width: 30px;
    height: 2px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 100px 32px 32px;
    gap: 4px;
    box-shadow: -8px 0 40px rgba(6, 26, 46, 0.12);
    transition: right var(--transition-smooth);
    align-items: stretch;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
  }

  .nav-toggle {
    display: flex;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 26, 46, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
  }

  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 64px 16px;
  }

  .about-card {
    padding: 32px 20px;
  }

  .hero-content {
    padding: 60px 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .contact-form {
    padding: 24px 20px;
  }

  .service-card {
    padding: 28px 22px;
  }
}

/* --- Print --- */
@media print {
  .site-nav,
  .site-footer,
  .hero-shapes,
  .wave-divider,
  .contact-wave-top,
  .services-wave-top,
  .approach-wave-bottom,
  .hero-wave,
  .mobile-overlay,
  .nav-toggle {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .section {
    padding: 24px 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
