:root {
  --bg: #0a0c10;
  --panel: #12151c;
  --panel-2: #171b24;
  --border: #262b36;
  --text: #eef0f3;
  --text-dim: #8b93a3;
  /* Cartographic duotone (terrain teal + contour amber) - distinct from the
     blue/purple accent reused across the rest of this portfolio, chosen for
     "Atlas": a map of a codebase should look like a map, not a dashboard. */
  --accent: #35c9a5;
  --accent-2: #e0984a;
  --font-display: "Space Grotesk", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: page-in 0.5s var(--ease);
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

header {
  padding: 26px 20px 10px;
  text-align: center;
  background: radial-gradient(ellipse 700px 220px at 50% 0%, rgba(224, 152, 74, 0.12), transparent);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  animation: mark-spin 6s linear infinite;
  flex-shrink: 0;
}

@keyframes mark-spin {
  0%,
  85% {
    transform: rotate(0deg);
    border-radius: 6px;
  }
  92% {
    transform: rotate(180deg);
    border-radius: 50%;
  }
  100% {
    transform: rotate(360deg);
    border-radius: 6px;
  }
}

header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.02em; /* texto grande: tracking negativo, se lee mas junto de lo natural si no */
}

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

.subtitle {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

#search-form {
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 18px auto 8px;
  padding: 0 20px;
}

#repo-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font-mono);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

#repo-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 201, 165, 0.15);
}

#search-form button,
.example-btn {
  font-family: var(--font-body);
  transition: transform 0.15s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

#search-form button:active,
.example-btn:active {
  transform: scale(0.96);
}

#search-form button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #050810;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 600;
  cursor: pointer;
}

#search-form button:hover {
  box-shadow: 0 6px 20px rgba(53, 201, 165, 0.3);
}

#examples {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.example-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 12px;
  padding: 3px 11px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  margin: 0 2px;
}

.example-btn:hover {
  border-color: var(--accent);
  background: rgba(53, 201, 165, 0.08);
}

#status-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
  margin-bottom: 8px;
}

#repo-info {
  max-width: 900px;
  margin: 0 auto 8px;
  padding: 0 20px;
  text-align: center;
  animation: fade-up 0.4s var(--ease);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#repo-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
}

#repo-title a {
  text-decoration: none;
}

#repo-title a:hover {
  color: var(--accent);
}

#repo-description {
  color: var(--text-dim);
  font-size: 13px;
  margin: 6px 0;
}

#repo-stats {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

#language-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 0 auto;
  max-width: 600px;
}

.lang-segment {
  height: 100%;
  transition: filter 0.15s var(--ease);
}

.lang-segment:hover {
  filter: brightness(1.25);
}

#treemap-container {
  flex: 1;
  padding: 0 20px 16px;
  display: flex;
  justify-content: center;
}

#treemap {
  width: 100%;
  max-width: 1100px;
  height: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.treemap-cell {
  stroke: var(--bg);
  stroke-width: 1.5px;
  transition: opacity 0.15s var(--ease), stroke-width 0.15s var(--ease);
}

.treemap-cell:hover {
  opacity: 0.82;
  stroke: var(--accent);
  stroke-width: 2px;
  cursor: pointer;
}

.treemap-label {
  fill: #071019;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  pointer-events: none;
}

footer {
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: 0.01em; /* small text: slight positive tracking for legibility */
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  text-align: center;
}

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

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

@media (max-width: 600px) {
  #search-form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
