/* ================================================================
   DIEGO ROBLES COSTA — PORTFOLIO
   Direction : Magic Portfolio–inspired. Quiet, refined, dark.
   Palette   : near-black neutrals · soft white · restrained glow
================================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:        #0a0a0c;
  --surface:   #121215;
  --surface-2: #17171b;
  --border:    rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);

  --fg:     #ececef;
  --muted:  #8f8f98;
  --faint:  #5c5c64;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-lg: 20px;
  --r-md: 14px;
  --r-pill: 999px;

  --gutter: clamp(1.5rem, 5vw, 4rem);
  --vpad:   clamp(5rem, 12vh, 8.5rem);
  --nav-h:  64px;
  --maxw:   1080px;
}

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

html { scroll-behavior: smooth; background: var(--bg); }

body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(255,255,255,0.04), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a   { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: rgba(255, 244, 224, 0.2); }

/* ── Reveal on scroll ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Shared UI ───────────────────────────────────────────── */
.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sec-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.sec-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  padding: 0.6em 1.4em;
  border: 1px solid var(--border);
  transition: background 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.btn-solid { background: var(--fg); color: #0c0c0e; border-color: var(--fg); }
.btn-solid:hover { background: #fff; transform: translateY(-1px); }

.btn-ghost { color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--border-hi); background: rgba(255,255,255,0.04); }

.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  color: var(--muted);
  background: transparent;
}
.btn-icon:hover { color: var(--fg); border-color: var(--border-hi); }

.btn-sm { font-size: 0.78rem; padding: 0.45em 1.1em; }

/* ================================================================
   NAV
================================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 12, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

#nav.is-scrolled { border-bottom-color: var(--border); }

.nav-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.nav-accent { color: var(--muted); }

#nav nav { display: flex; gap: 0.25rem; }

#nav nav a {
  font-size: 0.83rem;
  color: var(--muted);
  padding: 0.4em 0.85em;
  border-radius: var(--r-pill);
  transition: color 0.15s ease, background 0.15s ease;
}

#nav nav a:hover { color: var(--fg); background: rgba(255,255,255,0.05); }

/* ================================================================
   HERO
================================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) 0 3rem;
}

.hero-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(3rem, 6vw, 5rem);
  align-items: center;
}

.hero-copy { max-width: 40rem; }

/* headshot */
.hero-portrait {
  position: relative;
  width: clamp(220px, 24vw, 300px);
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #1c1c21, #101013);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-portrait img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.hp-fallback {
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.hero-name {
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: 1.25rem;
}

.hero-tagline {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 450;
  color: var(--muted);
  line-height: 1.7;
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ================================================================
   ABOUT + SKILLS
================================================================ */
#about { padding: var(--vpad) 0; }

.about-body { margin-bottom: 4rem; }

.about-p {
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 42rem;
}

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

.skill-group {
  --acc: var(--fg);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* accent hairline across the top */
.skill-group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--acc), transparent 70%);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

/* faint ambient tint that breathes in on hover */
.skill-group::after {
  content: '';
  position: absolute;
  top: -60px; left: -40px;
  width: 220px; height: 180px;
  background: radial-gradient(closest-side, var(--acc), transparent);
  opacity: 0.05;
  filter: blur(30px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.skill-group:hover {
  border-color: color-mix(in srgb, var(--acc) 35%, var(--border));
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.skill-group:hover::before { opacity: 1; }
.skill-group:hover::after  { opacity: 0.12; }

/* staggered reveal */
.skills-wrap .skill-group:nth-child(2) { transition-delay: 0.08s; }
.skills-wrap .skill-group:nth-child(3) { transition-delay: 0.16s; }
.skills-wrap .skill-group:nth-child(4) { transition-delay: 0.24s; }
.skills-wrap .skill-group:hover { transition-delay: 0s; }

.sg-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.15rem;
}

.sg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent);
  flex-shrink: 0;
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.32em 0.85em;
  white-space: nowrap;
  cursor: default;
  transition: color 0.18s ease, border-color 0.18s ease,
              background 0.18s ease, transform 0.18s ease;
}

.chip:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--acc) 45%, var(--border));
  background: color-mix(in srgb, var(--acc) 8%, var(--surface-2));
  transform: translateY(-1px);
}

/* ================================================================
   PROJECTS
================================================================ */
#projects { padding: var(--vpad) 0; }

.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.proj-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.9rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.proj-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.pc-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--faint);
}

.pc-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pc-link:hover { color: var(--fg); border-color: var(--border-hi); background: rgba(255,255,255,0.05); }

.pc-title {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.pc-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ================================================================
   EXPERIENCE
================================================================ */
#experience { padding: var(--vpad) 0; }

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.tl-item {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
}

/* company logo on a light tile so any logo reads on dark */
.tl-logo {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: #f4f3f0;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  overflow: hidden;
}

.tl-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}

.tl-body { flex: 1; }

.tl-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tl-role { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

.tl-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  white-space: nowrap;
}

.tl-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 44rem;
}

/* ── DevFest highlight card ─────────────────────────────── */
.feature-card {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.feature-media {
  min-height: 260px;
  background: var(--surface-2);
}

.feature-media img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.feature-media.no-img { display: none; }
.feature-card:has(.feature-media.no-img) { grid-template-columns: 1fr; }

.feature-body {
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.8rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.feature-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.75;
}

.feature-desc + .feature-desc { margin-top: 0.8rem; }

/* ================================================================
   CERTIFICATIONS
================================================================ */
#certifications { padding: var(--vpad) 0 0; }

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

.cert-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.6rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.cert-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.cert-badge {
  flex-shrink: 0;
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-badge img { width: 100%; height: 100%; object-fit: contain; }
.cert-badge.no-img { display: none; }

.cert-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.cert-issuer {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ================================================================
   CONTACT + FOOTER
================================================================ */
#contact { padding: var(--vpad) 0 0; }

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  padding-bottom: 5rem;
}

.contact-headline {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.contact-email {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--muted);
  border-bottom: 1px solid var(--border-hi);
  padding-bottom: 2px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.contact-email:hover { color: var(--fg); border-color: var(--fg); }

.contact-links { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.8rem; }

.footer-bar {
  border-top: 1px solid var(--border);
  padding: 1.5rem var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-bar p {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-portrait { order: -1; }
  .proj-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-media { min-height: 220px; }
}

@media (max-width: 560px) {
  #nav nav { display: none; }
  .hero-actions .btn-solid,
  .hero-actions .btn-ghost { flex: 1 1 auto; }
  .tl-top { flex-direction: column; gap: 0.2rem; }
  .footer-bar { flex-direction: column; text-align: center; }
}
