/* ============================================================
   DEVELOPER / HACKER AESTHETIC PORTFOLIO
   Iván Serrano Núñez — Software Engineer
   Fonts: JetBrains Mono (headings/mono) + IBM Plex Sans (body)
   Palette: cyan #00d4ff, purple #7b2ff7, green #22c55e, amber #f59e0b
   ============================================================ */

/* ===========================
   Custom Properties
   =========================== */

:root {
  --c1: #00d4ff;              /* cyan — keywords / primary */
  --c2: #7b2ff7;              /* purple — strings / secondary */
  --c3: #22c55e;              /* green — comments / success */
  --c4: #f59e0b;              /* amber — numbers / warnings */
  --bg-0: #0a0a0c;            /* deepest background */
  --bg-1: #0e0e12;            /* section alt bg */
  --bg-2: #131318;            /* card bg */
  --bg-3: #1a1a22;            /* elevated surfaces */
  --border: #1e1e28;          /* card borders */
  --border-glow: rgba(0, 212, 255, 0.15);
  --text-0: #e8e8ed;          /* primary text */
  --text-1: #a0a0b0;          /* body text */
  --text-2: #6a6a7a;          /* muted */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===========================
   Reset
   =========================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ===========================
   Selection & Scrollbar
   =========================== */

::selection {
  background: rgba(0, 212, 255, 0.25);
  color: var(--text-0);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--c1); }

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-3) var(--bg-0);
}

/* ===========================
   Accessibility
   =========================== */

:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
  border-radius: 2px;
}

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

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

/* ===========================
   Skip Link
   =========================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--c1);
  color: var(--bg-0);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* SVG Sprite (hidden) */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ===========================
   Scanline Overlay
   =========================== */

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ===========================
   Layout
   =========================== */

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
  position: relative;
}

.section:nth-child(even) {
  background: var(--bg-1);
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 64px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c4);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--text-0);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  min-width: 40px;
}

/* ===========================
   Buttons
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

.btn-arrow {
  transition: transform 0.3s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--c1);
  color: var(--bg-0);
  border-color: var(--c1);
}

.btn-primary:hover {
  background: transparent;
  color: var(--c1);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.2), inset 0 0 24px rgba(0, 212, 255, 0.05);
}

.btn-outline {
  background: transparent;
  color: var(--c1);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--c1);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.1);
}

/* ===========================
   Navigation
   =========================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-0);
  transition: color 0.3s ease;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.logo-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--c1);
  margin-right: 4px;
  animation: blink 1s steps(1) infinite;
  border-radius: 1px;
}

.logo-text {
  color: var(--c1);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}

.nav-prefix {
  color: var(--text-2);
  opacity: 0.5;
  transition: opacity 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--c1);
  background: rgba(0, 212, 255, 0.06);
}

.nav-links a:hover .nav-prefix {
  opacity: 1;
}

.nav-toggle-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
  background: none;
  border: none;
}

.nav-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===========================
   Hero
   =========================== */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 0;
  position: relative;
  z-index: 2;
}

/* Hero grid background decoration */
.hero-decoration {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 50%, black 0%, transparent 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(123, 47, 247, 0.08) 0%, transparent 70%);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  z-index: 0;
}

/* Hero animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-anim {
  opacity: 0;
  animation: fadeInUp 0.65s var(--ease) forwards;
  animation-delay: calc(var(--delay) * 0.18s);
}

.hero-prompt {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-2);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-symbol {
  color: var(--c3);
  font-weight: 700;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-1);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.6em;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--c1);
  margin-left: 2px;
  animation: cursorBlink 0.8s steps(1) infinite;
  vertical-align: text-bottom;
}

.hero-location {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.location-pin {
  color: var(--c4);
  font-size: 0.7rem;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* Status line */
.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  max-width: 600px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: var(--c3);
  animation: pulse 2s ease-in-out infinite;
}

.status-text {
  line-height: 1.4;
}

/* ===========================
   About
   =========================== */

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  align-items: start;
}

.about-image {
  position: relative;
}

.image-placeholder {
  width: 260px;
  height: 320px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.image-linenums {
  position: absolute;
  left: -30px;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 6px;
}

.image-linenums span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-2);
  opacity: 0.4;
  line-height: 31.2px;
  text-align: right;
  width: 20px;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-block {
  position: relative;
}

