/* AHJdata — Design Tokens & Component Styles */
/* Art direction: Authoritative, data-infrastructure, clean.
   Dark navy/slate surfaces with amber accent = "industrial data" feel.
   Not generic SaaS teal — this is infrastructure for construction pros. */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* LIGHT MODE — slate/cool gray with warm amber accent */
:root,
[data-theme='light'] {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-surface-2: #f0f1f4;
  --color-surface-offset: #e8eaee;
  --color-border: #d0d3da;
  --color-divider: #dfe1e6;
  --color-text: #1a1d26;
  --color-text-muted: #5c6170;
  --color-text-faint: #9ca0ad;
  --color-text-inverse: #ffffff;
  --color-primary: #c87a1a;
  --color-primary-hover: #a86310;
  --color-primary-active: #8a5010;
  --color-primary-highlight: #fef3e2;
  --color-navy: #1a2332;
  --color-navy-light: #2a3a52;
  --shadow-sm: 0 1px 2px rgba(26,29,38,0.06);
  --shadow-md: 0 4px 12px rgba(26,29,38,0.08);
  --shadow-lg: 0 12px 32px rgba(26,29,38,0.12);
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #0f1218;
  --color-surface: #171b24;
  --color-surface-2: #1e2330;
  --color-surface-offset: #252b3a;
  --color-border: #2e3547;
  --color-divider: #262d3e;
  --color-text: #d4d7e0;
  --color-text-muted: #8891a5;
  --color-text-faint: #5a6378;
  --color-text-inverse: #0f1218;
  --color-primary: #e09a3e;
  --color-primary-hover: #f0b05a;
  --color-primary-active: #c87a1a;
  --color-primary-highlight: #2a2418;
  --color-navy: #0f1218;
  --color-navy-light: #1a2030;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1218;
    --color-surface: #171b24;
    --color-surface-2: #1e2330;
    --color-surface-offset: #252b3a;
    --color-border: #2e3547;
    --color-divider: #262d3e;
    --color-text: #d4d7e0;
    --color-text-muted: #8891a5;
    --color-text-faint: #5a6378;
    --color-text-inverse: #0f1218;
    --color-primary: #e09a3e;
    --color-primary-hover: #f0b05a;
    --color-primary-active: #c87a1a;
    --color-primary-highlight: #2a2418;
    --color-navy: #0f1218;
    --color-navy-light: #1a2030;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
  }
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

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

section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-24));
}

/* ============================================
   HEADER / NAV
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding-block: var(--space-4);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.logo-mark {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
}

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

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

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-faint);
}

.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* ============================================
   HERO
   ============================================ */

.hero {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  max-width: 18ch;
  margin-inline: auto;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.hero__proof {
  display: flex;
  gap: var(--space-8);
  justify-content: center;
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.hero__proof-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__proof-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ============================================
   DATA PREVIEW (table)
   ============================================ */

.preview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--color-navy);
  color: #e8eaee;
}

.preview__header-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.preview__header-badge {
  font-size: var(--text-xs);
  color: var(--color-primary);
  background: rgba(200, 122, 26, 0.15);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: 600;
}

.preview__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.preview__table {
  width: 100%;
  font-size: var(--text-xs);
  white-space: nowrap;
}

.preview__table thead {
  background: var(--color-surface-2);
}

.preview__table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  border-bottom: 1px solid var(--color-divider);
}

.preview__table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
}

.preview__table tr:last-child td {
  border-bottom: none;
}

.preview__table tr:hover td {
  background: var(--color-primary-highlight);
}

.tag {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag--online { background: #d4edda; color: #155724; }
.tag--inperson { background: #fff3cd; color: #856404; }
.tag--email { background: #d1ecf1; color: #0c5460; }

[data-theme='dark'] .tag--online { background: #1a3a25; color: #6daa45; }
[data-theme='dark'] .tag--inperson { background: #3a3018; color: #e8af34; }
[data-theme='dark'] .tag--email { background: #1a2c3a; color: #5591c7; }

.preview__blur-row td {
  filter: blur(4px);
  user-select: none;
  opacity: 0.5;
}

.preview__footer {
  padding: var(--space-4) var(--space-6);
  text-align: center;
  background: var(--color-surface-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.preview__footer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.preview__footer a:hover {
  text-decoration: underline;
}

/* ============================================
   PAIN POINT / QUOTE
   ============================================ */

.pain-section {
  background: var(--color-navy);
  color: #e8eaee;
}

.pain-section .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.pain__quote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.3;
  font-style: italic;
  position: relative;
  padding-left: var(--space-8);
  border-left: 3px solid var(--color-primary);
}

.pain__attribution {
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-primary);
  font-weight: 600;
}

.pain__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.stat-card {
  background: var(--color-navy-light);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.stat-card__number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  font-size: var(--text-sm);
  color: #9ca8bc;
  margin-top: var(--space-2);
  line-height: 1.4;
}

/* ============================================
   FEATURES
   ============================================ */

.features__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.features__header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.features__header p {
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-inline: auto;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.feature-card__icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================
   COMPARISON
   ============================================ */

.comparison {
  background: var(--color-surface-2);
}

.comparison__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.comparison__header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.comparison__header p {
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
}

.comparison__table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.comparison__table {
  width: 100%;
  font-size: var(--text-sm);
}

.comparison__table thead {
  background: var(--color-surface-2);
}

.comparison__table th {
  padding: var(--space-4) var(--space-6);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-divider);
}

.comparison__table th:first-child {
  min-width: 200px;
}

.comparison__table th.highlight {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}

.comparison__table td {
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}

.comparison__table td.highlight {
  background: var(--color-primary-highlight);
  font-weight: 600;
}

.comparison__table tr:last-child td {
  border-bottom: none;
}

.check { color: #437a22; }
.cross { color: #a13544; }

[data-theme='dark'] .check { color: #6daa45; }
[data-theme='dark'] .cross { color: #dd6974; }

/* ============================================
   PRICING
   ============================================ */

.pricing__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.pricing__header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.pricing__header p {
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.pricing__grid--two {
  grid-template-columns: repeat(2, 1fr);
  max-width: 780px;
  margin-inline: auto;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
}

.pricing-card--featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
}

.pricing-card__badge {
  position: absolute;
  top: calc(-1 * var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pricing-card__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.pricing-card__price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-1);
}

.pricing-card__period {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.pricing-card__features {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pricing-card__features li {
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--color-text);
}

.pricing-card__features li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--color-primary);
}

.pricing-card .btn {
  width: 100%;
}

/* ============================================
   FAQ
   ============================================ */

.faq__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.faq__header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.faq__list {
  max-width: var(--content-default);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
}

.faq-item__q svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--transition-interactive);
}

.faq-item.open .faq-item__q svg {
  transform: rotate(45deg);
}

.faq-item__a {
  display: none;
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.faq-item.open .faq-item__a {
  display: block;
}

/* ============================================
   CTA SECTION
   ============================================ */

.cta-section {
  background: var(--color-navy);
  color: #e8eaee;
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.cta-section p {
  color: #9ca8bc;
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.footer__links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--color-text);
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .nav-actions {
    gap: var(--space-2);
  }

  .nav-actions .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .pain-section .container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .pricing__grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-inline: auto;
  }

  .hero__title {
    font-size: clamp(1.75rem, 1rem + 3vw, 2.5rem);
  }

  .comparison__table {
    font-size: var(--text-xs);
  }

  .comparison__table th,
  .comparison__table td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
