/* =========================================================
   I/O Tech Services – global.css (mobile-first)
   Purpose: Shared styles across the site for consistent UX.
   Notes:
   - Uses CSS variables for easy theming
   - Mobile-first with fluid typography & responsive grids
   - Accessible focus states and reduced-motion support
   ========================================================= */

/* ---------- CSS Variables (Theme) ---------- */
:root {
  --color-bg: #ffffff;
  --color-surface: #f7f9fb;
  --color-text: #0f172a;         /* slate-900-ish */
  --color-text-muted: #475569;    /* slate-600-ish */
  --color-primary: #1e3a8a;       /* blue-900 */
  --color-primary-contrast: #ffffff;
  --color-accent: #0ea5e9;        /* sky-500 */
  --color-border: #e2e8f0;        /* slate-200 */
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
  --radius: 14px;

  /* Typography scale (fluid from 320px to 1200px) */
  --step--1: clamp(0.85rem, 0.80rem + 0.20vw, 0.95rem);
  --step-0: clamp(1.00rem, 0.95rem + 0.30vw, 1.10rem);
  --step-1: clamp(1.25rem, 1.10rem + 0.70vw, 1.50rem);
  --step-2: clamp(1.50rem, 1.30rem + 1.00vw, 1.90rem);
  --step-3: clamp(1.90rem, 1.60rem + 1.50vw, 2.40rem);
  --step-4: clamp(2.30rem, 1.90rem + 2.00vw, 3.00rem);

  /* Layout */
  --container-max: 1200px;
  --gutter: 1rem;    /* base horizontal padding */
  --section-gap: clamp(2rem, 1.2rem + 3vw, 4rem);
}

/* Dark mode adjustments (respects user preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b1220;
    --color-surface: #0f172a;
    --color-text: #e5e7eb;
    --color-text-muted: #94a3b8;
    --color-border: #1f2937;
    --shadow-lg: 0 10px 25px rgba(0,0,0,.45);
  }
}

/* ---------- Resets / Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus styles (accessible, high contrast) */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Motion sensitivity */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Utilities ---------- */
.container {
  width: min(100% - 2*var(--gutter), var(--container-max));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-gap);
}

.hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ---------- Header & Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: saturate(180%) blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .75rem;
}

.logo img {
  height: 40px; /* Placeholder height; adjust when real logo lands */
  width: auto;
  max-width: 180px;
  display: block;
}

/* Mobile-first nav: stacked on small screens */
.main-nav ul {
  list-style: none;
  padding: 0;
  margin: .25rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
}

.main-nav a {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
}

.main-nav a:hover {
  background: var(--color-surface);
}

.main-nav a.active {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* Larger screens: horizontal nav right-aligned */
@media (min-width: 768px) {
  .main-nav ul {
    margin: 0;
    gap: .25rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(14,165,233,0.08), rgba(30,58,138,0.06));
  /* Placeholder background image:
     Add an image named 'hero-placeholder.jpg' under /images/ for a quick visual.
  */
  /*
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0)),
    url('images/hero-placeholder.jpg');  */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-text);
}

.hero::after {
  /* Subtle overlay for readability over images */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.20), rgba(0,0,0,0.10));
  z-index: -1;
}

.hero .hero-content {
  padding-block: clamp(3rem, 6vw, 7rem);
  color: #fff; /* ensure readable over overlay */
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.hero h1 {
  margin: 0 0 .75rem 0;
  font-size: var(--step-4);
  line-height: 1.1;
}

.hero p {
  margin: 0 0 1.25rem 0;
  max-width: 60ch;
  font-size: var(--step-1);
  color: #e6edf6;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  border-radius: 999px;
  padding: .75rem 1rem;
  border: 1px solid transparent;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.12); text-decoration: none; }

.btn.primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--color-primary) 88%, white);
}

.btn.secondary {
  background: var(--color-accent);
  color: #0b1220;
}

.btn.secondary:hover {
  background: color-mix(in srgb, var(--color-accent) 88%, white);
}

/* CTA group spacing */
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Logo Sizing */
.logo img {
  height: 48px;
  max-width: 220px;
}

