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

:root {
  /* Color System - 5 colors total */
  --background: #0a0a0a;
  --foreground: #fafafa;
  --muted: #a1a1aa;
  --border: #27272a;
  --accent: #22c55e;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --radius: 0.5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hero Section */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.4) 0%,
    rgba(10, 10, 10, 0.6) 50%,
    rgba(10, 10, 10, 0.85) 100%
  );
  z-index: 1;
}

/* Navigation */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 1.5rem 2rem;
}

.nav-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

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

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

.btn-secondary {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--muted);
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem 2.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: #111111;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Markdown Styles */
.markdown {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--muted);
}

.markdown h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.markdown h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.markdown h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown p {
  margin-bottom: 1rem;
}

.markdown ul,
.markdown ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown li {
  margin-bottom: 0.5rem;
}

.markdown code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 0.2em 0.4em;
  border-radius: calc(var(--radius) / 2);
  color: var(--accent);
}

.markdown pre {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.markdown pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--foreground);
}

.markdown a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.markdown a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.markdown blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--muted);
  font-style: italic;
}

.markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown .table-wrapper {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown th,
.markdown td {
  text-align: left;
  padding: 0.75rem;
  border: 1px solid var(--border);
}

.markdown th {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
  .nav {
    padding: 1rem;
  }
  
  .nav-buttons {
    gap: 0.5rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  .hero-content {
    padding: 2rem 1.5rem;
  }
  
  .modal {
    max-height: 90vh;
  }
  
  .modal-body {
    padding: 1rem;
  }
}

/* Scrollbar Styles */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}

/* Focus States */
.btn:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-video {
    display: none;
  }
  
  .hero {
    background-color: #1a1a1a;
  }
}
