:root{
  --bg:#faf8fb;
  --primary:#6c3aa5; /* purple-ish */
  --header-height:72px;
  --muted:#777;
  --card:#ffffff;
  --radius:12px;
  --container:1100px;
}

*{box-sizing:border-box}
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin:0; background:var(--bg); color:#222; -webkit-font-smoothing:antialiased;
}

.container{
  max-width:var(--container);
  margin:0 auto;
  padding:32px;
}

.site-header{
  background:transparent; position:fixed; top:0; left:0; right:0; z-index:1200; height:var(--header-height);
}

/* Header styling when the page is scrolled a bit */
.site-header.scrolled .header-inner{
  background: rgba(255,255,255,0.98); /* near-solid to improve contrast when scrolled */
  box-shadow:0 6px 22px rgba(12,12,20,0.08);
}
.site-header.scrolled .site-logo{max-height:44px; transition:max-height .18s ease}
.site-header .header-inner{transition:background .18s ease, box-shadow .18s ease}

/* Ensure page content isn't covered by the fixed header */
/* Ensure page content isn't covered by the fixed header */
main{padding-top:var(--header-height);} 

@media (max-width:480px){
  /* slightly smaller header spacing on very small screens */
  main{padding-top:56px}
}

section {
  scroll-margin-top: 120px; /* header height + small spacing */
}

.header-inner{
  display:flex; max-width: 100% !important; align-items:center; justify-content:space-between; width: 100%;
  padding:0 16px; background-color: white; box-shadow:0 2px 6px rgba(12,12,20,0.04); border-radius:0 0 var(--radius) var(--radius); height:100%;
}
.logo img{display:block}
.logo .site-logo{height:auto; max-height:56px; width:auto; display:block}
.main-nav a{margin-left:18px; text-decoration:none; color:#444}
.btn{display:inline-block; padding:10px 16px; border-radius:10px; text-decoration:none; cursor:pointer}
.btn.primary{background:var(--primary); color:#fff; box-shadow:0 6px 18px rgba(108,58,165,0.12)}
.btn.small{padding:8px 12px; font-size:14px}

/* Hero */
.hero{display:flex; align-items:center; gap:40px; padding:48px 0}
.hero-left{flex:1}
.hero-right{flex:1; display:flex; justify-content:center}
.hero h1{font-size:36px; line-height:1.05; margin:0 0 12px}
.lead{color:var(--muted); margin-bottom:18px}

/* Services */
.services{padding:48px 0}
.services-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; margin-top:18px}
.service-card{background:var(--card); padding:20px; border-radius:12px; box-shadow: 0 6px 20px rgba(12,12,20,0.04)}
.service-icon{font-size:26px}

/* Clients */
.clients{padding:30px 0; text-align:center}
.client-logos{display:flex; gap:5%; align-items:center; justify-content:center; flex-wrap:wrap; margin-top:18px}
.client img{height:50px; opacity:.9}

/* Testimonials */
.testimonials{padding:36px 0}
.testimonials-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px}
.testimonial{background:var(--card); padding:18px; border-radius:12px;}

/* Case studies */
.case-studies{padding:36px 0}
.cases-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:18px}
.case-card{display:flex; flex-direction:column; background:var(--card); border-radius:12px; overflow:hidden}
.case-card img{width:fit-content; height:150px; object-fit:cover}

/* Ensure the top of project images is visible; don't crop the top away */
.case-card img{object-position:top center; width:100%; height:180px; object-fit:cover}
.case-body{padding:14px}

/* Team */
.team{padding:36px 0}
.team-grid{display:flex; gap:18px; flex-wrap:wrap}
.team-member{width:160px; background:var(--card); padding:14px; border-radius:12px; text-align:center}
.team-member img{width:100%; height:120px; object-fit:cover; border-radius:8px}

/* Tech stack chips */
.stack-list{display:flex; gap:10px; flex-wrap:wrap}
.chip{background:#fff; padding:8px 12px; border-radius:999px; box-shadow:0 6px 14px rgba(10,10,20,0.04)}
.tech-tabs {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.tech-tab {
  background: none;
  border: none;
  font-size: 16px;
  color: #444;
  cursor: pointer;
  position: relative;
  padding-bottom: 6px;
}
.tech-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.tech-tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  margin: auto;
  height: 3px;
  background: var(--primary);
  width: 60%;
  border-radius: 3px;
}

.tech-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 24px;
  margin-top: 16px;
  justify-items: center;
}
.tech-logos.hidden {
  display: none;
}
.tech-logo img {
  max-height: 48px;
  object-fit: contain;
  max-width: 100%;
  width: auto;
}
.tech-logo span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* Prevent grid children from forcing overflow on small screens */
.tech-logos > .tech-logo{
  min-width: 0; /* allow items to shrink below intrinsic width */
  box-sizing: border-box;
}

