/* ================================
   Design Tokens
================================ */
:root {
  --primary: #1863B1;
  --button-hover: #155a9e;

  --background: #ffffff;
  --text: #1c1c1c;
  --muted: #6c757d;
  --accent-bg: #f3f6f9;

  --black: #000000;
  --white: #ffffff;
  --border: #dddddd;
  --input-border: #cccccc;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 6px 18px rgba(0, 0, 0, 0.12);
  --overlay: rgba(0, 0, 0, 0.6);
  --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
  --modal-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ================================
   Base Reset
================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

/* ================================
   Header / Brand / Nav
================================ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--white);
  padding: 20px 20px;
  color: var(--black);
}

.brand { display: flex; align-items: center; gap: 15px; font-family: ProximaNova, sans-serif; }
.logo { height: 50px; display: block; }
.brand p { text-transform: uppercase; font-weight: 600; font-size: 18px; line-height: 20px; }
.brand-tagline { font-weight: 300; color: #444; }

nav { display: flex; gap: 30px; align-items: center; }
nav a {
  color: var(--black);
  font-family: ProximaNova, sans-serif;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}
nav a:hover { color: var(--primary); }

nav button, .button {
  padding: 10px 20px;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: ProximaNova, sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: var(--shadow-sm);
}
nav button:hover, .button:hover { background-color: var(--button-hover); }

/* ================================
   Sections
================================ */
section { padding: 20px 40px; margin: auto; }
section.alt { background-color: var(--accent-bg); }
section h2 { font-size: 32px; margin-bottom: 20px; }
section p { font-size: 18px; color: var(--muted); }

/* ================================
   Footer
================================ */
footer {
  background-color: var(--white);
  color: var(--black);
  text-align: center;
  padding: 30px 20px;
  font-size: 14px;
}

/* ================================
   Popup / Modal
================================ */
.popup-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.popup-overlay.active { display: flex; }

.popup {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--modal-shadow);
  position: relative;
}
.popup h2 { margin-bottom: 20px; color: var(--primary); }
.popup form label { display: block; margin-bottom: 6px; font-weight: 600; }
.popup form input,
.popup form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  font-family: inherit;
}
.popup .close-btn {
  position: absolute; top: 12px; right: 18px;
  font-size: 26px; cursor: pointer; color: #666;
}

/* ================================
   Hero Section
================================ */
.home-hero {
  padding: 0;
  margin: 0;
  width: 100%;
  height: clamp(400px, 75vh, 900px);
  overflow: hidden;
  position: relative;
}

.home-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  white-space: nowrap;
}

.hero-text p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ================================
   About Section – Split Layout
================================ */
.about-section { display: flex; align-items: center; gap: 40px; }
.about-content { flex: 1; max-width: 60%; }
.about-content h2 { margin-bottom: 20px; }
.about-content p { font-size: 18px; color: var(--black); margin-bottom: 18px; }
.about-image { display: none; }

/* ================================
   Services
================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1200px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .service-grid { grid-template-columns: 1fr; }
}

.service-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  transition: none;
}

.service-card:nth-child(2) .service-media img {
  object-fit: contain;
  padding: 12px;
}

.service-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--accent-bg);
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: none;
}

.service-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 2px 0;
  min-height: 0;
}

.service-body h3 {
  font-size: 18px;
  color: var(--text);
  margin-top: 2px;
}

.service-body p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.service-link {
  margin-top: 8px;
  font-size: 13px;
  text-decoration: none;
  color: var(--primary);
}
.service-link:hover {
  text-decoration: underline;
  color: var(--button-hover);
}

/* ================================
   Pricing Section
================================ */
.pricing-container {
  display: flex; justify-content: center; gap: 2rem; margin-top: 2rem; flex-wrap: wrap;
}
.pricing-card {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 2rem;
  width: 280px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.pricing-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.price { font-size: 2rem; font-weight: bold; margin: 1rem 0; color: var(--primary); }
.price span { font-size: 1rem; color: #666; }
.pricing-card ul { list-style: none; padding: 0; margin: 1.5rem 0; color: #555; }
.pricing-card ul li { margin: 0.5rem 0; }
.pricing-card li { white-space: nowrap; }
.pricing-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}
.pricing-btn:hover { background: var(--button-hover); }
.featured { transform: scale(1.00); }

/* ================================
   Portfolio Section (Mobile)
================================ */
#portfolio.case-studies {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Card */
.case-card {
  max-width: 100%;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 1fr;   /* single column on phones */
  gap: 20px;
  padding: 18px;
  align-items: start;
}

/* LEFT side */
.case-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-logo {
  max-width: 72px;
  height: auto;
  display: block;
}

.case-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.case-intro {
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}

/* RIGHT side – simple vertical stack on mobile */
/* Keep the desktop collage layout on mobile, but scale it down to fit */
.case-right {
  /* Desktop grid, unchanged */
  display: grid;
  grid-template-areas:
    ". desktop desktop ."
    "mobile desktop desktop ."
    "mobile providers rectangle rectangle"
    ". providers rectangle rectangle";
  grid-template-columns: 1.5fr 2.3fr 2.2fr 1fr;
  column-gap: 10px;
  row-gap: 6px;
  align-items: start;

  /* --- Scale-to-fit trick --- */
  /* Treat ~900px as the design width of the collage.
     Scale down when viewport < 900px, 1:1 otherwise. */
  --collage-base: 900; /* tweak if you want a different reference width */
  --collage-scale: min(1, calc(100vw / var(--collage-base)));
  transform: scale(var(--collage-scale));
  transform-origin: top left;

  /* Expands the box so the scaled content still uses full width */
  width: calc(100% / var(--collage-scale));
}

/* Aspect ratios (same as desktop so the composition matches) */
.desktop-web    { grid-area: desktop;   aspect-ratio: 1366 / 847; }
.mobile-web     { grid-area: mobile;    aspect-ratio: 390 / 844; }
.providers-strip{ grid-area: providers; aspect-ratio: 4 / 4; }
.rectangle-ad   { grid-area: rectangle; aspect-ratio: 1920 / 1080; }

/* Tighter cards on mobile so the mini-collage looks crisp */
.case-right .mockup {
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
}


.case-right .mockup::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.case-right .mockup:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.16), 0 4px 10px rgba(0,0,0,0.10);
}

