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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --rust: #dea584;
  --js: #f1e05a;
  --ts: #3178c6;
  --elixir: #6e4a7e;
  --surface-rgb: 22, 27, 34;
}

/* Shader backdrop */
.shader-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.35;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hero */
.hero {
  padding: 6rem 2rem 4rem;
  text-align: center;
}

.hero-inner {
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.blink {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

.tagline {
  margin-top: 1rem;
  font-size: 1.25rem;
  color: var(--text-muted);
}



/* Projects */
.projects {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.projects h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Cards */
.card {
  display: block;
  background: rgba(var(--surface-rgb), 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* Safari < 18 */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.card:hover {
  background: rgba(var(--surface-rgb), 0.85);
  border-color: var(--border);
}

/* Card with logo variant */
.card-with-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.card-logo {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-with-logo .card-body {
  flex: 1;
  min-width: 0;
}

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

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Language badges */
.lang {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-group {
  display: flex;
  gap: 0.35rem;
}

.lang.rust {
  background: rgba(222, 165, 132, 0.15);
  color: var(--rust);
}

.lang.js {
  background: rgba(241, 224, 90, 0.15);
  color: var(--js);
}

.lang.ts {
  background: rgba(49, 120, 198, 0.15);
  color: var(--ts);
}

.lang.elixir {
  background: rgba(110, 74, 126, 0.15);
  color: var(--elixir);
}

/* Maturity indicator — inline with project title */
.maturity {
  font-size: 0.65rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.maturity.served { color: #3fb950; }
.maturity.cooking { color: #e3a338; }
.maturity.raw { color: var(--text-muted); }

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .hero {
    padding: 4rem 1.5rem 3rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .projects {
    padding: 0 1rem 3rem;
  }

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

/* CSS tooltip on maturity labels */
.maturity {
  position: relative;
  cursor: default;
}

.maturity::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 10;
}

.maturity:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
