/* ============================================================
   Carlos Narvaez — Embedded Systems Engineer portfolio
   Dark theme, cyan accent sampled from the Rabbit Systems logo
   ============================================================ */

:root {
  --bg: #070d13;
  --bg-alt: #0c151f;
  --card: #101c29;
  --card-edge: #1b2b3c;
  --text: #dbe7f1;
  --muted: #93a9bb;
  --accent: #1cb8f0;
  --accent-soft: rgba(28, 184, 240, 0.12);
  --accent-edge: rgba(28, 184, 240, 0.35);
  --mono: "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

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

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Top navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(7, 13, 19, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(28, 184, 240, 0.15);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { height: 54px; width: 54px; object-fit: contain; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); font-size: 0.92rem; padding: 6px 10px; border-radius: 6px;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-links a.btn-primary { color: #ffffff; }
.nav-links a.btn-primary:hover { color: #ffffff; background: #4fcbf5; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; border: 1px solid transparent; transition: all 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: #4fcbf5; }
.btn-outline { border-color: var(--accent-edge); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.nav .btn { padding: 7px 14px; font-size: 0.88rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  padding: 120px 0 70px;
  background:
    linear-gradient(180deg, rgba(7,13,19,0.82) 0%, rgba(7,13,19,0.62) 55%, var(--bg) 100%),
    url("../assets/img/landscapes/img-20200217-wa0011.jpg") center 35% / cover no-repeat;
}
.hero-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: center;
}
.hero-kicker {
  font-family: var(--mono); color: var(--accent); font-size: 0.95rem; letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.12; margin-bottom: 16px; }
.hero-sub { color: var(--muted); font-size: 1.12rem; max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.hero-social { display: flex; gap: 18px; align-items: center; }
.hero-social a { color: var(--muted); font-size: 0.95rem; display: inline-flex; align-items: center; gap: 7px; }
.hero-social a:hover { color: var(--accent); text-decoration: none; }
.hero-social svg { width: 20px; height: 20px; fill: currentColor; }
.hero-photo { position: relative; }
.hero-photo img {
  border-radius: 14px; border: 1px solid var(--accent-edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.hero-photo figcaption {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 10px; text-align: center;
}

/* ---------- Sections ---------- */
section { padding: 84px 0; }
section.alt { background: var(--bg-alt); }
.section-kicker { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
h2.section-title { font-size: 2rem; margin: 6px 0 30px; }
.lead { color: var(--muted); max-width: 760px; }

/* ---------- Section background photos ---------- */
#about {
  --about-bg: url("../assets/img/landscapes/49676449-2087801447909295-2756094017220378624-n.jpg");
  background:
    linear-gradient(rgba(7,13,19,0.88), rgba(7,13,19,0.88)),
    var(--about-bg) center/cover no-repeat;
}
#skills {
  background:
    linear-gradient(rgba(12,21,31,0.9), rgba(12,21,31,0.9)),
    url("../assets/img/landscapes/41405994-1923614777661297-3673569254361268224-n.jpg") center/cover no-repeat;
}
#experience {
  background:
    linear-gradient(rgba(7,13,19,0.9), rgba(7,13,19,0.9)),
    url("../assets/img/landscapes/47249156-2037495812939859-1110206096343040000-n.jpg") center/cover no-repeat;
}
#featured {
  background:
    linear-gradient(rgba(12,21,31,0.9), rgba(12,21,31,0.9)),
    url("../assets/img/landscapes/62882674-2326108750745229-590768636986130432-n.jpg") center/cover no-repeat;
}
#teaching {
  background:
    linear-gradient(rgba(7,13,19,0.88), rgba(7,13,19,0.88)),
    url("../assets/img/landscapes/img-20191208-wa0007.jpg") center/cover no-repeat;
}
#education {
  background:
    linear-gradient(rgba(12,21,31,0.9), rgba(12,21,31,0.9)),
    url("../assets/img/landscapes/67554432-2426694050686698-3891145988269670400-n.jpg") center/cover no-repeat;
}

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 34px; }
.skill-card {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 12px; padding: 22px;
}
.skill-card h3 { font-size: 1rem; color: var(--accent); margin-bottom: 12px; font-family: var(--mono); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--mono); font-size: 0.76rem; color: var(--text);
  background: var(--accent-soft); border: 1px solid rgba(28,184,240,0.2);
  border-radius: 5px; padding: 3px 9px; white-space: nowrap;
}

