/* =====================================================================
   Esteban Armas Vega — Personal Website
   style.css
   ---------------------------------------------------------------------
   Theme: dark navy / charcoal with electric cyan accents.
   Design tokens live in :root below — change a value there to re-skin
   the whole site (colors, spacing, fonts).
   ===================================================================== */

/* ---------- 1. DESIGN TOKENS (edit these to re-theme) --------------- */
:root {
  --bg:            #0d1117;   /* page background (deep charcoal/navy) */
  --bg-alt:        #111827;   /* alternate section background        */
  --card:          #161b22;   /* card surface                        */
  --card-hover:    #1c2431;   /* card hover surface                  */
  --border:        #26303d;   /* subtle borders                      */
  --text:          #e6edf3;   /* primary text                        */
  --text-muted:    #9aa7b4;   /* secondary text                      */
  --accent:        #00d4ff;   /* electric cyan accent                */
  --accent-2:      #7c5cff;   /* secondary violet accent             */
  --accent-glow:   rgba(0, 212, 255, 0.35);
  --radius:        14px;
  --maxw:          1100px;
  --nav-h:         64px;
  --shadow:        0 10px 30px rgba(0, 0, 0, 0.4);
  --font:          'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------- 2. RESET & BASE ---------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

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

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }

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

section { padding: 88px 0; position: relative; }

.container { width: 92%; max-width: var(--maxw); margin: 0 auto; }

/* ---------- 3. SECTION HEADINGS ------------------------------------ */
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-align: center;
}
.section-title span { color: var(--accent); }
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 48px;
  font-size: 1rem;
}
.accent-bar {
  width: 60px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin: 12px auto 24px;
}

/* ---------- 4. NAVBAR ---------------------------------------------- */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%;
  height: var(--nav-h);
  display: flex; align-items: center;
  z-index: 1000;
  background: transparent;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.navbar.scrolled {
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 26px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent); transition: width .25s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* hamburger */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text); font-size: 1.6rem;
}

