/* =========================
   GLOBAL RESET
   ========================= */

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

/* smooth scrolling for in-page actions */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  background: #ffffff;
}

/* =========================
   LAYOUT
   ========================= */

.container {
  max-width: 1100px;
  margin: auto;
  padding: 0 20px;
}

.narrow {
  max-width: 700px;
}

/* =========================
   HEADER (MATCHES INDEX.HTML)
   ========================= */

.site-header {
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.site-header .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo {
  height: 70px;
  width: auto;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-name span {
  color: #2563eb;
}

/* Navigation */
.site-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav-link:hover {
  color: #2563eb;
}

/* Active page */
.nav-link.active {
  color: #2563eb;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: #2563eb;
  border-radius: 2px;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 8px;
  z-index: -1;
}

/* Contact CTA */
.nav-cta {
  padding: 8px 18px;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.nav-cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

.nav-cta.active::before {
  display: none;
}

/* =========================
   HERO
   ========================= */

.hero {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.hero-content {
  position: relative;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
}

.hero h1 span {
  color: #2563eb;
}

.hero p {
  max-width: 600px;
  font-size: 1.1rem;
  color: #475569;
  margin-bottom: 24px;
}

/* =========================
   SECTIONS
   ========================= */

.section {
  padding: 40px 0;
}

.section-intro {
  padding: 35px 0 15px 0;
}

.section-soft {
  background: #f8fafc;
}

.section-cta {
  background: linear-gradient(to right, #eff6ff, #f8fafc);
  text-align: center;
}

.section-title {
  margin-bottom: 40px;
}

.lead {
  margin-top: 18px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #475569;
}

/* =========================
   FEATURES (INDEX)
   ========================= */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  padding: 40px 0;
  align-items: stretch;
}

.feature {
  background: #ffffff;
  padding: 28px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
}

/* Feature images */
.feature-media {
  overflow: hidden;
  border-radius: 12px;
}

.feature-media img {
  width: 100%;
  height: auto;
  display: block;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* =========================
   ABOUT PAGE
   ========================= */

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-grid.reverse {
  grid-template-columns: 1fr 1.2fr;
}

.about-image img {
  width: 100%;
  border-radius: 16px;
  background: #f1f5f9;
}

.about-text p {
  margin-bottom: 18px;
  max-width: 520px;
}

/* Values */
.values-section {
  background: #f8fafc;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.value-card {
  background: #ffffff;
  padding: 28px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.16);
}

.value-card p {
  margin-top: 8px;
}

/* =========================
   FOOTER / CTA
   ========================= */

.about-cta {
  text-align: center;
  background: linear-gradient(to right, #eff6ff, #f8fafc);
}

/* =========================
   BUTTONS
   ========================= */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

/* =========================
   PAGE SECTION
   ========================= */

.page {
  padding: 60px 0;
}

/* =========================
   SERVICES GRID
   ========================= */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: stretch;
  max-width: 1000px;
  margin: 0 auto;
}

.service-card {
  background: #eef6ff; /* light blue card background */
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  overflow: hidden;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), box-shadow 280ms cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  will-change: transform, box-shadow;
  --reveal-height: 160px;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
}

.service-image {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: #f1f5f9;
}

/* Compact services section: smaller vertical area and lift grid upward */
.section--compact {
  padding: 24px 0 20px;
}

.section--compact .services-grid {
  margin-top: -24px;
}

/* utility to center intro headings */
.intro-center {
  text-align: center;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms cubic-bezier(.2,.8,.2,1);
}

.service-card:hover .service-image img {
  transform: scale(1.03);
}

/* Card accents and structure */
.service-card {
  position: relative;
}

.service-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 6px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: linear-gradient(90deg, rgba(37,99,235,0.95), rgba(99,102,241,0.95));
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), opacity 320ms ease;
}

.service-card:hover::before {
  transform: scaleX(1.01);
}

.service-image {
  position: relative;
}

.service-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.12), rgba(37,99,235,0));
  opacity: 1;
  transition: opacity 320ms cubic-bezier(.2,.8,.2,1), transform 320ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}

.service-card:hover .service-image::after {
  opacity: 0.45;
  transform: translateY(-4px) scale(1.01);
}

