/*
  Minimal theme
  - clean defaults, soft surfaces, simple spacing
*/

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body, h1, h2, h3, p, ul { margin: 0; }
html { scroll-behavior: smooth; }

/* Tokens */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827; /* deeper for contrast */
  --muted: #4b5563;
  --border: #e5e7eb;
  --brand: #111827;
  --primary: #1d4ed8; /* accessible blue */
  --primary-hover: #1e40af;
  --link: var(--primary);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 10px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.08);
  --section-radius: 12px;
}

/* High contrast mode */
html.contrast-high {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #000000;
  --muted: #1f2937;
  --border: #111827;
  --primary: #0b57d0; /* deeper accessible blue */
  --primary-hover: #0846a6;
  --link: var(--primary);
  --shadow: none;
  --shadow-lg: none;
}
html.contrast-high .hero::before { background: linear-gradient(to bottom, rgba(0,0,0,.65), rgba(0,0,0,.35)); }
html.contrast-high .card { border-width: 2px; }
html.contrast-high nav a.active { border-bottom-width: 4px; }

/* Base */
html { font-size: 18px; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, sans-serif;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { text-underline-offset: 3px; }

/* Large-text toggle */
html.text-lg { font-size: 20px; }
html.text-lg h2 { font-size: 1.75rem; margin-bottom: 1rem; }
html.text-lg section { padding: 1.75rem; scroll-margin-top: 80px; }

/* Header */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}
header h1 { font-size: 1.875rem; }
header p { color: var(--muted); margin-top: .25rem; }

/* Brand link in header */
header .brand { color: inherit; text-decoration: none; }
header .brand:hover { color: var(--link); }

/* Navigation */
nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: .5rem .25rem;
  font-weight: 600;
}
nav a:hover { color: var(--link); }
nav a:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
nav a.active {
  color: var(--link);
  border-bottom: 3px solid var(--link);
}
/* Mobile nav call-to-action */
.nav-cta { display: none; }

/* Small button variant (for nav) */
.btn-sm { padding: .5rem .6rem; min-height: 36px; font-weight: 700; border-radius: 10px; font-size: .95rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42vh;
  padding: 3rem 1rem;
  color: #fff;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(17,24,39,.55), rgba(17,24,39,.25));
  z-index: 1;
  pointer-events: none;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: heroFade 36s infinite; }
.hero-bg .s1 { animation-delay: 0s; }
.hero-bg .s2 { animation-delay: 12s; }
.hero-bg .s3 { animation-delay: 24s; }
@keyframes heroFade {
  0%, 27% { opacity: 1; }
  33%, 94% { opacity: 0; }
  100% { opacity: 1; }
}
.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 860px; }
.hero h2 { font-size: 2rem; letter-spacing: .2px; }
.hero .muted { color: rgba(255,255,255,.85); margin-top: .5rem; }
.hero-ctas { margin-top: 1rem; display: inline-flex; gap: .5rem; flex-wrap: wrap; }

/* Buttons (accessible sizes) */
.btn { display: inline-block; text-decoration: none; font-weight: 700; border-radius: 12px; padding: .75rem 1rem; min-height: 44px; line-height: 1; border: 2px solid transparent; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { color: var(--text); border-color: rgba(17,24,39,.6); background: transparent; }
.btn-outline:hover { border-color: var(--text); background: rgba(17,24,39,.04); }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.85); }
.hero .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.06); }
html.contrast-high .btn-outline { border-color: currentColor; background: transparent; }
html.contrast-high .btn-outline:hover { background: rgba(0,0,0,.06); }

/* Sections */
section {
  max-width: 860px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--section-radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 72px; /* account for sticky nav */
}
h1, h2 { margin-bottom: .75rem; }
h2 { font-size: 1.5rem; }
section p { color: var(--text); }

/* Lists */
.list { margin: .5rem 0 0 1.1rem; padding: 0; }
.list li { margin: .5rem 0; font-size: 1.05rem; }

/* Expect checklist */
.checklist { list-style: none; padding: 0; margin: .5rem 0 0; }
.checklist li { position: relative; padding-left: 1.75rem; margin: .6rem 0; }
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: .15rem;
  width: 1.1rem; height: 1.1rem; border-radius: 6px;
  border: 2px solid var(--primary);
  background: radial-gradient(circle at 50% 50%, var(--primary) 60%, transparent 61%);
}

/* Service cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--section-radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.card h3 { margin-bottom: .35rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }
.card .icon { color: var(--primary); margin-bottom: .5rem; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(29,78,216,.35); }
.card:focus-within { box-shadow: var(--shadow-lg); border-color: rgba(29,78,216,.5); }

@media (prefers-reduced-motion: reduce) {
  .card { transition: box-shadow 160ms ease, border-color 160ms ease; }
  .card:hover { transform: none; }
}

/* Page-specific light alignment for legacy centered sections */
section#services, section#contact { text-align: center; }
section#contact h4, section#contact h5 { margin: .25rem 0; color: var(--text); }
/* Sub-note line */
#contact h5 { color: var(--muted); }

/* Utility */
.muted { color: var(--muted); }

/* Footer */
footer {
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  margin-top: 3rem;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  html { font-size: 16px; }
  html.text-lg { font-size: 18px; }
  header { padding: 1.5rem 1rem; }
  .hero { min-height: 32vh; padding: 2rem 1rem; }
  section { margin: 1.25rem 1rem; padding: 1.25rem; }
  .nav-cta { display: inline-flex; align-items: center; }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --surface: #0f1720;
    --text: #e5e7eb;
    --muted: #9aa4b2;
    --border: #1f2937;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --link: var(--primary);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.35);
    --shadow-lg: 0 4px 10px rgba(0,0,0,.45), 0 10px 24px rgba(0,0,0,.5);
  }
  .hero::before { background: linear-gradient( to bottom, rgba(17,24,39,.6), rgba(17,24,39,.35) ); }
}

/* Respect reduced motion: keep first slide only */
@media (prefers-reduced-motion: reduce) {
  .hero-bg .slide { animation: none !important; }
  .hero-bg .s1 { opacity: 1; }
  .hero-bg .s2, .hero-bg .s3 { opacity: 0; }
}

/* Print styles: emphasize contact, simplify visuals */
@media print {
  :root { --text: #000; --muted: #000; --border: #000; }
  body { background: #fff; color: #000; }
  nav, .hero, .cards { display: none !important; }
  section { box-shadow: none; border: 1px solid #000; }
  #contact { display: block; }
}
