/* ==========================================================================
   Innosphere – Global Stylesheet
   Purpose: SEO-safe, accessible, mobile-first, CWV-optimized
   ========================================================================== */

/* ==========================
   CSS VARIABLES
========================== */
:root {
  --max-width: 1100px;

  --brand: #0b66ff;
  --brand-dark: #084acc;

  --text: #14232a;
  --text-soft: #4a4f57;
  --muted: #6c747b;

  --bg: #f7f9fc;
  --card: #ffffff;
  --border: #dde6ef;

  --radius-sm: 8px;
  --radius-md: 10px;

  --shadow-sm: 0 4px 14px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 22px rgba(0,0,0,0.06);

  --focus-ring: 3px;
}

/* ==========================
   RESET & BASE
========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html { font-size: 16px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* ==========================
   LAYOUT
========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px;
}

main { display: block; }

/* ==========================
   TYPOGRAPHY
========================== */
h1,h2,h3,h4,h5,h6 {
  margin: 0 0 .6rem;
  color: var(--text);
  line-height: 1.3;
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; color: var(--brand); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: .95rem; }
h6 { font-size: .85rem; }

p {
  margin: 0 0 1rem;
  color: var(--text-soft);
}

ul,ol {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

li { margin-bottom: .4rem; }

strong { font-weight: 700; }

/* Links */
a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--brand-dark);
}

a:focus {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring) rgba(11,102,255,.18);
  border-radius: 6px;
}

/* ==========================
   HEADER
========================== */
.site-header {
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand .logo img {
  max-height: 55px;
  width: auto;
}

.tagline {
  font-size: .85rem;
  color: var(--muted);
}
/* ==========================
   HERO
========================== */
.hero {
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-top: 14px;
}

.lead {
  max-width: 60ch;
  margin: 12px auto 0;
  color: #34495e;
}

.updated {
  font-size: .85rem;
  color: var(--muted);
}

.visitor {
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================
   SECTIONS
========================== */
.section {
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
}

/* ==========================
   FOOTER
========================== */
.site-footer {
  margin-top: 30px;
  padding: 20px 0 40px;
  font-size: .95rem;
  color: var(--text-soft);
}

.site-footer a {
  color: var(--brand);
}

/* ==========================
   BACK TO TOP
========================== */
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  box-shadow: var(--shadow-sm);
}

#backToTop:hover {
  background: var(--brand-dark);
}

/* ==========================
   RESPONSIVE (MOBILE) – FIXED
========================== */
@media (max-width: 768px) {

  .nav-toggle {
    display: block;
    align-self: flex-end;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 10px;
  }

  /* KEY FIX */
  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
  }

  .hero { padding: 18px; }
  .section { padding: 18px; }
}

/* ==========================
   DARK MODE
========================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: #020617;
    --text: #e5e7eb;
    --text-soft: #9ca3af;
    --muted: #94a3b8;
    --brand: #60a5fa;
    --brand-dark: #3b82f6;
  }

  body { background: var(--bg); }

  .site-header,
  .hero,
  .section {
    background: var(--card);
  }
}

/* ==========================
   PRINT STYLES
========================== */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .main-nav,
  #backToTop {
    display: none;
  }

  a {
    text-decoration: none;
    color: #000;
  }

  .section {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================
   REDUCED MOTION
========================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================
   END OF FILE
========================== */
/* ==========================
   NAVIGATION – DESKTOP FIRST (FIXED)
========================== */

/* Toggle button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--brand);
}

/* Desktop navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.main-nav a {
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  color: var(--brand);
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus {
  background: #eaf1ff;
}

/* ==========================
   MOBILE NAVIGATION
========================== */
@media (max-width: 768px) {

  /* Show toggle button */
  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  /* Stack header items */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Hide menu by default */
  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 10px;
  }

  /* Show menu when toggled */
  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: #fff;
  }
}
