/* ==========================================================================
   toN0tErr — Shared Styles
   "Tools to Nought Error"
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --brand-primary: #1B4F72;
  --brand-secondary: #2E86C1;
  --brand-accent: #E74C3C;
  --brand-success: #27AE60;

  /* Neutrals */
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --bg-warm: #FDF6EC;
  --text-dark: #1A1A2E;
  --text-medium: #4A5568;
  --text-light: #718096;
  --border-light: #E2E8F0;
  --border-medium: #CBD5E0;

  /* Gradients */
  --hero-gradient: linear-gradient(135deg, #1B4F72 0%, #2E86C1 50%, #1B4F72 100%);

  /* Typography */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;

  /* Spacing */
  --section-padding: 5rem 0;
  --container-max: 1200px;
  --container-padding: 0 1.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 8px rgba(27, 79, 114, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(27, 79, 114, 0.15);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dark);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--brand-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul, ol {
  list-style: none;
}

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

/* --- Section --- */
.section {
  padding: var(--section-padding);
}

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

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

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-secondary);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-medium);
  max-width: 700px;
  line-height: 1.7;
}

.section-header {
  margin-bottom: 3rem;
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.nav.scrolled {
  border-bottom-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--brand-primary);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  word-spacing: 0;
  letter-spacing: 0;
}

.nav__logo:hover {
  color: var(--brand-primary);
}

/* Inline logo mark replacing the "0" in toN0tErr */
.logo-zero {
  height: 1.1em;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -0.05em;
  margin: 0;
  padding: 0;
  border: none;
  filter: drop-shadow(0 2px 8px rgba(231, 76, 60, 0.5));
}

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

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium);
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand-secondary);
  transition: width var(--transition-base), left var(--transition-base);
}

.nav__link:hover,
.nav__link.active {
  color: var(--brand-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
  left: 0;
}

/* Mobile Nav Toggle — hidden, JS handles toggling via classes */
.nav__toggle {
  display: none;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav__hamburger {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition-base);
    z-index: 1001;
  }

  .nav__links--open {
    right: 0;
  }

  .nav__hamburger--open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav__hamburger--open span:nth-child(2) {
    opacity: 0;
  }

  .nav__hamburger--open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav__link {
    font-size: 1.05rem;
  }
}

/* --- CTA Banner (shared across all pages) --- */
.cta-banner {
  background: var(--hero-gradient);
  padding: 4rem 1.5rem;
  text-align: center;
  color: #fff;
}

.cta-banner__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cta-banner__text {
  font-size: 1.05rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.cta-banner .btn--secondary {
  background: #fff;
  color: var(--brand-primary);
  border-color: #fff;
}

.cta-banner .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* --- Card Component --- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.card--bordered {
  border-left: 4px solid var(--brand-primary);
}

.card__icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.card__text {
  font-size: 0.95rem;
  color: var(--text-medium);
  line-height: 1.7;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-secondary);
  margin-top: 1rem;
  transition: gap var(--transition-fast);
}

.card__link:hover {
  gap: 0.6rem;
  color: var(--brand-primary);
}

/* --- Grid Utilities --- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
}

.btn--primary {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.btn--primary:hover {
  background: #154360;
  border-color: #154360;
  color: #fff;
}

.btn--secondary {
  background: var(--brand-secondary);
  color: #fff;
  border-color: var(--brand-secondary);
}

.btn--secondary:hover {
  background: #2471A3;
  border-color: #2471A3;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn--outline:hover {
  background: var(--brand-primary);
  color: #fff;
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.btn--success {
  background: var(--brand-success);
  color: #fff;
  border-color: var(--brand-success);
}

.btn--success:hover {
  background: #219A52;
  border-color: #219A52;
  color: #fff;
}

/* --- Tags / Pills --- */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag--primary {
  background: rgba(27, 79, 114, 0.1);
  color: var(--brand-primary);
}

.tag--success {
  background: rgba(39, 174, 96, 0.1);
  color: var(--brand-success);
}

.tag--accent {
  background: rgba(231, 76, 60, 0.1);
  color: var(--brand-accent);
}

.tag--neutral {
  background: var(--bg-light);
  color: var(--text-medium);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* --- Error Eliminated Badge --- */
.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(39, 174, 96, 0.08);
  border: 1px solid rgba(39, 174, 96, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--brand-success);
  font-weight: 500;
  margin-top: 1rem;
}

.error-badge .strikethrough {
  text-decoration: line-through;
  color: var(--brand-accent);
  opacity: 0.7;
}

/* --- Stats Bar --- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.stat {
  text-align: center;
}

.stat__number {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* On dark backgrounds */
.stats--light .stat__number {
  color: #fff;
}

.stats--light .stat__label {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Footer --- */
.footer {
  background: var(--text-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 3.5rem 0 2rem;
}

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

.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer__brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
  white-space: nowrap;
  word-spacing: 0;
  letter-spacing: 0;
}

/* footer__brand uses .logo-zero (see above) */

.footer__desc {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 340px;
}

.footer__heading {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer__link {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: #fff;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.footer__bottom a {
  color: rgba(255, 255, 255, 0.6);
}

.footer__bottom a:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .footer__top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* --- Page Hero (for inner pages) --- */
.page-hero {
  background: var(--hero-gradient);
  padding: 8rem 0 4rem;
  color: #fff;
}

/* CleaErr logo mark in page-hero (founder page) */
.page-hero__logo-mark {
  height: 100px;
  width: auto;
  display: block;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 6px 18px rgba(231, 76, 60, 0.55));
}

/* CleaErr logo mark in section headers (about page) */
.section-logo-mark {
  height: 84px;
  width: auto;
  flex-shrink: 0;
  margin-top: 0.1rem;
  filter: drop-shadow(0 4px 14px rgba(231, 76, 60, 0.3));
}

.page-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.page-hero__subtitle {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 600px;
  line-height: 1.7;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-accent { color: var(--brand-accent); }
.text-success { color: var(--brand-success); }
.text-primary { color: var(--brand-primary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Print --- */
@media print {
  .nav, .footer { display: none; }
  .section { padding: 2rem 0; }
  .card { break-inside: avoid; }
}