/* ---------- Content Sections ---------- */
.why-choose-us {
  background: var(--color-surface);
}

.why-choose-us .container,
.services .container,
.industries .container,
.testimonials .container,
.cta-banner .container {
  padding-block: var(--section-gap);
}

h2 {
  font-size: var(--step-3);
  line-height: 1.15;
  margin: 0 0 .5rem 0;
}

h3 {
  font-size: var(--step-1);
  margin: 0 0 .25rem 0;
}

/* ---------- Services Grid ---------- */
.service-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
}

.card p {
  margin: .25rem 0 0 0;
  color: var(--color-text-muted);
}

/* Scale grid at larger breakpoints */
@media (min-width: 640px) {
  .service-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 960px) {
  .service-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* ---------- Industries ---------- */
.industries p {
  max-width: 85ch;
  color: var(--color-text-muted);
}

/* ---------- Testimonials ---------- */
.testimonials {
  background: var(--color-surface);
}

.testimonials blockquote {
  padding: 1rem 1.25rem;
  background: var(--color-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
}

.testimonials cite {
  display: block;
  margin-top: .5rem;
  color: var(--color-text-muted);
  font-style: normal;
  font-size: var(--step--1);
}

/* ===== Testimonials: Desktop list (default) ===== */
.testimonial-carousel {
  position: relative;
}

.testimonial {
  margin: 0 0 1rem 0;
}

/* Hide carousel controls by default (desktop/tablet) */
.carousel-btn,
.carousel-dots {
  display: none;
}

/* ===== Mobile: turn into carousel ===== */
@media (max-width: 640px) {
  .carousel-btn,
  .carousel-dots {
    display: flex;
  }

  .testimonial {
    margin: 0; /* spacing handled by carousel */
  }

  .carousel-viewport {
    overflow: hidden;
    border-radius: var(--radius);
  }

  .carousel-track {
    display: flex;
    transition: transform 220ms ease;
    will-change: transform;
  }

  .carousel-track > .testimonial {
    flex: 0 0 100%;
    margin: 0;
    /* padding: 0; */
  }

  .carousel-btn {
    position: static;
    transform: none;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .carousel-btn.prev { left: -6px; }
  .carousel-btn.next { right: -6px; }

  .carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
  }           

  .carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex: 1;
  }

  .carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    padding: 0;
  }

  .carousel-dot[aria-current="true"] {
    background: var(--color-accent);
    border-color: var(--color-accent);
  }

  .footer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;  
    line-height: 1.6;
  }

  .footer-contact .separator {
    display: none;      
  }

  .footer-contact a {
    white-space: nowrap; 
  }

}

/* ---------- CTA Banner ---------- */
.cta-banner {
  text-align: center;
  background:
    radial-gradient(1000px 400px at 50% -10%, rgba(14,165,233,0.25), transparent 60%),
    linear-gradient(180deg, rgba(30,58,138,0.10), rgba(14,165,233,0.08));
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cta-banner h2 {
  margin-bottom: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: 1.25rem;
  color: var(--color-text-muted);
}

.footer-contact a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.footer-contact a:hover {
  text-decoration: none;
  color: var(--color-primary);
  font-size: 1.2em;
  font-weight: bolder;
}

.footer-content {
  display: grid;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
}


.footer-top p {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* Bottom: keep copyright + tagline readable */
.footer-bottom {
  display: grid;
  gap: .35rem;
}

.separator {
  margin: 0 .35rem;
  color: var(--color-text-muted);
}


@media (min-width: 768px) {
  .footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .footer-top p {
    max-width: 70ch;
  }

  .footer-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
}

/* ---------- Responsive Tweaks ---------- */
/* Add breathing room between header and nav on very small screens */
@media (max-width: 389px) {
  .header-content { flex-direction: column; align-items: flex-start; }
}

/* Increase hero text width on wide screens */
@media (min-width: 1024px) {
  .hero p { max-width: 70ch; }

/* Logo Sizing */
  .logo img {
    height: 56px;
    max-width: 300px;
  }    
}


