/* ==========================================================================
   main.css — design system, layout, nav, footer, buttons
   Loaded by every page. This file is the only CSS that knows about the
   site's overall look. Page-specific files (home.css, etc.) only add
   page-specific sections on top of this.
   ========================================================================== */

/* ---------- 1. Design tokens (colors, spacing, type) ---------- */
:root {
  /* Brand */
  --c-primary:        #2563eb;   /* blue-600 */
  --c-primary-dark:   #1d4ed8;   /* blue-700 */
  --c-primary-light:  #dbeafe;   /* blue-100 */
  --c-primary-text:   #1e3a8a;   /* blue-900 */

  /* Accents (used for service cards, tags) */
  --c-blue:    #2563eb;
  --c-green:   #10b981;
  --c-purple:  #8b5cf6;
  --c-orange:  #f97316;
  --c-indigo:  #6366f1;
  --c-teal:    #14b8a6;

  /* Neutrals */
  --c-bg:        #ffffff;
  --c-bg-alt:    #f9fafb;        /* gray-50 */
  --c-bg-dark:   #1f2937;        /* gray-800 footer */
  --c-border:    #e5e7eb;        /* gray-200 */
  --c-text:      #111827;        /* gray-900 */
  --c-text-soft: #4b5563;        /* gray-600 */
  --c-text-mute: #9ca3af;        /* gray-400 */

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing (8pt grid) */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-6:  1.5rem;
  --s-8:  2rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-24: 6rem;

  /* Layout */
  --container-max: 1200px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.05);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--s-4); line-height: 1.25; font-weight: 700; color: var(--c-text); }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p  { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.5rem; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-12) 0; }

/* ---------- 3. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-6);
}
.section { padding: var(--s-16) 0; }
.section--alt { background: var(--c-bg-alt); }
.section--dark {
  background: var(--c-bg-dark);
  color: #f9fafb;
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }

.section__head { text-align: center; max-width: 720px; margin: 0 auto var(--s-12); }
.section__title { margin-bottom: var(--s-3); }
.section__sub { color: var(--c-text-soft); font-size: 1.125rem; }

.grid { display: grid; gap: var(--s-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (min-width: 768px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 4. Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-6);
  max-width: var(--container-max);
  margin: 0 auto;
}
.nav__brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.nav__brand:hover { text-decoration: none; }
.nav__brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-primary);
  display: inline-block;
}
.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  width: 40px; height: 40px;
  cursor: pointer;
  color: var(--c-text);
}
.nav__toggle:hover { background: var(--c-bg-alt); }
.nav__toggle-icon { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .nav__toggle { display: none; }
}
.nav__list {
  display: none;
  list-style: none;
  margin: 0; padding: 0;
  gap: var(--s-6);
  align-items: center;
}
@media (min-width: 900px) {
  .nav__list { display: flex; }
}
.nav__link {
  color: var(--c-text-soft);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--s-2) 0;
  border-bottom: 2px solid transparent;
}
.nav__link:hover { color: var(--c-text); text-decoration: none; }
.nav__link.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* Mobile drawer */
.nav__list--open {
  display: flex;
  position: absolute;
  top: 100%; left: 0; right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  padding: var(--s-4) var(--s-6);
  box-shadow: var(--shadow-md);
}
.nav__list--open .nav__link {
  display: block;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-border);
}
.nav__list--open .nav__link:last-child { border-bottom: 0; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); }
.btn--outline { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn--outline:hover { background: var(--c-primary); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-text); }
.btn--ghost:hover { background: var(--c-bg-alt); }
.btn--lg { padding: 0.9rem 1.6rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--disabled,
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn--disabled::after,
.btn[aria-disabled="true"]::after {
  content: " · Coming soon";
  font-weight: 400;
  opacity: .85;
  font-size: 0.85em;
}

/* ---------- 6. Cards (generic) ---------- */
.card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d1d5db; }
.card__title { margin-bottom: var(--s-2); }
.card__sub { color: var(--c-primary); font-weight: 600; font-size: 0.9rem; margin-bottom: var(--s-3); }
.card__body { color: var(--c-text-soft); flex: 1; }
.card__foot { margin-top: var(--s-4); }

/* ---------- 7. Tags / pills ---------- */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--c-primary-light);
  color: var(--c-primary-text);
  margin-right: var(--s-1);
  margin-bottom: var(--s-1);
}

/* ---------- 8. Footer ---------- */
.footer {
  background: var(--c-bg-dark);
  color: #d1d5db;
  padding: var(--s-12) 0 var(--s-6);
  margin-top: var(--s-16);
}
.footer a { color: #d1d5db; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer__cols {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: 1fr;
  margin-bottom: var(--s-8);
}
@media (min-width: 700px) {
  .footer__cols { grid-template-columns: 2fr 1fr 1fr; }
}
.footer__col h4 { color: #fff; margin-bottom: var(--s-3); font-size: 1rem; }
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: var(--s-2); }
.footer__bottom {
  border-top: 1px solid #374151;
  padding-top: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: center;
  text-align: center;
  font-size: 0.875rem;
  color: var(--c-text-mute);
}
@media (min-width: 700px) {
  .footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer__socials { display: flex; gap: var(--s-4); }
.footer__socials a { display: inline-flex; align-items: center; gap: var(--s-1); }
.footer__email,
.footer__phone { color: #d1d5db; }

/* ---------- 9. Utilities ---------- */
.text-center { text-align: center; }
.muted { color: var(--c-text-soft); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--s-2); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.mb-8 { margin-bottom: var(--s-8); }
.mt-8 { margin-top: var(--s-8); }
.mt-12 { margin-top: var(--s-12); }
.hidden { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- 10. Scroll-reveal (used by main.js) ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