.service-card h3 {
  padding: 20px 24px 8px 24px;
  margin: 0;
  font-size: 1.12rem;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.service-card p {
  padding: 0 24px 20px 24px;
  margin: 0;
  color: #475569;
  flex-grow: 1;
  line-height: 1.5;
  font-size: 0.98rem;
}

/* Expanded inline content for service cards (Apple-style expanding) */
/* Inline content now appears as a seamless bottom reveal overlay inside the card */
.expanded-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff; /* fully opaque to hide content beneath */
  backdrop-filter: blur(6px);
  padding: 0 24px;
  transform: translateY(var(--reveal-height));
  opacity: 0;
  pointer-events: none;
  transition: transform 360ms cubic-bezier(.2,.8,.2,1), opacity 300ms ease, padding 300ms ease;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  z-index: 30;
}

.card-toggle {
  display: inline-block;
  margin: 12px 24px 20px 24px;
  background: transparent;
  border: 1px solid rgba(15,23,42,0.06);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.service-card.expanded {
  /* keep card in-flow, just lift slightly and reveal overlay */
  box-shadow: 0 18px 46px rgba(15,23,42,0.09);
  transform: translateY(-3px);
  z-index: 30;
}

.service-card.expanded .expanded-content {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  padding-top: 14px;
  padding-bottom: 20px;
}

/* move the card's visible content upward to reveal the expanded area beneath */
.service-card > .service-image,
.service-card > h3,
.service-card > p {
  transition: transform 360ms cubic-bezier(.2,.8,.2,1), opacity 260ms ease;
}

.service-card.expanded > .service-image,
.service-card.expanded > h3,
.service-card.expanded > p {
  transform: translateY(calc(-1 * var(--reveal-height)));
  opacity: 0; /* fade out top content so underlying text isn't visible */
}

/* ensure the overlay doesn't hide the heading — make space inside the card */
.service-card h3,
.service-card p {
  position: relative;
  z-index: 2;
}

.service-card .service-image {
  z-index: 1;
}

@media (max-width: 880px) {
  .service-card.expanded {
    grid-column: 1 / -1;
  }
}

/* subtle CTA area inside card (optional) */
.service-card .card-cta {
  padding: 16px 24px 24px 24px;
  text-align: left;
}

/* Responsive: reduce image height on small screens */
@media (max-width: 640px) {
  .service-image {
    height: 220px;
  }
  .section--compact {
    padding-top: 24px;
  }
}

/* Modal: small window for service details */
/* Modal styles removed — using inline expanded content only */

/* =========================
   CONTACT PAGE
   ========================= */

.contact-hero {
  padding: 24px 0 6px;
}

.contact-hero-text h1 {
  margin: 0 0 8px 0;
  font-size: 2rem;
}

.contact-section {
  padding: 60px 20px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 0.5fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* LEFT SIDE */
.contact-form-card {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.contact-form h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: #0f172a;
}

.contact-form .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  margin-bottom: 14px;
}

.required-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
}

.required-indicator {
  color: #dc2626;
  font-weight: bold;
  margin-right: 2px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e3e8f5;
  background: #fbfdff;
  color: #0f172a;
  font-size: 0.95rem;
  box-shadow: none;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 6px 18px rgba(37,99,235,0.08);
}

.form-field textarea {
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #0f172a;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.form-actions {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

/* RIGHT SIDE */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.info-card h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.info-card p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

.info-card a {
  color: #2563eb;
  text-decoration: none;
}

.info-card a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .contact-section {
    padding: 60px 20px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-form-card {
    padding: 30px;
  }

  .contact-info {
    gap: 20px;
  }
}
/* --- Form Validation --- */

.input-error {
  border: 2px solid #dc2626 !important;
}

.field-error-text {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 6px;
  display: block;
}

.char-counter {
  font-size: 0.8rem;
  margin-top: 6px;
  text-align: right;
  color: #64748b;
}

/* =========================
   Case Study Styling
   ========================= */

/* Section spacing refinement */
.section h2,
.section h3 {
  margin-top: 48px;
}

.section p {
  line-height: 1.6;
}

.section ul,
.section ol {
  margin: 16px 0 24px 20px;
}

/* Before / After Grid */
.analysis-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  margin: 32px 0;
}

.analysis-block {
  background: #f8fafc;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.analysis-block h4 {
  margin-bottom: 16px;
  font-weight: 600;
  color: #0f172a;
}