.code-comment {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c3);
  opacity: 0.7;
  margin-bottom: 8px;
}

.about-block p {
  color: var(--text-1);
  font-size: 0.92rem;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  transition: border-color 0.3s ease;
}

.about-block:hover p {
  border-left-color: var(--c1);
}

/* Stats as key:value pairs */
.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 8px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.85rem;
}

.stat-key { color: var(--c2); }
.stat-sep { color: var(--text-2); }
.stat-val { color: var(--c4); font-weight: 600; }

/* ===========================
   Developer Timeline
   =========================== */

.dev-timeline {
  position: relative;
  padding-left: 32px;
  max-width: 800px;
}

.dev-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--c1), var(--c2));
  opacity: 0.3;
}

.tl-item {
  position: relative;
  margin-bottom: 36px;
}

.tl-item:last-child { margin-bottom: 0; }

.tl-node {
  position: absolute;
  left: -32px;
  top: 20px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--c1);
  z-index: 1;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tl-item:hover .tl-node {
  background: var(--c1);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.tl-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tl-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.tl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.tl-date { color: var(--c4); }
.tl-company { color: var(--c3); }
.tl-location { color: var(--text-2); }

.tl-role {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 12px;
}

.tl-details li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.6;
}

.tl-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c1);
  opacity: 0.5;
}

.tl-details li:last-child { margin-bottom: 0; }

.tl-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  font-style: italic;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tl-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c1);
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.12);
  padding: 2px 10px;
  border-radius: 3px;
}

/* ===========================
   Skills / Tech Stack
   =========================== */

.pkg-block {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.pkg-chrome {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-2);
  opacity: 0.4;
  padding: 4px 0;
}

.pkg-brace {
  display: block;
}

.pkg-group {
  margin-bottom: 32px;
  padding-left: 24px;
}

.pkg-group:last-of-type {
  margin-bottom: 12px;
}

.pkg-key {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 16px;
}

.pkg-quote { color: var(--c3); }
.pkg-colon { color: var(--text-2); margin-left: 2px; }

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

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  transition: all 0.25s var(--ease);
  cursor: default;
  position: relative;
}

.tech-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.04);
  opacity: 0;
  transition: opacity 0.25s ease;
}

@media (hover: hover) {
  .tech-item:hover::before {
    opacity: 1;
  }

  .tech-item:hover {
    border-color: rgba(0, 212, 255, 0.25);
    transform: translateY(-2px);
  }

  .tech-item:hover .tech-icon {
    color: var(--c1);
  }

  .tech-item:hover span {
    color: var(--text-0);
  }
}

.tech-icon {
  width: 32px;
  height: 32px;
  color: var(--text-2);
  transition: color 0.25s ease;
  position: relative;
  z-index: 1;
}

.tech-item span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  transition: color 0.25s ease;
  position: relative;
  z-index: 1;
}

/* ===========================
   Projects / Repo Cards
   =========================== */

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.repo-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.repo-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 212, 255, 0.06);
}

.repo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.repo-icon {
  width: 16px;
  height: 16px;
  color: var(--text-2);
  flex-shrink: 0;
}

.repo-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c1);
}

.repo-desc {
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.repo-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.lang-dot--angular { background: #dd0031; }
.lang-dot--csharp { background: #178600; }
.lang-dot--c { background: #555555; }

.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repo-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--c2);
  background: rgba(123, 47, 247, 0.08);
  border: 1px solid rgba(123, 47, 247, 0.15);
  padding: 2px 8px;
  border-radius: 3px;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  transition: color 0.25s ease;
  align-self: flex-start;
}

.repo-link:hover {
  color: var(--c1);
}

.repo-link-arrow {
  transition: transform 0.25s var(--ease);
}

.repo-link:hover .repo-link-arrow {
  transform: translateX(4px);
}

/* ===========================
   Git Activity / Heatmap
   =========================== */

.activity-shell {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.activity-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.activity-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.activity-stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}

.activity-stat-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c2);
  margin-bottom: 6px;
}

.activity-stat-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--text-0);
}

.activity-total {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 600;
  color: var(--text-0);
}

.activity-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-2);
  transition: color 0.25s ease;
}

