/* ============================================
   CAPSULENT — Global Styles
   Clean & Scientific Aesthetic
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Brand Colors — derived from Capsulent's existing teal/green identity */
  --primary: #0a7e6e;
  --primary-dark: #065f53;
  --primary-light: #e6f5f2;
  --primary-glow: rgba(10, 126, 110, 0.08);

  --accent: #1ba68c;
  --accent-light: #22c9a8;

  /* Neutrals */
  --white: #ffffff;
  --off-white: #f8fafb;
  --gray-50: #f1f4f6;
  --gray-100: #e2e7eb;
  --gray-200: #c5cdd4;
  --gray-400: #8a96a3;
  --gray-600: #4d5966;
  --gray-800: #1e2a36;
  --gray-900: #0f1820;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sizing */
  --max-width: 1200px;
  --section-pad: 100px;
  --nav-height: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 40px rgba(10, 126, 110, 0.12);

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--white);
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--primary-dark);
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  color: var(--gray-600);
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.8;
}

.text-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-pad) 0;
}

.section--gray {
  background: var(--off-white);
}

.section--dark {
  background: var(--gray-900);
  color: var(--white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section--dark p {
  color: var(--gray-200);
}

.section-header {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-header.centered {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-header .text-label {
  margin-bottom: 12px;
  display: block;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.1rem;
}

/* --- Grid System --- */
.grid {
  display: grid;
  gap: 32px;
}

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

@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid--3, .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
  transition: box-shadow 0.3s var(--ease);
}

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

.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__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.nav__logo svg {
  width: 32px;
  height: 32px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s var(--ease);
  position: relative;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--gray-900);
}

.nav__links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

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

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 1px;
  transition: all 0.3s var(--ease);
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 24px;
    gap: 24px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__links a {
    font-size: 1.2rem;
  }

  .nav__links .btn {
    width: 100%;
    text-align: center;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(10, 126, 110, 0.25);
}

.btn--primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(10, 126, 110, 0.35);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

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

.btn--ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 12px 16px;
}

.btn--ghost:hover {
  color: var(--primary);
}

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

.btn--white:hover {
  background: var(--off-white);
  transform: translateY(-1px);
}

.btn--sm {
  padding: 8px 20px;
  font-size: 0.825rem;
}

.btn--lg {
  padding: 16px 36px;
  font-size: 1rem;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all 0.3s var(--ease);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--primary);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Stats Bar --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.stat {
  text-align: center;
  padding: 40px 24px;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.stat:last-child {
  border-right: none;
}

.stat__number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: -0.03em;
}

.stat__label {
  font-size: 0.875rem;
  color: var(--gray-200);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .stat:nth-child(odd) {
    border-right: 1px solid rgba(255,255,255,0.1);
  }
  .stat:nth-child(even) {
    border-right: none;
  }
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + 80px);
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(160deg, var(--primary-light) 0%, var(--white) 50%, var(--off-white) 100%);
  z-index: 0;
}

.hero__bg::after {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,126,110,0.06) 0%, transparent 70%);
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero__content {
  max-width: 720px;
}

.hero .text-label {
  margin-bottom: 16px;
  display: inline-block;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--primary);
}

.hero p.hero__sub {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--gray-600);
  max-width: 580px;
  margin-bottom: 36px;
}

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

/* Visual element for hero */
.hero__visual {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  height: 480px;
  opacity: 0.15;
}

/* --- Feature Split (text + visual side by side) --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse > * {
  direction: ltr;
}

.split__content .text-label {
  margin-bottom: 12px;
  display: block;
}

.split__content h2 {
  margin-bottom: 16px;
}

.split__content p {
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.split__visual {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .split, .split--reverse {
    grid-template-columns: 1fr;
    gap: 40px;
    direction: ltr;
  }
}

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

.process__step {
  counter-increment: step;
  position: relative;
  padding: 32px 24px;
}

.process__step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-light);
  line-height: 1;
  margin-bottom: 16px;
  display: block;
}

.process__step h4 {
  margin-bottom: 8px;
}

.process__step p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .process {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* --- Team --- */
.team-card {
  text-align: center;
  padding: 40px 32px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease);
}