@media (max-width:600px){
  .tech-stack{overflow-x:hidden}
}


/* Contact */
.contact-cta{display:flex; gap:28px; align-items:flex-start; padding:36px 0}
.contact-left{flex:1}
.contact-form{flex:1; display:flex; flex-direction:column; gap:10px; background:var(--card); padding:18px; border-radius:12px}
.contact-form input, .contact-form textarea{border:1px solid #eee; padding:10px; border-radius:8px}

/* Footer */
.site-footer{padding:28px 0; background:transparent; color:var(--muted); margin-top:40px}
.site-footer .container{display:flex; justify-content:space-between; align-items:center}

/* Footer grid layout */
.footer-grid{display:grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap:20px; align-items:start; padding:36px 0}
.footer-about .site-logo{max-height:48px}
.footer-about p{margin-top:12px}
.footer-links-col h4, .footer-contact h4, .footer-social h4{margin:0 0 8px 0}
.footer-links-col ul{list-style:none; padding:0; margin:0}
.footer-links-col ul li{margin:8px 0}
.footer-links-col a, .footer-contact a, .footer-social a{color:var(--muted); text-decoration:none}
.footer-social .social-icons{display:flex; gap:12px; align-items:center}
.footer-bottom{display:flex; justify-content:space-between; align-items:center; border-top:1px solid rgba(12,12,20,0.04); padding-top:14px; margin-top:18px}
.footer-bottom p{margin:0}

@media (max-width:900px){
  .footer-grid{grid-template-columns:1fr; gap:12px}
  .footer-bottom{flex-direction:column; gap:8px; align-items:flex-start}
  .site-footer .container{display:block}
}

/* Responsive */
@media (max-width:900px){
  .hero{flex-direction:column; text-align:center}
  .contact-cta{flex-direction:column}
  .team-grid{justify-content:center}
}

/* Ensure the contact form fits on narrow screens */
@media (max-width:600px){
  .contact-form{width:100%; padding:12px; border-radius:10px}
  .contact-form input, .contact-form textarea, .contact-form button{width:100%; box-sizing:border-box}
  .contact-form textarea{min-height:120px}
}

/* Contact flash messages - modern, responsive, accessible */
.contact-flash{
  display:block;
  width:100%;
  box-sizing:border-box;
  padding:18px 20px;
  border-radius:10px;
  font-size:16px;
  line-height:1.4;
  box-shadow: 0 8px 26px rgba(16,24,40,0.06);
  border: 1px solid rgba(16,24,40,0.06);
}
.contact-flash.success{
  background: linear-gradient(180deg, #f3fff6 0%, #eefbf1 100%);
  border-color: rgba(34,139,86,0.12);
  color: #165c36;
}
.contact-flash.error{
  background: linear-gradient(180deg, #fff6f6 0%, #fff0f0 100%);
  border-color: rgba(220,38,38,0.12);
  color: #7a1f1f;
}
.contact-flash.info{
  background: linear-gradient(180deg, #f6fbff 0%, #eef7ff 100%);
  border-color: rgba(59,130,246,0.12);
  color: #083366;
}

/* Small tweaks for mobile */
@media (max-width:600px){
  .contact-flash{padding:14px; font-size:15px}
}

/* Responsive header/nav */
.nav-toggle{
  display:none;
  background:transparent;
  border:0;
  width:44px;
  height:44px;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.nav-toggle .hamburger{
  display:block;
  width:22px;
  height:2px;
  background:var(--primary);
  position:relative;
  border-radius:2px;
}
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after{
  content:"";
  position:absolute;
  left:0;
  width:22px;
  height:2px;
  background:var(--primary);
  border-radius:2px;
  transition:transform .25s ease, top .25s ease, opacity .2s ease;
}
.nav-toggle .hamburger::before{top:-7px}
.nav-toggle .hamburger::after{top:7px}

/* Mobile: hide desktop nav and show toggle */
@media (max-width:900px){
  .header-inner{align-items:center}
  .logo img{height:48px}
  .main-nav{display:flex; gap:12px; align-items:center}
  .main-nav a{white-space:nowrap}
  .nav-toggle{display:flex}
  /* Hide desktop nav links by default on narrow screens; show on toggle open */
  .main-nav{display:none;}
  /* base (hidden) menu styles - positioned and ready to animate */
  .main-nav{
    position:absolute;
    left:0; right:0;
    top:100%; /* anchor directly below header-inner */
    margin:0 auto;
    background:var(--card);
    flex-direction:column;
    gap:8px;
    padding:0 16px; /* animated via open state */
    box-shadow:0 10px 30px rgba(12,12,20,0.08);
    border-radius:0 0 12px 12px;
    align-items:center;
    z-index:60;
    overflow:hidden;
    max-height:0;
    transition: max-height .32s cubic-bezier(.2,.9,.2,1), padding .25s ease;
  }

  /* open state: reveal with max-height */
  .main-nav.open{
    display:flex;
    padding:18px 16px;
    max-height:600px; /* large enough to show menu contents */
  }

  .main-nav.open a.nav-contact{margin-top:8px; margin-bottom:0; align-self:stretch}
  .main-nav.open a.nav-contact{margin-top:auto}
  .main-nav.open a{display:block; width:100%; text-align:center; padding:8px 6px}
  /* move Contact button to below header when nav is open */
  .header-inner > a.btn.small{order:3}
}

/* Nav toggle active state transforms hamburger into X */
.nav-toggle[aria-expanded="true"] .hamburger{background:transparent}
.nav-toggle[aria-expanded="true"] .hamburger::before{transform:rotate(45deg); top:0}
.nav-toggle[aria-expanded="true"] .hamburger::after{transform:rotate(-45deg); top:0}

/* Header controls positioning (for right-corner toggle) */
  .header-controls{display:flex; align-items:center; margin-left:auto}

/* give the nav toggle a small right margin so it's not flush to the edge */
.nav-toggle{margin-right:8px}

/* Put the nav-toggle on the right corner visually */
@media (max-width:900px){
  .header-inner{position:relative}
  .header-controls{position:absolute; right:12px; top:50%; transform:translateY(-50%);}
}

/* Readable max width for sections and responsive images */
.container{max-width:var(--container); margin:0 auto; padding:24px}
section.container, .hero.container{padding-left:16px; padding-right:16px}
section, .container, .case-card, .service-card{box-sizing:border-box}
.hero img, .case-card img, .team-member img{max-width:100%; height:auto; display:block}

/* Ensure content doesn't touch edges on small screens */
@media (max-width:900px){
  .container{padding-left:18px; padding-right:18px}
  section{padding-left:12px; padding-right:12px}
}

/* Services: icon and title on a single row; description on its own row */
.service-card{
  display:block; /* stack: header row then description */
}
.service-card > .service-icon{
  font-size:28px;
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#fff,#f8f6ff);
  border-radius:8px;
  vertical-align:middle;
}
.service-card > h3{
  display:inline-block;
  margin:0 0 0 10px;
  vertical-align:middle;
  font-size:18px;
  line-height:1.1;
}
.service-card > p{
  margin-top:10px;
  margin-bottom:0;
  color:var(--muted);
}

/* Clients grid: each client in a centered cell */
.client-logos{display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px; align-items:center}
.client{display:flex; flex-direction:column; align-items:center; justify-content:center; background:transparent; padding:8px}
.client img{max-width:100%; height:48px; object-fit:contain}

/* Projects (case studies) spacing and width */
.case-studies .cases-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px}
.case-card{padding:0; background:var(--card)}
.case-card img{width:100%; height:150px; object-fit:cover}

/* Tech stack dropdown for mobile */
.tech-stack .tech-dropdown{display:none}
@media (max-width:900px){
  /* hide the tab buttons and show the dropdown in their place */
  .tech-stack .tech-tabs{display:none}
  /* don't hide the logo groups globally; JS will toggle .hidden */
  .tech-stack .tech-dropdown{display:block; margin-top:12px}
  .tech-stack .tech-dropdown select{width:100%; padding:10px; border-radius:8px; border:1px solid #e6e6ee}
}


