/* Wilfredo Melendez — personal site
   Palette drawn from the navy + teal circuit banner. */

:root {
  --bg: #020e24;
  --bg-elevated: #071a33;
  --navy: #02142b;
  --teal: #4ad4e0;
  --teal-dim: #2a8a9a;
  --teal-glow: rgba(74, 212, 224, 0.18);
  --text: #e8f4f8;
  --muted: #8eabb8;
  --line: rgba(74, 212, 224, 0.22);
  --max: 1080px;
  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #9aeff6; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.15em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--teal);
  color: var(--navy);
  padding: 0.5rem 0.8rem;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: min(var(--max), calc(100% - 2.4rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 14, 36, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--teal); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.15rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--teal); }

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  padding: 0.6rem;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 0 5rem;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(2, 14, 36, 0.88) 48%, rgba(2, 14, 36, 0.42) 100%),
    url("assets/circuit.jpg") right center / cover no-repeat;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 3rem;
  align-items: center;
}

.portrait {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 3px solid rgba(74, 212, 224, 0.55);
  box-shadow: 0 0 0 10px var(--teal-glow), 0 24px 50px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  color: var(--teal);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.tagline {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: #c9e4ea;
  max-width: 36rem;
}

.hero-meta {
  color: var(--muted);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}

.hero-actions, .contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); color: inherit; }
.btn-primary {
  background: var(--teal);
  color: var(--navy);
}
.btn-primary:hover { background: #9aeff6; color: var(--navy); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-elevated); border-block: 1px solid var(--line); }
.section-label {
  color: var(--teal);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
}

.prose { max-width: 42rem; }
.prose p:last-child { margin-bottom: 0; }

.edu {
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 1rem;
}

.timeline {
  list-style: none;
  max-width: 42rem;
  border-left: 2px solid var(--line);
  margin-left: 0.4rem;
  padding-left: 1.5rem;
}
.timeline li {
  position: relative;
  padding: 0 0 2.1rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -1.95rem;
  top: 0.45rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-glow);
}
.when {
  display: block;
  color: var(--teal-dim);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.org {
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.skills li {
  border: 1px solid var(--line);
  background: rgba(74, 212, 224, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.98rem;
  font-weight: 500;
}

.business-card {
  max-width: 42rem;
  padding: 2rem 2rem 2.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgba(74, 212, 224, 0.08), rgba(2, 20, 43, 0.4)),
    var(--navy);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.business-card p:last-child { margin-bottom: 0; }

.contact-lead { max-width: 36rem; color: #c9e4ea; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-note { margin: 0; }
.site-footer p { margin: 0; }

@media (max-width: 800px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 2rem;
  }
  .portrait { width: min(260px, 70vw); }
  .tagline { margin-inline: auto; }
  .hero-actions, .contact-actions { justify-content: center; }
  .hero-bg {
    background:
      linear-gradient(180deg, rgba(2, 14, 36, 0.55) 0%, var(--bg) 78%),
      url("assets/circuit.jpg") center top / cover no-repeat;
  }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: rgba(2, 14, 36, 0.97);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 0.8rem 1.2rem 1.1rem;
    gap: 0.2rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.45rem 0; }
  .business-card { padding: 1.4rem; }
}

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