.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.team-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--gray-50));
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.team-card h3 {
  margin-bottom: 4px;
}

.team-card__role {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

.team-card p {
  font-size: 0.9rem;
}

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.cta-banner::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.cta-banner h2 {
  color: var(--white);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.cta-banner p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto 32px;
  position: relative;
  z-index: 1;
}

.cta-banner .btn {
  position: relative;
  z-index: 1;
}

/* --- Footer --- */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 64px 0 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer__brand p {
  font-size: 0.9rem;
  color: var(--gray-400);
  max-width: 280px;
  margin-top: 12px;
}

.footer h4 {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 10px;
}

.footer ul a {
  color: var(--gray-400);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.footer ul a:hover {
  color: var(--white);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer__bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .cta-banner {
    padding: 40px 24px;
  }
  .section {
    padding: 64px 0;
  }
  .section-header {
    margin-bottom: 36px;
  }
}

/* --- Product Cards --- */
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s var(--ease);
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-card__image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary-light), var(--off-white));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.product-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(rgba(10,126,110,0.03) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
}

.product-card__body {
  padding: 28px;
}

.product-card__body h3 {
  margin-bottom: 8px;
}

.product-card__body p {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* --- Feature List --- */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 0.95rem;
  color: var(--gray-600);
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

/* --- Contact Form --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* --- Utilities --- */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }

.text-center { text-align: center; }
.text-primary { color: var(--primary); }

/* Scroll offset for anchor links */
[id] {
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

/* Subtle animation on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* Molecule background decoration */
.molecule-bg {
  position: relative;
}

.molecule-bg::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px dashed var(--gray-100);
  top: 50%;
  right: -200px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Inline icon helper */
.inline-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

/* --- Image-enhanced Hero --- */
.hero--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-height));
}

.hero--split .hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 64px 80px 0;
}

.hero--image {
  position: relative;
  overflow: hidden;
}

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

@media (max-width: 768px) {
  .hero--split {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero--split .hero__content {
    padding: 40px 0;
  }
  .hero--image {
    height: 300px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
  }
}

/* --- Photo product cards --- */
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.product-card__image {
  position: relative;
}

.product-card__image::after {
  display: none;
}

.product-card__image--photo {
  background: none;
}

.product-card__image--photo::after {
  display: none;
}

/* --- Section with background image --- */
.section--image-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section--image-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 32, 0.75);
  z-index: 0;
}

.section--image-bg .container {
  position: relative;
  z-index: 1;
}

/* --- Split visual with image --- */
.split__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.split__visual--img {
  padding: 0;
  overflow: hidden;
}

.split__visual--img img {
  border-radius: var(--radius-lg);
}

/* --- Team card with photo --- */
.team-card__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-md);
}

/* --- Hero with right-side image overlay --- */
.hero--with-image {
  position: relative;
}

.hero__image-side {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  overflow: hidden;
}

.hero__image-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__image-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--white) 0%, rgba(255,255,255,0.3) 40%, transparent 100%);
  z-index: 1;
}

@media (max-width: 1024px) {
  .hero__image-side {
    display: none;
  }
}

/* --- Inline image row --- */
.image-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.image-row img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
}

@media (max-width: 768px) {
  .image-row {
    grid-template-columns: 1fr;
  }
}

/* --- Photo overlay for product detail headers --- */
.product-detail__header--photo {
  position: relative;
  min-height: 180px;
  padding: 0;
  overflow: hidden;
}

.product-detail__header--photo img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.product-detail__header--photo .product-detail__header-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
}

.product-detail__header--photo h3 {
  color: white;
}

.product-detail__header--photo p {
  color: rgba(255,255,255,0.85);
}
