/* === Custom Properties === */
:root {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --surface: #18181b;
  --muted: #a1a1aa;
  --muted-dark: #71717a;
  --border: #27272a;
  --border-hover: #3f3f46;
  --dot-primary: #a78bfa;
  --dot-secondary: #60a5fa;
  --dot-other: #34d399;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --radius: 0.75rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(167, 139, 250, 0.3);
  color: var(--foreground);
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
  padding: 3rem 0;
}

.section > .container {
  width: 100%;
}

/* === Section Labels & Titles === */
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* === Hero === */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 2rem 0;
  scroll-snap-align: start;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.hero-tagline {
  color: var(--muted);
  font-size: clamp(0.9375rem, 2vw, 1.25rem);
  margin-top: 0.75rem;
  padding: 0 1rem;
}

.hero-divider {
  width: 48px;
  height: 1px;
  background: var(--border-hover);
  margin: 1.5rem auto 0;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted-dark);
  animation: scroll-bounce 2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

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

/* === Services Grid === */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 0;
  transition: border-color 0.2s ease;
}

@media (hover: hover) {
  .service-card:hover {
    border-color: var(--border-hover);
  }
}

.service-card-icon {
  color: var(--muted);
  margin-bottom: 1rem;
}

.service-card-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.service-card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

/* === Tech Stack Grid === */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.stack-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-width: 0;
}

.stack-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.stack-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stack-dot--primary { background: var(--dot-primary); }
.stack-dot--secondary { background: var(--dot-secondary); }
.stack-dot--other { background: var(--dot-other); }

.stack-category-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-item-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
}

.stack-item-desc {
  font-size: 0.75rem;
  color: var(--muted-dark);
}

/* === Last Section (with footer) === */
.section--last {
  flex-direction: column;
  justify-content: center;
}

.section--last > .container {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

/* === Footer === */
.footer {
  margin-top: auto;
  padding: 2rem 0 1rem;
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  color: var(--muted-dark);
}

/* === Scroll Animations === */
.animate-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }

  .scroll-indicator {
    animation: none;
  }
}

/* === Responsive === */

/* Tablet (640px+) */
@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  .hero-tagline {
    padding: 0;
  }

  .hero-divider {
    width: 60px;
    margin-top: 2rem;
  }

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

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

  .service-card,
  .stack-category {
    padding: 1.5rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .container {
    padding: 0 2.5rem;
  }

  .section {
    padding: 5rem 0;
  }

  .section-title {
    font-size: 2rem;
  }

  .services-grid {
    gap: 1.25rem;
  }

  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}