.analysis-block ul {
  margin-left: 20px;
}

/* KPI Snapshot Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.kpi-card {
  background: #ffffff;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  text-align: center;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
}

.kpi-card h4 {
  font-size: 28px;
  margin-bottom: 8px;
  color: #0f172a;
}

.kpi-card p {
  font-size: 14px;
  color: #64748b;
}

/* Dashboard Preview */
.dashboard-preview {
  margin: 32px 0;
}

.dashboard-preview img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}

/* Case Study CTA */
.case-cta {
  margin-top: 56px;
  padding: 40px 32px;
  background: #f1f5f9;
  border-radius: 14px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.case-cta p {
  margin-bottom: 20px;
  font-weight: 500;
}

/* Form Success Message */
.form-success {
  padding: 30px;
  background: #f4f8ff;
  border-radius: 8px;
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.form-success h3 {
  margin-bottom: 10px;
  color: #0f172a;
}

.form-success p {
  color: #475569;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Body layout for footer */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main,
section {
  flex-shrink: 0;
}

/* Contact hero refinement */
.contact-hero h1 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.contact-hero .lead {
  margin: 0;
  font-size: 1rem;
  max-width: 600px;
}

/* Textarea sizing */
textarea {
  min-height: 120px;
  resize: none;
}

#messageBox {
  /* Fixed height sized for ~500 chars, non-resizable; scrolls internally */
  height: 160px;
  max-height: 160px;
  overflow: auto;
  resize: none;
}

/* Footer tighter */
.site-footer {
  margin-top: auto;
  padding: 18px 0;
}

/* =========================
   ELITE CONTACT EXPERIENCE
   ========================= */

body {
  background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 40%);
}

/* Compact hero */
.section-intro {
  padding: 30px 0 10px 0;
}

.contact-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.contact-hero .lead {
  font-size: 1rem;
  color: #475569;
  max-width: 550px;
  margin-bottom: 0;
}

/* Grid refinement */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 32px;
  align-items: start;
  padding-bottom: 40px;
}

/* Glass-style form card */
.contact-form-card {
  background: #ffffff;
  padding: 28px;
  border-radius: 14px;
  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.05),
    0 2px 6px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-form-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 35px rgba(15, 23, 42, 0.08),
    0 4px 10px rgba(15, 23, 42, 0.05);
}

/* Form inputs refined */
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Compact textarea */
#messageBox {
  min-height: 110px;
}

/* Button upgrade */
.btn-primary {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);
}

/* Info sidebar refinement */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 12px;
  box-shadow:
    0 6px 18px rgba(15, 23, 42, 0.05);
}

.info-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.info-card p {
  font-size: 0.9rem;
  color: #475569;
  margin: 0;
}

/* Smooth success message */
.form-success {
  padding: 30px;
  background: #f0f9ff;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
  padding: 20px 0;
}
.contact-form {
  transition: opacity 0.2s ease;
}

.form-success {
  padding: 30px;
  background: #f0f9ff;
  border-radius: 12px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lock page scrolling for contact page while keeping content area usable */
body.no-scroll {
  height: 100vh;
  overflow: hidden;
}

/* Only the message textarea should scroll on the contact page; main/section remain fixed */
body.no-scroll main,
body.no-scroll section {
  overflow: visible;
}

/* Compact overrides for contact page when scrolling is locked */
body.no-scroll .logo {
  height: 56px;
}

body.no-scroll .contact-hero {
  padding: 12px 0 4px;
}

body.no-scroll .contact-hero-text h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

body.no-scroll .contact-hero .lead {
  font-size: 0.95rem;
  max-width: 520px;
}

body.no-scroll .contact-grid {
  gap: 14px;
  grid-template-columns: 1fr 0.95fr;
  max-width: 980px;
  padding-bottom: 12px;
}

body.no-scroll .contact-form-card {
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.04);
}

body.no-scroll .contact-form h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

body.no-scroll .form-field input,
body.no-scroll .form-field textarea {
  padding: 8px 10px;
  font-size: 0.95rem;
}

body.no-scroll #messageBox {
  height: 160px;
  max-height: 160px;
}

/* Ensure footer stays at bottom and page doesn't scroll */
body.no-scroll .site-footer {
  position: relative;
  z-index: 10;
}
