/* TundraFox Marketing Site — Design System
 * WCAG AA: 4.5:1 contrast, keyboard navigable, responsive, prefers-reduced-motion
 */

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

/* Tokens */
:root {
  /* Colours — all pass WCAG AA against their backgrounds */
  --tf-bg: #0b0f19;
  --tf-bg-alt: #111827;
  --tf-bg-card: #1a2234;
  --tf-surface: #1f2937;
  --tf-border: #374151;

  --tf-text: #e5e7eb;          /* on dark bg: 12.6:1 */
  --tf-text-muted: #9ca3af;   /* on dark bg: 5.9:1 */
  --tf-text-heading: #f9fafb; /* on dark bg: 15.4:1 */

  --tf-brand: #60a5fa;        /* on dark bg: 5.8:1 */
  --tf-brand-hover: #93c5fd;
  --tf-accent: #34d399;       /* on dark bg: 9.0:1 */
  --tf-red: #f87171;

  /* Canadian colours (used sparingly) */
  --tf-maple: #ff0000;

  /* Typography */
  --tf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tf-font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;

  /* Spacing scale */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;
  --sp-4xl: 6rem;

  /* Layout */
  --max-w: 72rem;
  --max-w-narrow: 48rem;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Base */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--tf-font);
  background: var(--tf-bg);
  color: var(--tf-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link — WCAG */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-md);
  background: var(--tf-brand);
  color: var(--tf-bg);
  padding: var(--sp-sm) var(--sp-md);
  border-radius: 0 0 0.375rem 0.375rem;
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* Focus ring — WCAG */
:focus-visible {
  outline: 3px solid var(--tf-brand);
  outline-offset: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--tf-text-heading);
  line-height: 1.2;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p { max-width: 65ch; }

a {
  color: var(--tf-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s var(--ease);
}
a:hover { color: var(--tf-brand-hover); }

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

.container--narrow {
  max-width: var(--max-w-narrow);
}

.section {
  padding: var(--sp-4xl) 0;
}

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

/* Grid */
.grid {
  display: grid;
  gap: var(--sp-xl);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tf-border);
  padding: var(--sp-md) 0;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--tf-text-heading);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  list-style: none;
}

.nav__links a {
  color: var(--tf-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s var(--ease);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--tf-text-heading);
}

.nav__lang {
  font-size: 0.875rem;
  padding: var(--sp-xs) var(--sp-sm);
  border: 1px solid var(--tf-border);
  border-radius: 0.375rem;
  color: var(--tf-text-muted);
  text-decoration: none;
}
.nav__lang:hover {
  border-color: var(--tf-brand);
  color: var(--tf-brand);
}

/* Mobile nav */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--tf-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--sp-xs);
}

@media (max-width: 48rem) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--tf-bg);
    border-bottom: 1px solid var(--tf-border);
    padding: var(--sp-lg);
    gap: var(--sp-md);
  }
  .nav__links--open { display: flex; }
}

/* Hero */
.hero {
  padding: var(--sp-4xl) 0;
  text-align: center;
}

.hero__badge {
  display: inline-block;
  padding: var(--sp-xs) var(--sp-md);
  border-radius: 9999px;
  background: rgba(96, 165, 250, 0.12);
  color: var(--tf-brand);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(96, 165, 250, 0.25);
  margin-bottom: var(--sp-xl);
}

.hero h1 {
  margin-bottom: var(--sp-lg);
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--tf-text-muted);
  max-width: 40ch;
  margin: 0 auto var(--sp-2xl);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--tf-brand);
  color: var(--tf-bg);
}
.btn--primary:hover {
  background: var(--tf-brand-hover);
  color: var(--tf-bg);
}

.btn--secondary {
  background: transparent;
  color: var(--tf-text);
  border: 1px solid var(--tf-border);
}
.btn--secondary:hover {
  border-color: var(--tf-text-muted);
  color: var(--tf-text-heading);
}

.btn-group {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: 0.75rem;
  padding: var(--sp-xl);
}

.card__icon {
  font-size: 1.5rem;
  margin-bottom: var(--sp-md);
}

.card h3 {
  margin-bottom: var(--sp-sm);
}

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

/* Feature list */
.features li {
  padding: var(--sp-sm) 0;
  color: var(--tf-text);
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
}
.features li::before {
  content: "\2713";
  color: var(--tf-accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* Pricing table */
.pricing-card {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: 0.75rem;
  padding: var(--sp-2xl) var(--sp-xl);
  text-align: center;
}
.pricing-card--featured {
  border-color: var(--tf-brand);
  position: relative;
}
.pricing-card--featured::before {
  content: attr(data-label);
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tf-brand);
  color: var(--tf-bg);
  padding: var(--sp-xs) var(--sp-md);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--tf-text-heading);
  margin: var(--sp-md) 0;
}
.pricing-card__price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--tf-text-muted);
}

.pricing-card .features {
  text-align: left;
  margin: var(--sp-xl) 0;
}

/* Sovereignty comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-xl) 0;
  font-size: 0.9375rem;
}
.compare-table th,
.compare-table td {
  padding: var(--sp-md);
  text-align: left;
  border-bottom: 1px solid var(--tf-border);
}
.compare-table th {
  color: var(--tf-text-heading);
  font-weight: 600;
}
.compare-table td {
  color: var(--tf-text-muted);
}
.compare-table .check { color: var(--tf-accent); }
.compare-table .cross { color: var(--tf-red); }

/* Footer */
.footer {
  border-top: 1px solid var(--tf-border);
  padding: var(--sp-3xl) 0 var(--sp-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--sp-2xl);
  margin-bottom: var(--sp-2xl);
}

.footer__col h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tf-text-muted);
  margin-bottom: var(--sp-md);
}

.footer__col ul {
  list-style: none;
}
.footer__col li {
  margin-bottom: var(--sp-sm);
}
.footer__col a {
  color: var(--tf-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}
.footer__col a:hover {
  color: var(--tf-text-heading);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-md);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--tf-border);
  font-size: 0.875rem;
  color: var(--tf-text-muted);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--tf-text-muted); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