.activity-link:hover,
.activity-link:focus-visible {
  color: var(--c1);
}

.activity-state {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
}

.activity-state--error {
  color: #ff9b9b;
}

.contrib-heatmap {
  overflow-x: auto;
  padding-bottom: 6px;
}

.contrib-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 15px;
  gap: 4px;
  margin-left: 48px;
  margin-bottom: 10px;
  min-width: max-content;
}

.contrib-month {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-0);
}

.contrib-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: max-content;
}

.contrib-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 4px;
  padding-top: 1px;
  width: 36px;
}

.contrib-weekdays span {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-0);
}

.contrib-weekdays span:nth-child(1) { grid-row: 2; }
.contrib-weekdays span:nth-child(2) { grid-row: 4; }
.contrib-weekdays span:nth-child(3) { grid-row: 6; }

.contrib-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  grid-auto-columns: 12px;
  gap: 4px;
  min-width: max-content;
}

.contrib-cell {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  background: var(--bg-3);
  transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.contrib-cell[data-level="0"] {
  background: #161b22;
}

.contrib-cell[data-level="1"] {
  background: rgba(34, 197, 94, 0.32);
}

.contrib-cell[data-level="2"] {
  background: rgba(34, 197, 94, 0.56);
}

.contrib-cell[data-level="3"] {
  background: rgba(34, 197, 94, 0.8);
}

.contrib-cell[data-level="4"] {
  background: #4fe46d;
}

.contrib-cell:hover,
.contrib-cell:focus-visible {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.2);
  filter: brightness(1.12);
}

.contrib-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.contrib-caption {
  font-size: 0.9rem;
  color: var(--text-2);
}

.contrib-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-1);
}

.contrib-legend-swatches {
  display: inline-flex;
  gap: 4px;
}

.contrib-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.contrib-swatch[data-level="0"] { background: #161b22; }
.contrib-swatch[data-level="1"] { background: rgba(34, 197, 94, 0.32); }
.contrib-swatch[data-level="2"] { background: rgba(34, 197, 94, 0.56); }
.contrib-swatch[data-level="3"] { background: rgba(34, 197, 94, 0.8); }
.contrib-swatch[data-level="4"] { background: #4fe46d; }

/* ===========================
   Education extras
   =========================== */

.certs-section {
  margin-top: 64px;
}

.sub-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-title .code-comment {
  display: inline;
  margin-bottom: 0;
}

/* Cert badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 18px;
  transition: border-color 0.3s ease;
  flex: 1;
  min-width: 220px;
}

.badge:hover {
  border-color: rgba(0, 212, 255, 0.2);
}

.badge--progress {
  border-left: 3px solid var(--c4);
}

.badge--done {
  border-left: 3px solid var(--c3);
}

.badge-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.badge-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-info strong {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-0);
}

.badge-info span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
}

/* Language pills */
.lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lang-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 20px;
  transition: border-color 0.3s ease;
}

.lang-pill:hover {
  border-color: rgba(0, 212, 255, 0.2);
}

.lang-pill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-0);
}

.lang-pill-lvl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c3);
  background: rgba(34, 197, 94, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ===========================
   Contact / Terminal
   =========================== */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.terminal-block {
  max-width: 560px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 28px 24px;
  font-family: var(--font-mono);
  margin-bottom: 32px;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.terminal-line--sub {
  margin-bottom: 0;
  margin-top: 20px;
}

.t-prompt {
  color: var(--c3);
  font-weight: 700;
}

.t-cmd {
  color: var(--text-0);
  font-size: 0.88rem;
}

.t-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--c1);
  animation: blink 1s steps(1) infinite;
  border-radius: 1px;
}

.contact-outputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 20px;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
}

.contact-key {
  color: var(--c2);
  min-width: 72px;
}

.contact-key::after {
  content: ':';
  color: var(--text-2);
  margin-left: 2px;
}

.contact-val {
  color: var(--c1);
  transition: opacity 0.3s ease;
  word-break: break-all;
}

.contact-val:hover {
  opacity: 0.7;
}

.contact-note {
  color: var(--text-2);
  font-size: 0.88rem;
  max-width: 480px;
}

