/* ============================================================
   BugSweep — Portfolio Website Stylesheet
   Token-driven, mobile-first, per UI_SKILL.md rules
   ============================================================ */

/* --- Token System --- */
:root {
  /* Spacing — multiples of 4px */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
  --space-9: 128px;

  /* Border radius — consistent */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Colors — 1 accent + gray scale + 3 semantic */
  --color-brand: #2563EB;
  --color-brand-hover: #1D4ED8;
  --color-brand-subtle: rgba(37, 99, 235, 0.08);

  --color-text: #111827;
  --color-secondary: #374151;
  --color-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-surface: #F9FAFB;
  --color-bg: #FAFAFA;
  --color-white: #FFFFFF;

  --color-success: #16A34A;
  --color-error: #DC2626;
  --color-warning: #D97706;

  /* Shadows — subtle, layered */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-nav: 0 1px 8px rgba(0, 0, 0, 0.06);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Type scale */
  --text-caption: 13px;
  --text-small: 14px;
  --text-body: 16px;
  --text-lg: 18px;
  --text-heading: 24px;
  --text-display-sm: 32px;
  --text-display: 48px;
  --text-display-lg: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

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

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--color-text);
  font-weight: 600;
}

h1 {
  font-size: var(--text-display);
  letter-spacing: -0.03em;
  font-weight: 700;
}

h2 {
  font-size: var(--text-display-sm);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-heading);
}

p {
  color: var(--color-secondary);
  max-width: 640px;
}

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

.text-brand {
  color: var(--color-brand);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3) 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: rgba(250, 250, 250, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-nav);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-logo span {
  color: var(--color-brand);
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-5);
  align-items: center;
}

.nav-links a {
  font-size: var(--text-small);
  color: var(--color-muted);
  font-weight: 500;
  transition: color 0.15s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand);
  border-radius: var(--radius-full);
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: rgba(250, 250, 250, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 99;
}

.nav-mobile.open {
  display: block;
}

.nav-mobile a {
  display: block;
  padding: var(--space-3) 0;
  font-size: var(--text-body);
  color: var(--color-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  transition: color 0.15s ease;
}

.nav-mobile a:last-child {
  border-bottom: none;
}

.nav-mobile a:hover {
  color: var(--color-brand);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px var(--space-4);
  font-size: var(--text-small);
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

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

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

.btn-primary:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-outline:hover {
  background: var(--color-brand-subtle);
}

.btn-outline:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-outline:active {
  transform: scale(0.98);
}

/* --- Section Base --- */
section {
  padding: var(--space-9) 0;
}

.section-label {
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-brand);
  margin-bottom: var(--space-3);
}

.section-heading {
  margin-bottom: var(--space-4);
}

.section-subtext {
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--space-9);
  background: var(--color-white);
}

.hero-content {
  max-width: 720px;
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero h1 .highlight {
  color: var(--color-brand);
}

.hero-description {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-secondary);
  margin-bottom: var(--space-6);
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-brand-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: var(--space-5);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-caption);
  animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Problem Section --- */
.problem {
  background: var(--color-white);
}

.problem-grid {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.problem-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s ease;
}

.problem-card:hover {
  box-shadow: var(--shadow-sm);
}

.problem-card-icon {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.problem-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.problem-card p {
  font-size: var(--text-small);
  color: var(--color-muted);
  line-height: 1.6;
}

/* --- Solution Section --- */
.solution {
  background: var(--color-surface);
}

.solution-content {
  max-width: 640px;
}

.solution-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.solution-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.solution-step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-brand);
  border: 1.5px solid var(--color-brand);
  border-radius: var(--radius-sm);
}

.solution-step-text h3 {
  font-size: var(--text-body);
  margin-bottom: var(--space-1);
}

.solution-step-text p {
  font-size: var(--text-small);
  color: var(--color-muted);
}

/* --- What You Get Section --- */
.what-you-get {
  background: var(--color-white);
}

.deliverables-grid {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.deliverable-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.deliverable-card:hover {
  border-color: var(--color-brand);
}

.deliverable-card-icon {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.deliverable-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.deliverable-card p {
  font-size: var(--text-small);
  color: var(--color-muted);
  line-height: 1.6;
}

/* --- Disruption Section --- */
.disruption {
  background: var(--color-surface);
}

.disruption-content {
  max-width: 640px;
}

.comparison-table {
  margin-top: var(--space-6);
  width: 100%;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.comparison-table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.comparison-table thead th:last-child {
  color: var(--color-brand);
}

.comparison-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-secondary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.comparison-table tbody td:last-child {
  color: var(--color-text);
  font-weight: 500;
}

/* --- Roadmap Section --- */
.roadmap {
  background: var(--color-white);
}

.roadmap-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--space-6);
  position: relative;
}

.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.roadmap-phase {
  display: flex;
  gap: var(--space-4);
  padding-bottom: var(--space-6);
  position: relative;
}

.roadmap-phase:last-child {
  padding-bottom: 0;
}

.roadmap-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.roadmap-dot.active {
  background: var(--color-brand);
}

.roadmap-dot.upcoming {
  background: var(--color-white);
  border: 2px solid var(--color-border);
}

.roadmap-dot svg {
  width: 16px;
  height: 16px;
}

.roadmap-dot.active svg {
  color: var(--color-white);
}

.roadmap-dot.upcoming svg {
  color: var(--color-muted);
}

.roadmap-phase-content {
  padding-top: var(--space-1);
}

.roadmap-phase-label {
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.roadmap-phase-label.now {
  color: var(--color-brand);
}

.roadmap-phase-content h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.roadmap-phase-content p {
  font-size: var(--text-small);
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 480px;
}

/* --- Coming Soon Section --- */
.coming-soon {
  background: var(--color-text);
  color: var(--color-white);
  text-align: center;
}

.coming-soon .section-label {
  color: rgba(255, 255, 255, 0.5);
}

.coming-soon h2 {
  color: var(--color-white);
}

.coming-soon p {
  color: rgba(255, 255, 255, 0.6);
  margin-left: auto;
  margin-right: auto;
}

.coming-soon-pulse {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-brand);
  margin-top: var(--space-6);
}

.coming-soon-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-brand);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* --- Footer --- */
.footer {
  padding: var(--space-6) 0;
  background: var(--color-text);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-white);
}

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

.footer-text {
  font-size: var(--text-caption);
  color: rgba(255, 255, 255, 0.4);
}

/* --- Scroll Animations --- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate-delay="1"] { transition-delay: 0.1s; }
[data-animate-delay="2"] { transition-delay: 0.2s; }
[data-animate-delay="3"] { transition-delay: 0.3s; }
[data-animate-delay="4"] { transition-delay: 0.4s; }

/* --- Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-display-lg);
  }

  .problem-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .deliverables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .problem-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .deliverables-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}
