/* =========================================================
   Tech Solutions — techsolutions.com.pk
   Theme colours are taken from the TS logo (blue + orange).
   ========================================================= */

:root,
:root[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F4F6FA;
  --surface-2: #EAEFF6;
  --text: #0D1526;
  --muted: #4A5568;
  --border: #DDE3EC;
  --primary: #2560B0;        /* logo blue, darkened for readable text/buttons */
  --primary-ink: #FFFFFF;
  --primary-soft: #E8F0FB;
  --link: #1F56A3;
  --accent: #F39121;         /* logo orange — call-to-action buttons */
  --accent-ink: #0D1526;
  --accent-soft: #FFF2E3;
  --accent-text: #A3500B;
  --band: #0B1324;
  --band-text: #EEF2F8;
  --band-muted: #A9B4C6;
  --band-line: #26324A;
  --band-accent: #F7A23E;
  --logo-blue: #2F6DB5;
  --logo-orange: #F28A21;
  --shadow: 0 10px 30px rgba(13, 21, 38, .08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0A0F1A;
  --surface: #111A2A;
  --surface-2: #172238;
  --text: #EDF1F7;
  --muted: #A6B0C2;
  --border: #222D42;
  --primary: #5B9BE6;
  --primary-ink: #0A0F1A;
  --primary-soft: #13233F;
  --link: #7FB2F0;
  --accent: #F7A23E;
  --accent-ink: #0A0F1A;
  --accent-soft: #2A1D0E;
  --accent-text: #F7B565;
  --band: #0F1B33;
  --band-text: #EDF1F7;
  --band-muted: #A9B8CF;
  --band-line: #26375A;
  --band-accent: #F7A23E;
  --logo-blue: #4A8BD6;
  --logo-orange: #F7982F;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  transition: background-color .2s ease, color .2s ease;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--link); }
a:hover { color: var(--primary); }
h1, h2, h3, h4 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  text-align: left;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

/* Justified body text (left-aligned again on phones, see bottom) */
main p, main li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.center, .center p { text-align: center !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.eyebrow { display: inline-block; color: var(--accent-text); font-weight: 600; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.lead { font-size: 1.12rem; max-width: 720px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; max-width: 520px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 10px;
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; font-family: inherit; transition: transform .15s ease, filter .15s ease, background-color .15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { color: var(--primary-ink); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-whatsapp { background: #1FAF54; color: #FFFFFF; }
.btn-whatsapp:hover { color: #FFFFFF; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Top utility bar */
.topbar { background: var(--band); color: var(--band-muted); font-size: .88rem; }
.topbar .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 8px; padding-bottom: 8px; }
.topbar a { color: var(--band-text); text-decoration: none; }
.topbar a:hover { color: var(--band-accent); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-main { display: flex; align-items: center; gap: 18px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand .mark { width: 42px; height: 45px; }
.mark .b { fill: var(--logo-blue); }
.mark .o { fill: var(--logo-orange); }

.search { position: relative; flex: 1 1 320px; max-width: 520px; }
.search label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 14px; min-height: 46px; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .95rem; padding: 10px 0; outline: none; }
.search label:focus-within { border-color: var(--primary); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; max-height: 380px; overflow-y: auto; }
.search-results.open { display: block; }
.search-results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a small { display: block; color: var(--muted); font-size: .82rem; }
.search-results a:hover, .search-results a.active { background: var(--surface); }
.search-results .empty { padding: 10px 12px; color: var(--muted); font-size: .92rem; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--primary); }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.menu-toggle { display: none; }

/* Main nav */
.main-nav { border-top: 1px solid var(--border); }
.main-nav > .container > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.main-nav a, .main-nav button.dd-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px; color: var(--text); text-decoration: none;
  font-weight: 500; font-size: .96rem; line-height: 1.65; background: none; border: 0; font-family: inherit; cursor: pointer; border-radius: 8px;
}
.main-nav a:hover, .main-nav button.dd-btn:hover, .main-nav a[aria-current="page"] { color: var(--primary); }
.main-nav li { position: relative; }
.dd-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 300px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: none; z-index: 55;
}
.dropdown.open { display: block; }
.dropdown a { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 12px; width: 100%; }
.dropdown a small { color: var(--muted); font-weight: 400; font-size: .84rem; }
.dropdown a:hover { background: var(--surface); }
@media (hover: hover) and (min-width: 961px) {
  .main-nav li.has-dd:hover > .dropdown { display: block; }
}

/* Hero (home) */
.hero { padding: 32px 0 16px; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.hero-main { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: clamp(28px, 5vw, 60px); display: flex; flex-direction: column; justify-content: center; min-height: 400px; }
.hero-main h1 { margin: 6px 0 16px; }
.hero-main .lead { margin-bottom: 28px; }
.hero-side { display: flex; flex-direction: column; gap: 20px; }
.promo { flex: 1; border-radius: 22px; padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.promo h2 { font-size: 1.55rem; margin-bottom: 8px; }
.promo p { margin-bottom: 14px; }
.promo a.more { font-weight: 600; text-decoration: none; }
.promo-dark { background: var(--band); color: var(--band-muted); }
.promo-dark h2, .promo-dark a.more { color: var(--band-text); }
.promo-dark .eyebrow { color: var(--band-accent); }
.promo-soft { background: var(--accent-soft); }
.promo-soft a.more { color: var(--text); }

/* Category tiles */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; padding: 26px; color: var(--muted);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--muted); }
.tile .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.tile .ico svg { width: 26px; height: 26px; }
.tile h3 { margin: 0; font-size: 1.2rem; }
.tile p { margin: 0; font-size: .96rem; text-align: left; }
.tile .go { color: var(--primary); font-weight: 600; font-size: .95rem; margin-top: auto; padding-top: 6px; }

/* Service rows */
.svc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); column-gap: 40px; }
.svc-row { display: flex; gap: 18px; padding: 26px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--muted); }
.svc-row:hover { color: var(--muted); }
.svc-row:hover h3 { color: var(--primary); }
.svc-row .num { font-family: "Space Grotesk", sans-serif; color: var(--accent-text); font-weight: 700; padding-top: 2px; }
.svc-row h3 { margin: 0 0 4px; transition: color .15s; }
.svc-row p { margin: 0; text-align: left; }

/* Dark band */
.band { background: var(--band); color: var(--band-muted); }
.band h2, .band h3 { color: var(--band-text); }
.band .eyebrow { color: var(--band-accent); }
.band-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chip { border: 1px solid var(--band-line); border-radius: 14px; padding: 18px 20px; color: var(--band-text); font-weight: 500; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.step { background: var(--surface); border-radius: 16px; padding: 28px; }
.step .n { font-family: "Space Grotesk", sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 12px; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; text-align: left; }

/* Inner page hero */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 56px 0 52px; }
.breadcrumb { font-size: .9rem; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; color: var(--muted); }
.page-hero .lead { margin-bottom: 26px; }
.page-hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: center; }
.page-hero-ico { justify-self: end; width: 180px; height: 180px; border-radius: 40px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.page-hero-ico svg { width: 92px; height: 92px; }

/* Item cards (product/service detail) */
.item { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.item h3 { font-size: 1.1rem; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.item h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.item p { margin: 0; font-size: .97rem; text-align: left; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist li::before { content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232560B0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center/14px no-repeat; }
:root[data-theme="dark"] .checklist li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B9BE6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E"); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 900px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; }

/* CTA strip */
.cta { background: var(--band); border-radius: 24px; padding: clamp(28px, 5vw, 56px); display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; color: var(--band-muted); }
.cta h2 { color: var(--band-text); margin-bottom: 8px; }
.cta p { margin: 0; max-width: 620px; }

/* Quote form */
.quote-box { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: clamp(24px, 4vw, 48px); display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.contact-list { display: grid; gap: 14px; margin-top: 22px; }
.contact-list a, .contact-list div { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.contact-list svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--text); }
.field label .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .85rem; margin: 0; text-align: left; }
.form-status { display: none; padding: 14px 16px; border-radius: 10px; font-weight: 500; }
.form-status.ok { display: block; background: #E6F6EC; color: #145A2E; }
.form-status.err { display: block; background: #FDECEC; color: #8A1C1C; }
:root[data-theme="dark"] .form-status.ok { background: #0F2E1C; color: #9BE3B5; }
:root[data-theme="dark"] .form-status.err { background: #331414; color: #F5A9A9; }

/* Footer */
.site-footer { background: var(--band); color: var(--band-muted); padding: 64px 0 28px; font-size: .95rem; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--band-text); font-size: 1rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--band-muted); text-decoration: none; }
.site-footer a:hover { color: var(--band-accent); }
.site-footer .brand { color: var(--band-text); margin-bottom: 12px; }
.site-footer p { text-align: left; }
.footer-bottom { border-top: 1px solid var(--band-line); margin-top: 40px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* WhatsApp floating button */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 60px; height: 60px; border-radius: 50%;
  background: #1FAF54; color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .15s;
}
.wa-float:hover { transform: scale(1.06); color: #FFFFFF; }
.wa-float svg { width: 32px; height: 32px; }

/* 404 */
.notfound { text-align: center; padding: 120px 0; }
.notfound .code { font-family: "Space Grotesk", sans-serif; font-size: clamp(5rem, 14vw, 9rem); font-weight: 700; color: var(--primary); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .hero-grid, .band-grid, .split, .quote-box, .page-hero-grid { grid-template-columns: 1fr; }
  .page-hero-ico { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-list { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .header-main { flex-wrap: wrap; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions .btn { display: none; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav > .container > ul { flex-direction: column; align-items: stretch; padding: 8px 0 16px; }
  .main-nav a, .main-nav button.dd-btn { width: 100%; justify-content: space-between; padding: 14px 4px; font-size: 1.05rem; }
  .dropdown { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--border); border-radius: 0; margin: 0 0 8px 8px; padding: 0 0 0 8px; min-width: 0; }
  .site-header { position: static; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 56px 0; }
  .container { padding: 0 16px; }
  .grid-4, .grid-3, .grid-2, .chips, .steps.four, .form, .footer-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 0; }
  main p, main li { text-align: left; }   /* justified text leaves big gaps on narrow screens */
  .topbar .container { justify-content: center; text-align: center; }
  .topbar .container > span:last-child, .topbar .hide-sm { display: none; }
  .brand { font-size: 1.15rem; }
  .brand .mark { width: 36px; height: 38px; }
  .btn-row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .site-header .search, .header-actions, .main-nav, .wa-float, .site-footer { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
}