.mockup img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Aspect ratios for consistency */
.desktop-web    { aspect-ratio: 1366 / 847; }
.mobile-web     { aspect-ratio: 390 / 844; }
.providers-strip{ aspect-ratio: 4 / 4; }
.rectangle-ad   { aspect-ratio: 16 / 9; }

/* ===== Portfolio Carousel (Mobile) ===== */
.portfolio-carousel {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  touch-action: pan-y;  /* allow vertical scroll while swiping */
}

.portfolio-carousel .viewport {
  overflow: hidden;
}

.portfolio-carousel .track {
  display: flex;
  transition: transform 0.45s ease;
  will-change: transform;
}

.portfolio-carousel .slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  padding-inline: 8px; /* small side gutter */
}

/* Arrows (touch-friendly) */
.portfolio-carousel .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.portfolio-carousel .arrow:hover {
  background: var(--button-hover);
  transform: translateY(-50%) scale(1.03);
}

.portfolio-carousel .arrow:active {
  transform: translateY(-50%) scale(0.97);
}

.portfolio-carousel .arrow.prev { left: 8px; }
.portfolio-carousel .arrow.next { right: 8px; }

/* Breathing room for the card inside slides */
.case-card { margin: 12px auto; }

/* Optional tiny-screen optimization: hide one asset to reduce scroll */
@media (max-width: 380px) {
  .providers-strip { display: none; }
}

/* ================================
   Contact Section
================================ */
.contact-inner { max-width: 920px; margin: 0 auto; text-align: center; }

.contact-item {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  line-height: 1.4;
}
.contact-item svg {
  width: 22px; height: 22px; fill: var(--text);
  flex: 0 0 22px;
}
.contact-item strong { font-weight: 700; }

.contact-divider {
  border: none;
  border-top: 1px solid var(--text);
  margin: 22px auto;
  max-width: 300px;
}

.contact-social {
  display: flex; justify-content: center; gap: 14px; align-items: center; margin-top: 20px;
}
.social {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.social svg { width: 30px; height: 30px; fill: var(--text); }
.social:hover { transform: translateY(-2px); background: var(--primary); }

/* ================================
   Responsive
================================ */
@media (max-width: 900px) {
  .about-section { flex-direction: column; }
  .about-content { max-width: 100%; }

  .home-hero { height: min(60vh, 520px); }

  .hero-text {
    width: 92vw;
    max-width: 680px;
  }

  .hero-text h1 {
    white-space: normal;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    font-size: clamp(1.7rem, 6.2vw, 2.4rem);
  }

  .hero-text p {
    font-size: clamp(1rem, 3.8vw, 1.15rem);
    margin-bottom: 0;
  }

  .hamburger {
    display: block;
    font-size: 28px;
    background: none;
    border: none;
    padding: 4px 8px;
    line-height: 1;
    cursor: pointer;
    right: 20px;
    top: 18px;
  }

  header nav { display: none; }

  .mobile-menu {
    display: none;
    position: absolute;
    right: 20px;
    top: 68px;
    background: var(--white);
    color: var(--black);
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
    padding: 12px;
    z-index: 999;
    flex-direction: column;
  }
  .mobile-menu a {
    color: var(--black);
    font-family: ProximaNova, sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 8px 6px;
  }
  .mobile-menu button {
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-family: ProximaNova, sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: var(--shadow-sm);
    background-color: var(--primary);
    margin: 8px 6px;
    padding: 5px 10px;
  }
}
