/* =========================================================================
   Tati Software — Design tokens, reset, typography, layout, header & footer
   Brand: #0167E1 (blue) · #012392 (dark blue) · #1CD6FE (light blue) · #404040
   ========================================================================= */

/* ---- Design tokens: shared ---- */
:root {
  /* Brand palette (fixed across themes) */
  --brand-blue: #0167e1;
  --brand-dark-blue: #012392;
  --brand-light-blue: #1cd6fe;
  --brand-gray: #404040;
  --brand-gradient: linear-gradient(135deg, #012392 0%, #0167e1 55%, #1cd6fe 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(1, 35, 146, 0.08) 0%, rgba(1, 103, 225, 0.10) 55%, rgba(28, 214, 254, 0.10) 100%);

  /* Typography */
  --font-body: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Outfit", system-ui, sans-serif;

  /* Radius */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-section: clamp(3.5rem, 7vw, 7rem);
  --container: 1240px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.25s var(--ease);
}

/* ---- Light theme (default) ---- */
:root,
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f3f7fc;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --surface-invert: #0a1226;
  --text: #10131c;
  --text-muted: #565b6b;
  --text-on-dark: #eef3fb;
  --text-on-dark-muted: #a7b1c6;
  --border: #e4eaf2;
  --border-strong: #d3dcea;
  --primary: #0167e1;
  --primary-hover: #0154b8;
  --primary-contrast: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 19, 28, 0.06), 0 4px 14px rgba(16, 19, 28, 0.05);
  --shadow-md: 0 10px 30px rgba(1, 35, 146, 0.10);
  --shadow-lg: 0 24px 60px rgba(1, 35, 146, 0.14);
  --header-bg: rgba(255, 255, 255, 0.82);
  --logo-light: block;
  --logo-dark: none;
  color-scheme: light;
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #070b16;
  --bg-alt: #0b1122;
  --surface: #0f1626;
  --surface-2: #131c30;
  --surface-invert: #0b1122;
  --text: #f4f7fc;
  --text-muted: #a2acc2;
  --text-on-dark: #f4f7fc;
  --text-on-dark-muted: #a2acc2;
  --border: #202b45;
  --border-strong: #2b3856;
  --primary: #2b86f0;
  --primary-hover: #52a0ff;
  --primary-contrast: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(9, 14, 26, 0.8);
  --logo-light: none;
  --logo-dark: block;
  color-scheme: dark;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
h4 { font-size: 1.2rem; }

p { color: var(--text-muted); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.9rem;
}

.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-section);
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 720px;
  margin-bottom: 3rem;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  margin-top: 1rem;
  font-size: 1.1rem;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 92px;
}

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

.brand-logo .logo-on-light { display: var(--logo-light); }
.brand-logo .logo-on-dark  { display: var(--logo-dark); }


.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.main-nav a {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  position: relative;
  transition: color var(--transition);
}

.main-nav a:hover { color: var(--primary); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.nav-dropdown__trigger i { transition: transform var(--transition); font-size: 1.05rem; }
.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 1.4rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 270px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 120;
}
.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown:hover .nav-dropdown__trigger i { transform: rotate(180deg); }
.nav-dropdown__menu a {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown__menu a:hover { background: var(--surface-2); color: var(--primary); }

/* Hide the in-menu CTA on desktop (scoped selector beats .btn source order) */
.main-nav .header-cta-mobile { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1.4rem;
  place-items: center;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--surface-invert);
  color: var(--text-on-dark);
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
}

.footer-brand img { height: 72px; width: auto; margin-bottom: 1.25rem; }
.footer-brand p { color: var(--text-on-dark-muted); max-width: 320px; }

.footer-col h4 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { color: var(--text-on-dark-muted); transition: color var(--transition); }
.footer-col a:hover { color: var(--brand-light-blue); }

.footer-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.footer-socials a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
}

.footer-socials a:hover { background: var(--primary); transform: translateY(-2px); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--text-on-dark-muted);
  line-height: 1.45;
  font-size: 0.95rem;
}
.footer-contact i {
  color: var(--brand-light-blue);
  font-size: 1.15rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}
.footer-contact a {
  color: var(--text-on-dark-muted);
}
.footer-contact a:hover { color: var(--brand-light-blue); }

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
}

.footer-bottom a { color: var(--text-on-dark-muted); }
.footer-bottom a:hover { color: var(--brand-light-blue); }

.footer-legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* ---- Reveal-on-scroll animation (progressive enhancement) ----
   Content is visible by default; only hidden when JS is active so it can
   reveal it again. This prevents a blank page if JS fails or is blocked. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Responsive: header ---- */
@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .main-nav {
    position: fixed;
    inset: 92px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--container-pad) 1.25rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
    z-index: 90;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav > a {
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }
  .header-cta-desktop { display: none; }
  .main-nav .header-cta-mobile { display: inline-flex; margin-top: 1rem; }

  /* Dropdowns render inline on mobile */
  .nav-dropdown__trigger {
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    justify-content: space-between;
  }
  .nav-dropdown__menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    min-width: 0;
    padding: 0.25rem 0 0.5rem 0.75rem;
    background: transparent;
  }
  .nav-dropdown__menu a { font-size: 0.98rem; }
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
}
