/* Import Inter + Playfair Display from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Custom Variables for Light Theme (Default) */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-rgb: 37, 99, 235;
  --accent-hover: #1d4ed8;
  --border-color: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-shadow: 0 10px 30px 0 rgba(31, 38, 135, 0.04);
  --nav-bg: rgba(248, 250, 252, 0.8);
  --glass-blur: 16px;
  --gradient-1: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --gradient-bg: radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.05) 0%, transparent 40%),
                 radial-gradient(circle at 10% 90%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* CSS Custom Variables for Dark Theme */
body.dark {
  --bg-primary: #030712;
  --bg-secondary: #0b0f19;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-rgb: 59, 130, 246;
  --accent-hover: #60a5fa;
  --border-color: #1f2937;
  --card-bg: rgba(11, 15, 25, 0.7);
  --card-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(3, 7, 18, 0.85);
  --gradient-1: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  --gradient-bg: radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 45%),
                 radial-gradient(circle at 10% 90%, rgba(37, 99, 235, 0.08) 0%, transparent 45%);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Strict 100vh lock */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
header {
  width: 100%;
  z-index: 1000;
  background-color: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem; /* Standard nav height */
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  background: transparent;
  border: none;
}

/* Logo image — only the black version is used.
   mix-blend-mode: multiply removes its white background in light mode.
   In dark mode we invert it to white, then mix-blend-mode: screen removes the black background. */
.brand-logo {
  height: 3.5rem;
  width: 3.5rem;
  object-fit: contain;
  flex-shrink: 0;
  transition: filter 0.3s ease;
  /* multiply blends the white PNG background away on any light surface */
  mix-blend-mode: multiply;
  filter: none;
}

body.dark .brand-logo {
  /* invert: black icon → white icon, white bg → black bg */
  filter: invert(1) brightness(1.15);
  /* screen blends the now-black PNG background away on dark surfaces */
  mix-blend-mode: screen;
}

/* Brand text block next to logo */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.brand-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

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

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

/* Action Buttons & Theme Toggle */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle:hover {
  background-color: var(--border-color);
  color: var(--accent);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Light / Dark display switch */
.theme-toggle .sun-icon {
  display: none;
}
.theme-toggle .moon-icon {
  display: block;
}
body.dark .theme-toggle .sun-icon {
  display: block;
}
body.dark .theme-toggle .moon-icon {
  display: none;
}

/* Main Viewport Content Area */
main {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.content-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  overflow-y: auto; /* Internal scrolling if content overflows */
  display: flex;
  align-items: center;
  padding: 2rem 0;
}

.content-view.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hero — Vercel-style dark canvas */
.hero-bg-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #050810;
  overflow: hidden;
}

/* No image overlay needed — SVG handles the visual */
.hero-bg-wrapper::before {
  display: none;
}

/* Full-bleed SVG background graphic */
.hero-vercel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Force hero content above SVG */
.hero-bg-wrapper .hero {
  position: relative;
  z-index: 1;
}

/* Text colours over dark SVG canvas */
.hero-bg-wrapper .hero-title {
  color: #ffffff;
}
.hero-bg-wrapper .hero-subtitle {
  color: rgba(255, 255, 255, 0.72);
}
.hero-bg-wrapper .btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.30);
  margin-left: 1rem;
}
.hero-bg-wrapper .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Make Explore Services look identical to Get in Touch on the dark hero */
.hero-bg-wrapper .btn-primary {
  background: transparent;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.30);
  color: #ffffff;
}
.hero-bg-wrapper .btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: none;
  box-shadow: none;
}

/* Hero Section */
.hero {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background-color: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-title span {
  /* colour is set live each frame by the neural mesh JS to match adjacent mesh lines */
  transition: color 0.1s linear;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-1);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(var(--accent-rgb), 0.4);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  margin-left: 1rem;
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Features/Services Section */
.services {
  align-items: flex-start;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}

.card-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  background-color: rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.card-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

/* Modal Windows Setup (Contact and Privacy) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(3, 7, 18, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  padding: 1.5rem;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 3rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal.open .modal-content {
  transform: scale(1);
}

.close-modal {
  /* Stays fixed at top-right of the viewport so it floats while scrolling */
  position: fixed;
  top: calc(50% - 42.5vh + 1.25rem); /* aligns with top of the 85vh modal-content */
  right: calc(50% - min(400px, 48vw) + 0.75rem); /* aligns with right edge of modal */
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-muted);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.close-modal:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

.close-modal svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* Modals Custom Scrollbar */
.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* Privacy Modal Layout (Compliance Center) */
.privacy-modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.privacy-section {
  margin-bottom: 2.5rem;
}

.privacy-section:last-child {
  margin-bottom: 0;
}

.privacy-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.privacy-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.privacy-section ul {
  list-style-type: square;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.privacy-section li {
  margin-bottom: 0.5rem;
}

/* Contact Modal Content */
.contact-modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

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

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.contact-item {
  display: flex;
  gap: 1.25rem;
}

.contact-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: rgba(var(--accent-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-details h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact-details p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  word-break: break-all;
}

.contact-details a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.contact-details a:hover {
  text-decoration: underline;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Placeholder text — more visible in dark mode */
.form-control::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
body.dark .form-control::placeholder {
  color: #6b7280; /* visible mid-grey, not washed-out white */
  opacity: 1;
}

/* Footer Section */
footer {
  width: 100%;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  height: 4.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--accent);
}

/* Dark mode logo is handled by filter:invert() on .brand-logo — no separate image needed */

/* Responsive Rules */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.75rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .modal-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.9rem;
  }
  .brand-logo {
    height: 2.75rem;
    width: 2.75rem;
  }
  .hero-title {
    font-size: 2.25rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .btn {
    width: 100%;
    margin-left: 0;
  }
  .btn-secondary {
    margin-left: 0;
    margin-top: 1rem;
  }
  .footer-container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  footer {
    height: auto;
    padding: 1rem 0;
  }
}

@media (max-width: 480px) {
  .nav-container {
    height: auto;
    padding: 0.75rem 0;
  }
  .nav-links {
    display: flex;
    gap: 0.5rem;
  }
  .nav-link {
    font-size: 0.8rem;
  }
  .brand-text {
    display: none; /* Hide brand text on very small screens */
  }
  .brand-logo {
    height: 2.5rem;
    width: 2.5rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .card {
    padding: 1.5rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