/* ---------- Experience timeline ---------- */
.timeline { margin-top: 38px; position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(28,184,240,0.08));
}
.tl-item { position: relative; padding: 0 0 38px 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -27px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
}
.tl-date { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.tl-item h3 { font-size: 1.15rem; margin: 4px 0 2px; }
.tl-company { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.tl-item ul { margin-left: 18px; color: var(--muted); font-size: 0.95rem; }
.tl-item li { margin-bottom: 4px; }

/* ---------- Project cards (featured + projects page) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 34px; }
.card {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 12px;
  overflow: hidden; color: var(--text); display: flex; flex-direction: column;
  transition: transform 0.18s, border-color 0.18s;
}
a.card:hover { transform: translateY(-4px); border-color: var(--accent-edge); text-decoration: none; }
.card img { height: 175px; width: 100%; object-fit: cover; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.05rem; }
.card-meta { font-family: var(--mono); font-size: 0.76rem; color: var(--accent); }
.card-body p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Teaching ---------- */
.teach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 30px; }
.teach-grid figure { border-radius: 10px; overflow: hidden; border: 1px solid var(--card-edge); background: var(--card); }
.teach-grid img { height: 210px; width: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.2s; }
.teach-grid img:hover { transform: scale(1.03); }
.teach-grid figcaption { padding: 10px 14px; font-size: 0.85rem; color: var(--muted); }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 30px; }
.edu-card { background: var(--card); border: 1px solid var(--card-edge); border-left: 3px solid var(--accent); border-radius: 10px; padding: 20px; }
.edu-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.edu-card p { color: var(--muted); font-size: 0.9rem; }
.edu-card.with-logo { display: flex; gap: 16px; align-items: center; }
.logo-chip {
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: 10px; background: #ffffff;
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.logo-chip img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cert-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cert-links a {
  font-family: var(--mono); font-size: 0.76rem; color: var(--accent);
  border: 1px solid var(--accent-edge); border-radius: 5px; padding: 3px 10px;
}
.cert-links a:hover { background: var(--accent-soft); text-decoration: none; }
.tl-logo {
  float: right; width: 64px; height: 64px; border-radius: 8px; background: #ffffff;
  padding: 6px; object-fit: contain; margin-left: 14px;
}
.project-logo { width: 58px; height: 58px; border-radius: 8px; object-fit: contain; }
.project-logo.on-white { background: #ffffff; padding: 5px; }

/* ---------- Contact ---------- */
.contact {
  position: relative; padding: 110px 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(7,13,19,0.72) 30%, rgba(7,13,19,0.82) 100%),
    url("../assets/img/landscapes/49759238-2092037224152384-6000908446042423296-n.jpg") center / cover no-repeat;
  text-align: center;
}
.contact h2 { font-size: 2.1rem; margin-bottom: 12px; }
.contact p { color: var(--muted); max-width: 560px; margin: 0 auto 30px; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer { padding: 34px 0; border-top: 1px solid var(--card-edge); }
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.85rem; flex-wrap: wrap;
}
.footer-inner img { height: 48px; }
.footer-inner .spacer { margin-left: auto; }

/* ---------- Projects page ---------- */
.page-hero {
  position: relative; padding: 150px 0 70px;
  background:
    linear-gradient(180deg, rgba(7,13,19,0.85) 0%, rgba(7,13,19,0.65) 60%, var(--bg) 100%),
    url("../assets/img/landscapes/img-20191123-wa0001.jpg") center 40% / cover no-repeat;
}
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin: 8px 0 12px; }
.page-hero p { color: var(--muted); max-width: 680px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 34px 0 10px; }
.chip {
  font-family: var(--mono); font-size: 0.82rem; color: var(--muted);
  background: transparent; border: 1px solid var(--card-edge); border-radius: 999px;
  padding: 7px 16px; cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--accent-edge); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #ffffff; font-weight: 600; }

.project {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px;
  padding: 30px; margin-top: 28px; scroll-margin-top: 90px;
}
.project.hidden { display: none; }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 4px; }
.project h2 { font-size: 1.45rem; }
.project-meta { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
.project-company { color: var(--muted); font-size: 0.95rem; margin-bottom: 14px; }
.project p { color: var(--muted); font-size: 0.97rem; margin-bottom: 12px; max-width: 900px; }
.project .tags { margin: 14px 0 4px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.gallery a { border-radius: 8px; overflow: hidden; border: 1px solid var(--card-edge); }
.gallery img {
  width: 100%; height: 130px; object-fit: cover; cursor: zoom-in; transition: transform 0.2s;
}
.gallery a:hover img { transform: scale(1.05); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(3, 7, 11, 0.94); align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 6px; }
.lb-caption {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: var(--muted); font-family: var(--mono); font-size: 0.85rem; padding: 0 60px;
}
.lb-btn {
  position: absolute; background: rgba(16, 28, 41, 0.85); color: var(--text);
  border: 1px solid var(--card-edge); border-radius: 50%; width: 46px; height: 46px;
  font-size: 1.35rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s, transform 0.5s; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { max-width: 340px; }
  .nav-links a:not(.btn) { display: none; }
  section { padding: 60px 0; }
}
