/* ============================================
   TB-App Lab - Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-accent: #06b6d4;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-inverse: #f1f5f9;
  --color-border: #e2e8f0;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  --max-width: 1100px;
  --header-height: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-primary-dark);
}

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

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--color-primary);
}

/* Navigation */
.site-nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.site-nav a {
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-primary);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--color-bg) 0%,
    #eff6ff 100%
  );
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-bg-dark);
}

.hero h1 span {
  color: var(--color-primary);
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* --- Sections --- */
.section {
  padding: 4rem 0;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: 3rem;
  font-size: 1rem;
}

/* --- Service Cards --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  transition: box-shadow 0.3s, transform 0.3s;
}

.service-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.service-card .icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.service-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-card p {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-size: 1.125rem;
  font-weight: 700;
}

.footer-brand span {
  color: var(--color-primary-light);
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text-inverse);
  font-size: 0.875rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-text-inverse);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.6;
}

/* --- Legal Pages (Privacy, Terms) --- */
.legal-page {
  padding: 3rem 0 4rem;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.legal-page .last-updated {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.legal-page p,
.legal-page li {
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.legal-page ul {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.legal-page li {
  margin-bottom: 0.375rem;
}

/* --- Contact Page --- */
.contact-page {
  padding: 4rem 0;
  text-align: center;
}

.contact-page h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-page p {
  color: var(--color-text-light);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-primary);
  transition: box-shadow 0.3s, transform 0.3s;
}

.contact-email:hover {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
  color: var(--color-primary-dark);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section {
    padding: 3rem 0;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav li {
    border-top: 1px solid var(--color-border);
  }

  .site-nav a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.625rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.375rem;
  }

  .contact-email {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}