.contact-form-shell {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--c3);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-1);
  color: var(--text-0);
  font: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-2);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.08);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-slot {
  min-height: 65px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.form-status {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
}

.form-status--success {
  color: var(--c3);
}

.form-status--error {
  color: #ff9b9b;
}

/* ===========================
   Footer
   =========================== */

.footer {
  background: var(--bg-0);
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
}

.footer-prompt {
  color: var(--c3);
  margin-right: 6px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
  transition: color 0.25s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--c1);
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-2);
  opacity: 0.5;
}

/* ===========================
   Scroll Reveal (Progressive)
   =========================== */

@supports (animation-timeline: view()) {
  @keyframes sectionReveal {
    from {
      opacity: 0;
      transform: translateY(32px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .section {
    animation: sectionReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 25%;
  }
}

/* ===========================
   Responsive: Tablet (768px)
   =========================== */

@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  .section {
    padding: 80px 0;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    display: flex;
    justify-content: center;
  }

  .image-placeholder {
    width: 200px;
    height: 240px;
  }

  .image-linenums {
    display: none;
  }

  .about-stats {
    gap: 10px 24px;
  }

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

  .activity-shell {
    padding: 22px 18px;
  }

  .activity-topline {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .contrib-months {
    margin-left: 44px;
  }

  .badge-row {
    flex-direction: column;
  }

  .badge {
    min-width: 0;
  }

  /* Mobile nav — command palette overlay */
  .nav-toggle-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-open .nav-links {
    opacity: 1;
    visibility: visible;
  }

  .nav-open .nav-toggle-btn span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-open .nav-toggle-btn span:nth-child(2) {
    opacity: 0;
  }

  .nav-open .nav-toggle-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-links a {
    font-size: 1.2rem;
    padding: 12px 20px;
  }

  .hero-name {
    letter-spacing: -1px;
  }

  .status-line {
    max-width: 100%;
  }

  .pkg-group {
    padding-left: 12px;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
  }

  .tech-item {
    padding: 12px 6px;
  }

  .terminal-block {
    padding: 20px 16px;
  }

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

  .contact-form-shell {
    padding: 20px 16px;
  }

  .contact-outputs {
    padding-left: 12px;
  }

  .contact-key {
    min-width: 56px;
  }
}

/* ===========================
   Responsive: Mobile (480px)
   =========================== */

@media (max-width: 480px) {
  .section {
    padding: 60px 0;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .section-tag {
    display: none;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .contrib-weekdays {
    width: 28px;
  }

  .contrib-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }

  .hero-name {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .about-stats {
    flex-direction: column;
    gap: 8px;
  }

  .stat-item {
    justify-content: space-between;
    width: 100%;
  }

  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tech-icon {
    width: 26px;
    height: 26px;
  }

  .lang-pills {
    flex-direction: column;
  }

  .footer-nav {
    flex-direction: column;
    gap: 10px;
  }

  .contact-row {
    flex-direction: column;
    gap: 2px;
  }

  .contact-key {
    min-width: 0;
  }

  .contact-key::after {
    content: '';
  }
}

/* ===========================
   Print Styles
   =========================== */

@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .scanlines,
  .skip-link,
  .nav-toggle-btn,
  .hero-decoration,
  .grid-bg,
  .image-linenums,
  .pkg-chrome,
  .typing-cursor,
  .pulse-dot,
  .footer-nav {
    display: none !important;
  }

  .navbar {
    position: static;
    background: none;
    border-bottom: 1px solid #ccc;
  }

  .nav-links {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-wrap: wrap;
  }

  .nav-links a { color: #333 !important; }

  .hero { min-height: auto; padding: 40px 0; }

  .section { padding: 40px 0; }
  .section:nth-child(even) { background: none; }

  .tl-card,
  .repo-card,
  .badge,
  .tech-item,
  .terminal-block,
  .about-stats,
  .lang-pill {
    border: 1px solid #ccc !important;
  }

  .tl-tag,
  .repo-tag {
    border: 1px solid #999 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555 !important;
  }

  .nav-links a::after,
  .nav-logo::after,
  .repo-link::after {
    content: none;
  }

  .hero-name,
  .section-title,
  .tl-role,
  .repo-name {
    color: #000 !important;
  }

  .code-comment,
  .pkg-quote,
  .pkg-colon,
  .prompt-symbol,
  .nav-prefix {
    color: #666 !important;
  }
}
