/* ==========================================================================
   Miguel Zumaquero Bernal — Android Developer Portfolio
   ========================================================================== */

:root {
  --green: #3DDC84;
  --green-dark: #23A55D;
  --green-glow: rgba(61, 220, 132, 0.35);

  --bg: #0E1512;
  --bg-alt: #121A16;
  --surface: #17211C;
  --surface-2: #1D2921;
  --border: #26332B;
  --ink: #F3F7F4;
  --ink-soft: #A9B6AE;
  --ink-faint: #71807A;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(61, 220, 132, 0.15), 0 12px 40px rgba(61, 220, 132, 0.12);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Light mode override (manual toggle support, dark is default) */
:root[data-theme="light"] {
  --bg: #F6FAF7;
  --bg-alt: #EEF4F0;
  --surface: #FFFFFF;
  --surface-2: #F1F6F2;
  --border: #DDE7E0;
  --ink: #10231A;
  --ink-soft: #4B5C53;
  --ink-faint: #7C8B82;
  --shadow-sm: 0 2px 8px rgba(16, 35, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 35, 26, 0.08);
  --shadow-lg: 0 20px 60px rgba(16, 35, 26, 0.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green);
  color: #05170D;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ---------- navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  padding: 18px 0;
  transition: background 0.35s var(--ease), padding 0.35s var(--ease), box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.navbar.scrolled {
  background: rgba(14, 21, 18, 0.75);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .navbar.scrolled { background: rgba(246, 250, 247, 0.8); }

.nav { display: flex; align-items: center; justify-content: space-between; }

.nav-brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-brand .dot { color: var(--green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--green);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  background: var(--green);
  color: #05170D !important;
  padding: 9px 18px !important;
  border-radius: 999px;
  font-weight: 700 !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--green-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--d, 0) * 0.08s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(6, 12, 10, 0.55), rgba(6, 12, 10, 0.85) 65%, var(--bg) 100%),
    linear-gradient(to right, rgba(6, 12, 10, 0.75), rgba(6, 12, 10, 0.35) 60%),
    url("assets/hero-workspace.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 62ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--green-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.hero h1 {
  font-size: clamp(1.6rem, 7.5vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 12px;
  white-space: nowrap;
}

.hero-role {
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 600;
  color: var(--green);
  margin: 0 0 14px;
}

.hero-stack {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0 0 22px;
  font-weight: 500;
}
.hero-stack .sep { color: var(--green); margin: 0 8px; }

.hero-desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  color: #05170D;
  box-shadow: 0 8px 24px var(--green-glow);
}
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 12px 32px var(--green-glow); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

.btn-full { width: 100%; justify-content: center; }

.hero-social {
  display: flex;
  gap: 16px;
}
.hero-social a {
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  transition: all 0.25s var(--ease);
}
.hero-social a:hover {
  color: #05170D;
  background: var(--green);
  border-color: var(--green);
  transform: translateY(-3px);
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-faint);
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ---------- sections ---------- */
.section {
  padding: clamp(64px, 10vw, 120px) 0;
}
.section-alt { background: var(--bg-alt); }

.section-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 10px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
}

.section-note {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: -20px 0 40px;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  gap: 20px;
  max-width: 900px;
  margin-bottom: 48px;
}
.about-text {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0;
}
.about-text strong { color: var(--ink); font-weight: 600; }

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.stat:hover { transform: translateY(-4px); border-color: var(--green); }
.stat-num {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--green);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- tech grid ---------- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.tech-grid + .tech-subtitle {
  margin-top: 40px;
}
.tech-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
}
.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tech-card:hover {
  transform: translateY(-6px);
  border-color: var(--green);
  box-shadow: var(--shadow-glow);
}
.tech-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.tech-icon img { width: 28px; height: 28px; object-fit: contain; }
.tech-name { font-size: 0.88rem; font-weight: 600; color: var(--ink); }

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -39px;
  top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--green);
  box-shadow: 0 0 0 4px var(--green-glow);
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.timeline-card:hover { transform: translateX(4px); border-color: var(--green); }
.timeline-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.timeline-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.timeline-head h3 span { color: var(--green); font-weight: 600; }
.timeline-date {
  font-size: 0.82rem;
  color: var(--ink-faint);
  white-space: nowrap;
}
.timeline-card ul {
  margin: 0 0 12px;
  padding-left: 18px;
  list-style: disc;
  color: var(--ink-soft);
  font-size: 0.94rem;
}
.timeline-card li { margin-bottom: 4px; }
.timeline-clients {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0;
}
.timeline-clients strong { color: var(--ink-soft); }

/* ---------- projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--green);
  box-shadow: var(--shadow-glow);
}
.project-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--green);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.project-card:hover .project-icon {
  background: var(--green-glow);
  border-color: var(--green);
}
.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.project-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0 0 16px;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.project-tags span {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--green);
  border: 1px solid var(--border);
}
.project-badge {
  display: inline-block;
  font-size: 0.74rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- skills ---------- */
.skills-bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 40px;
}
.skill-row { }
.skill-row-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.skill-row-head span:last-child { color: var(--green); }
.skill-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transition: width 1.1s var(--ease);
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 6vw, 64px);
  align-items: start;
}
.contact-desc {
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0 0 28px;
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.contact-list svg { color: var(--green); flex-shrink: 0; }
.contact-list a:hover { color: var(--green); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input, .field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.field input:invalid:not(:placeholder-shown) {
  border-color: #E5484D;
}
.form-status {
  min-height: 20px;
  font-size: 0.88rem;
  color: var(--green);
  margin: 0;
}
.form-status.is-error { color: #E5484D; }

/* ---------- footer ---------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 44px 0 28px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.footer-tag {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: 6px 0 0;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.footer-links a:hover { color: var(--green); }
.footer-copy {
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin: 0;
  width: 100%;
  text-align: right;
}

/* ---------- back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: #05170D;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 800;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-4px); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { margin: 0 auto; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-social { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    z-index: 950;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .skills-bars { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
}