/* ---------- 5. HERO ----------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}
/* hex-grid / circuit background pattern */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("assets/hexgrid.svg");
  background-size: 420px;
  opacity: 0.5;
  z-index: 0;
  -webkit-mask-image: radial-gradient(circle at 70% 40%, #000 0%, transparent 70%);
          mask-image: radial-gradient(circle at 70% 40%, #000 0%, transparent 70%);
}
.hero::after { /* subtle glow */
  content: '';
  position: absolute; top: -20%; right: -10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  filter: blur(30px); z-index: 0; pointer-events: none;
}
.hero .container {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 40px; align-items: center;
}
.hero-eyebrow {
  color: var(--accent); font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; font-size: .8rem; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.1;
  margin-bottom: 14px;
}
.hero h1 .name-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.typewriter-wrap {
  font-size: clamp(1.1rem, 3vw, 1.6rem); font-weight: 600;
  color: var(--text); min-height: 2.2em; margin-bottom: 18px;
}
#typewriter { color: var(--accent); }
.cursor {
  display: inline-block; width: 3px; background: var(--accent);
  margin-left: 2px; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline { color: var(--text-muted); max-width: 560px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #06121a; box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover { color: #06121a; }
.btn-outline {
  background: transparent; border-color: var(--border); color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.hero-socials { display: flex; gap: 16px; }
.hero-socials a {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted);
  transition: all .2s;
}
.hero-socials a:hover {
  color: var(--accent); border-color: var(--accent);
  transform: translateY(-3px); box-shadow: 0 8px 20px var(--accent-glow);
}
.hero-socials svg { width: 20px; height: 20px; fill: currentColor; }

/* hero photo */
.hero-photo { justify-self: center; position: relative; }
.hero-photo img {
  width: 280px; height: 280px; object-fit: cover; border-radius: 24px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-photo::before {
  content: ''; position: absolute; inset: -3px; border-radius: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  z-index: -1; opacity: .6; filter: blur(6px);
}

/* ---------- 6. ABOUT + STATS -------------------------------------- */
.about { background: var(--bg-alt); }
.about-text {
  max-width: 820px; margin: 0 auto 40px; text-align: center;
  color: var(--text-muted); font-size: 1.05rem;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 820px; margin: 0 auto; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 14px; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

/* ---------- 7. TIMELINE (experience) ------------------------------ */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
  content: ''; position: absolute; left: 20px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding: 0 0 34px 60px; }
.timeline-item::before {
  content: ''; position: absolute; left: 12px; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(0,212,255,.12);
}
.timeline-item .role { font-size: 1.15rem; font-weight: 700; }
.timeline-item .company { color: var(--accent); font-weight: 600; }
.timeline-item .period {
  display: inline-block; color: var(--text-muted); font-size: .82rem;
  background: var(--card); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 20px; margin: 6px 0 10px;
}
.timeline-item ul { list-style: none; color: var(--text-muted); font-size: .95rem; }
.timeline-item li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.timeline-item li::before {
  content: '▹'; position: absolute; left: 0; color: var(--accent);
}

/* ---------- 8. EDUCATION CARDS ------------------------------------ */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.edu-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s, border-color .2s;
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.edu-card .degree { font-weight: 700; font-size: 1.08rem; margin-bottom: 4px; }
.edu-card .inst { color: var(--accent); font-weight: 600; font-size: .95rem; }
.edu-card .year { color: var(--text-muted); font-size: .82rem; margin: 6px 0; }
.edu-card .thesis { color: var(--text-muted); font-size: .9rem; font-style: italic; }

/* ---------- 9. SKILLS --------------------------------------------- */
.skills { background: var(--bg-alt); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.skill-group {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.skill-group h3 {
  font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.skill-group h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  background: rgba(0,212,255,.08); border: 1px solid var(--border);
  color: var(--text); padding: 5px 12px; border-radius: 20px; font-size: .82rem;
  transition: all .2s;
}
.badge:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 10. PUBLICATIONS -------------------------------------- */
.pub-controls { text-align: center; margin-bottom: 30px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.pub-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s, border-color .2s;
}
.pub-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.pub-card .pub-title { font-weight: 700; font-size: 1rem; line-height: 1.4; }
.pub-card .pub-meta { color: var(--text-muted); font-size: .85rem; }
.pub-card .pub-venue { color: var(--accent); font-weight: 600; }
.pub-card .pub-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px;
}
.cite-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124,92,255,.12); color: #c3b5ff;
  border: 1px solid #34305a; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600;
}
.cite-badge b { color: #fff; }

/* ---------- 11. PROJECTS ------------------------------------------ */
.projects { background: var(--bg-alt); }
.proj-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
.tab-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--text-muted);
  padding: 8px 20px; border-radius: 20px; cursor: pointer; font-weight: 600; font-size: .9rem;
  transition: all .2s;
}
.tab-btn.active, .tab-btn:hover { background: var(--accent); color: #06121a; border-color: var(--accent); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: transform .2s, border-color .2s;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.project-card.hidden { display: none; }
.project-card .proj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.project-card .proj-name { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.project-card .status-pill {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 20px;
}
.status-active { background: rgba(0,255,150,.12); color: #45e0a0; border: 1px solid #1c5b41; }
.status-completed { background: rgba(255,255,255,.06); color: var(--text-muted); border: 1px solid var(--border); }
.project-card .proj-prog { color: var(--accent); font-size: .82rem; font-weight: 600; margin-bottom: 8px; }
.project-card .proj-desc { color: var(--text-muted); font-size: .9rem; flex-grow: 1; }
.project-card .proj-period { color: var(--text-muted); font-size: .8rem; margin-top: 10px; }

/* ---------- 12. CONTACT ------------------------------------------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 900px; margin: 0 auto; }
.contact-info { display: flex; flex-direction: column; gap: 18px; }
.contact-item { display: flex; align-items: center; gap: 14px; }
.contact-item .ci-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--border);
  color: var(--accent);
}
.contact-item .ci-icon svg { width: 20px; height: 20px; fill: currentColor; }
.contact-item .ci-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-item .ci-value { font-weight: 600; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form input, .contact-form textarea {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: .95rem; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- 13. FOOTER ------------------------------------------- */
footer {
  border-top: 1px solid var(--border); padding: 30px 0; text-align: center;
  color: var(--text-muted); font-size: .88rem;
}
footer .foot-socials { display: flex; justify-content: center; gap: 16px; margin-bottom: 14px; }
footer .foot-socials a { color: var(--text-muted); }
footer .foot-socials a:hover { color: var(--accent); }
footer .foot-socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- 14. SCROLL-REVEAL ANIMATION -------------------------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* back-to-top */
#toTop {
  position: fixed; bottom: 26px; right: 26px; width: 46px; height: 46px;
  border-radius: 50%; border: none; cursor: pointer; z-index: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121a;
  font-size: 1.2rem; opacity: 0; pointer-events: none; transition: opacity .3s, transform .2s;
  box-shadow: 0 8px 24px var(--accent-glow);
}
#toTop.show { opacity: 1; pointer-events: auto; }
#toTop:hover { transform: translateY(-3px); }

/* ---------- 15. RESPONSIVE --------------------------------------- */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { order: -1; }
  .hero-photo img { width: 200px; height: 200px; }
  .hero-cta, .hero-socials { justify-content: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; width: 100%;
    flex-direction: column; gap: 0;
    background: rgba(13,17,23,.97); backdrop-filter: blur(12px);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links li { width: 100%; text-align: center; border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: 14px 0; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  section { padding: 64px 0; }
}
