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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #21262d;
  --blue: #58a6ff;
  --green: #3fb950;
  --text: #c9d1d9;
  --muted: #8b949e;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

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

main {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2rem, 8vw, 6rem) clamp(1.25rem, 5vw, 2rem);
}

/* Hero */
.hero {
  position: relative;
  margin-bottom: clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  opacity: 0;
  animation: scanIn 1s ease-out 0.5s forwards;
}

@keyframes scanIn {
  to { opacity: 1; }
}

.hero-content {
  position: relative;
}

.tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--green);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.2s forwards;
}

h1 {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.4s forwards;
}

.bio {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--muted);
  max-width: 42ch;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.6s forwards;
}

.links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease-out 0.8s forwards;
}

.links a {
  color: var(--muted);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.links a:hover,
.links a:focus-visible {
  color: var(--blue);
}

/* Projects */
.projects {
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

h2 {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 1.5rem;
  text-transform: lowercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.card {
  display: block;
  padding: clamp(1rem, 3vw, 1.25rem);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.card:hover,
.card:focus-visible {
  background: #1c2129;
  outline: none;
}

.card:focus-visible {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.card-header svg {
  color: var(--muted);
}

.lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-weight: 500;
}

.lang.qml { color: #41cdc3; background: rgba(65, 205, 195, 0.1); }
.lang.ts { color: #3178c6; background: rgba(49, 120, 198, 0.1); }
.lang.dart { color: #00b4ab; background: rgba(0, 180, 171, 0.1); }
.lang.kt { color: #a97bff; background: rgba(169, 123, 255, 0.1); }

.card h3 {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.35rem;
}

.card p {
  font-size: clamp(0.8rem, 2vw, 0.85rem);
  color: var(--muted);
  line-height: 1.5;
}

/* Stack */
.stack {
  margin-bottom: clamp(3rem, 8vw, 5rem);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35em 0.75em;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tags span:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* Footer */
footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

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

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scanlines,
  .tagline,
  h1,
  .bio,
  .links {
    animation: none;
    opacity: 1;
  }
}

/* Focus visible for keyboard */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

a:focus:not(:focus-visible) {
  outline: none;
}
