/* ============================================================
   Deepbleu Carpeso — resume site
   Design tokens, layout, and component styles.
   ============================================================ */

:root {
  --bg: #050505;
  --panel: #0F1113;
  --panel-hover: #16191C;
  --text: #E8EDF5;
  --text-dim: #9AA7BD;
  --teal: #5EEAD4;
  --indigo: #818CF8;
  --hairline: #23262B;
  --hairline-soft: #17191C;

  /* soft tints of --teal / --indigo, used for badge fills + borders */
  --teal-tint: rgba(94, 234, 212, 0.09);
  --teal-edge: rgba(94, 234, 212, 0.32);
  --indigo-tint: rgba(129, 140, 248, 0.10);
  --indigo-edge: rgba(129, 140, 248, 0.34);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--teal); color: var(--bg); }

a { color: inherit; }

/* ---------- LAYOUT PRIMITIVES ---------- */

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 28px;
}

.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--teal);
  display: inline-block;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- HERO ---------- */

header.hero {
  padding: 96px 0 64px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline-soft);
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--hairline) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 900px 550px at 30% 20%, black 10%, transparent 72%);
  opacity: 0.7;
  pointer-events: none;
  transition: transform 0.3s ease-out;
}

.streak-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 20px 0 18px;
  max-width: 12ch;
}

.hero h1 .accent { color: var(--teal); }

.hero-sub {
  font-size: 1.08rem;
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 32px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-row a, .contact-row span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-row a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* ---------- PIPELINE (signature element) ---------- */

.pipeline {
  display: flex;
  align-items: stretch;
  margin-top: 56px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}

.pipeline-stage {
  flex: 1;
  padding: 18px 20px;
  position: relative;
}

.pipeline-stage:not(:last-child)::after {
  content: '→';
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--indigo);
  font-family: var(--font-mono);
  background: var(--panel);
  width: 26px;
  text-align: center;
  z-index: 2;
  font-size: 0.9rem;
}

.pipeline-stage:not(:last-child) {
  border-right: 1px solid var(--hairline);
}

.pipeline-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.pipeline-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

@media (max-width: 640px) {
  .pipeline { flex-direction: column; }
  .pipeline-stage:not(:last-child) { border-right: none; border-bottom: 1px solid var(--hairline); }
  .pipeline-stage:not(:last-child)::after { content: '↓'; right: 20px; top: auto; bottom: -13px; transform: none; }
}

/* ---------- SECTIONS ---------- */

section { padding: 72px 0; border-bottom: 1px solid var(--hairline-soft); }
section:last-of-type { border-bottom: none; }

section h2 {
  font-size: 1.7rem;
  margin: 14px 0 36px;
}

/* ---------- EXPERIENCE ---------- */

.job {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline-soft);
}

.job:first-of-type { border-top: none; padding-top: 0; }

.job-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.job-role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.job-org { color: var(--indigo); font-size: 0.95rem; margin-bottom: 14px; }

.job ul { list-style: none; }

.job li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.job li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 1px;
}

@media (max-width: 640px) {
  .job { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- SKILLS ---------- */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.skill-group {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 22px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.skill-group:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.skill-group h3 {
  font-size: 0.95rem;
  color: var(--teal);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.skill-group p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .skill-groups { grid-template-columns: 1fr; }
}

/* ---------- PROJECTS / INFRASTRUCTURE ---------- */

.projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--hairline-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  overflow: hidden;
}

.project {
  background: var(--panel);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.project-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.project-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--indigo);
  letter-spacing: 0.05em;
}

.project-desc { color: var(--text-dim); font-size: 0.92rem; }

@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; }
}

/* ---------- GITHUB PROJECTS ---------- */

.repo-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.repo-status a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}

.repo-status a:hover { border-color: var(--teal); }

.repo-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.repo-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.repo-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}

.repo-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.repo-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  word-break: break-word;
}

.repo-arrow {
  font-family: var(--font-mono);
  color: var(--indigo);
  font-size: 0.9rem;
  flex-shrink: 0;
}

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

/* no language detected -> desc is the last child, drop its trailing gap */
.repo-desc:last-child { margin-bottom: 0; }

.repo-meta {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 6px;
}

.repo-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
}

/* Topic-driven badges. Presence is decided by GitHub topics at
   runtime; a repo with no matching topic renders no badge. */
.repo-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--text-dim);
  white-space: nowrap;
  line-height: 1.5;
}

.repo-badge--personal {
  color: var(--teal);
  border-color: var(--teal-edge);
  background: var(--teal-tint);
}

.repo-badge--ai-assisted {
  color: var(--indigo);
  border-color: var(--indigo-edge);
  background: var(--indigo-tint);
}

.repo-skeleton {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.repo-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--panel-hover), transparent);
  animation: skeleton-sweep 1.6s linear infinite;
}

@keyframes skeleton-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (max-width: 760px) {
  /* One card per view. No edge bleed: the track sits inside .wrap's
     28px gutters, so a card is exactly the padded content width and
     the neighbouring card stays fully offscreen until you advance.
     The gap only shows mid-swipe, never at rest. */
  .repo-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    /* Navigation is the buttons; the scrollbar is just noise here. */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .repo-card, .repo-skeleton {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .repo-track::-webkit-scrollbar { display: none; }
}

/* Mobile carousel controls. Hidden by default and unhidden by
   js/carousel.js only at the mobile breakpoint with >1 card, so
   the desktop grid and no-JS visitors never see them. */
.repo-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.repo-controls[hidden] { display: none; }

.repo-nav {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.repo-nav:hover { border-color: var(--teal); color: var(--teal); }
.repo-nav:active { transform: scale(0.94); }

.repo-nav:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .repo-skeleton::after { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .repo-nav { transition: none; }
  .repo-nav:active { transform: none; }
}

/* ---------- FOOTER ---------- */

footer {
  padding: 48px 0 72px;
  text-align: center;
}

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

footer .accent { color: var(--teal); }

/* ---------- MOTION / FOCUS ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skill-group { transition: none; }
}

a:focus-visible, .contact-row a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
