/* =========================================================
   Gonzalo Quispe — Portfolio
   Tema: dark slate + acento sky. HTML/CSS/JS puro.
   ========================================================= */

:root {
  --bg:        #0b1120;
  --bg-soft:   #0f172a;
  --surface:   #111c33;
  --surface-2: #16233d;
  --border:    #1e293b;
  --text:      #e2e8f0;
  --text-dim:  #b6c2d6;
  --muted:     #8896ab;
  --accent:    #38bdf8;
  --accent-2:  #a78bfa;
  --accent-soft: rgba(56, 189, 248, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --maxw: 1080px;
  --radius: 14px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56,189,248,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(167,139,250,0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  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 { width: min(var(--maxw), 92%); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 17, 32, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
  color: var(--text); letter-spacing: 0.5px;
}
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a {
  color: var(--text-dim); font-size: 0.82rem; font-weight: 500;
  font-family: var(--mono); text-decoration: none;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links .num { color: var(--accent); margin-right: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent); color: var(--accent);
  padding: 9px 16px; border-radius: 8px; font-family: var(--mono);
  font-size: 0.85rem; font-weight: 600; background: transparent;
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }
.btn--solid { background: var(--accent); color: #06263a; }
.btn--solid:hover { background: #7dd3fc; }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: 92px 0 64px; }
.hero .eyebrow {
  font-family: var(--mono); color: var(--accent); font-size: 0.95rem; margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.08;
  margin: 0 0 8px; letter-spacing: -0.02em;
}
.hero h1 .dim { color: var(--muted); }
.hero h2 {
  font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--text-dim);
  font-weight: 600; margin: 0 0 22px; letter-spacing: -0.01em;
}
.hero p.lead { max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; }
.section-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 34px;
}
.section-head h2 {
  font-size: 1.5rem; margin: 0; white-space: nowrap; letter-spacing: -0.01em;
}
.section-head .num { font-family: var(--mono); color: var(--accent); font-size: 1.05rem; }
.section-head::after {
  content: ""; height: 1px; flex: 1; background: var(--border);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 44px; align-items: start; }
.about-grid p { color: var(--text-dim); margin-top: 0; }
.about-grid .photo {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; background: var(--surface); box-shadow: var(--shadow);
  max-width: 300px; margin-inline: auto;
}
.about-grid .photo img { border-radius: 10px; width: 100%; height: auto; }
.photo-caption { text-align: center; color: var(--muted); font-size: 0.78rem; margin-top: 8px; font-family: var(--mono); }

/* ---------- Experience timeline ---------- */
.timeline { border-left: 1px solid var(--border); padding-left: 0; margin-left: 8px; }
.job { position: relative; padding: 0 0 30px 28px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -5px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(56,189,248,0.15);
}
.job .when { font-family: var(--mono); color: var(--muted); font-size: 0.8rem; }
.job h3 { margin: 4px 0 2px; font-size: 1.08rem; }
.job h3 .at { color: var(--accent); }
.job p { margin: 6px 0 10px; color: var(--text-dim); font-size: 0.95rem; }
.job ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 0.95rem; }
.job li { margin-bottom: 4px; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
.tags li {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}

/* ---------- Featured projects ---------- */
.featured { display: flex; flex-direction: column; gap: 70px; }
.project { display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; align-items: center; }
.project.reverse { direction: rtl; }
.project.reverse > * { direction: ltr; }
.project .media {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
  position: relative;
}
.project .media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.project .media .badge {
  position: absolute; top: 12px; left: 12px; font-family: var(--mono);
  font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); background: rgba(11,17,32,0.8);
  border: 1px solid var(--accent); padding: 3px 8px; border-radius: 6px;
}
.project .kicker { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; margin: 0 0 6px; }
.project h3 { margin: 0 0 10px; font-size: 1.4rem; }
.project p { color: var(--text-dim); margin: 0; }
.project .links { display: flex; gap: 16px; margin-top: 14px; font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Other projects grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card .icon { color: var(--accent); font-size: 1.5rem; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { color: var(--muted); font-size: 0.9rem; margin: 0; flex: 1; }
.card .tags { margin-top: 16px; }
.card a.more { font-family: var(--mono); font-size: 0.8rem; margin-top: 14px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.skill-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.skill-group h3 { margin: 0 0 12px; font-size: 1rem; color: var(--accent); font-family: var(--mono); }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group li {
  font-size: 0.85rem; color: var(--text-dim); background: var(--surface-2);
  border: 1px solid var(--border); padding: 5px 11px; border-radius: 8px;
}

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.edu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.edu .when { font-family: var(--mono); color: var(--accent); font-size: 0.78rem; }
.edu h3 { margin: 6px 0 4px; font-size: 1rem; }
.edu .school { color: var(--text-dim); font-size: 0.9rem; }
.edu .note { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* ---------- Contact ---------- */
.contact { text-align: center; max-width: 640px; margin-inline: auto; }
.contact .eyebrow { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.contact h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 12px 0 14px; }
.contact p { color: var(--muted); margin-bottom: 28px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 0;
  text-align: center; color: var(--muted); font-family: var(--mono); font-size: 0.8rem;
}
.site-footer a { color: var(--text-dim); }

/* ---------- Placeholders de contenido ----------
   Ocultos para el público. Para verlos, agregá "?dev" a la URL. */
.ph, .ph-inline { display: none; }
html.dev .ph {
  display: block; border: 1.5px dashed var(--accent-2); border-radius: 10px;
  background: rgba(167,139,250,0.07); color: #c4b5fd;
  font-family: var(--mono); font-size: 0.82rem;
  padding: 14px 16px; margin: 14px 0;
}
html.dev .ph::before { content: "TODO ▸ "; color: var(--accent-2); font-weight: 700; }
html.dev .ph-inline { display: inline; color: #c4b5fd; background: rgba(167,139,250,0.12); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 0.82em; }

/* ---------- Project detail page ---------- */
.detail-hero { padding: 64px 0 24px; }
.detail-hero .back { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.detail-hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 16px 0 10px; letter-spacing: -0.02em; }
.detail-hero .sub { color: var(--muted); font-size: 1.05rem; max-width: 680px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px; font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.detail-meta b { color: var(--text-dim); }
.detail-hero .kicker { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; margin: 18px 0 0; }
.detail-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-family: var(--mono); font-size: 0.85rem; }
.detail-body { padding: 26px 0 72px; }
.detail-body h2 { font-size: 1.3rem; margin: 40px 0 12px; }
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { color: var(--text-dim); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.gallery figure { margin: 0; }
.gallery img {
  border: 1px solid var(--border); border-radius: 12px;
  width: 100%; height: 300px; object-fit: cover; display: block;
}
.gallery.screens { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: start; }
.gallery.screens figure { margin: 0; background: #eef2f7; border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.gallery.screens img { width: 100%; height: auto; border: 0; border-radius: 8px; }
.prose-list { color: var(--text-dim); padding-left: 18px; }
.prose-list li { margin-bottom: 6px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Lightbox (visor de imágenes con zoom) ---------- */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(8px);
  padding: 3vh 3vw;
}
.lightbox.open { display: flex; }

.lb-stage {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.lb-img {
  max-width: 92vw; max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.95);
  cursor: zoom-in; user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
}
.lb-img.grabbing { cursor: grabbing; transition: none; }
.lb-caption {
  color: var(--text-dim); font-family: var(--mono);
  font-size: 0.85rem; text-align: center; max-width: 80vw;
}

.lb-btn {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem; line-height: 1;
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lb-btn:hover { background: var(--accent); color: #06263a; border-color: var(--accent); }

.lb-close { position: fixed; top: 18px; right: 20px; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); font-size: 1.7rem; width: 48px; height: 48px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-toolbar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px;
}
.lb-toolbar .lb-btn { width: 34px; height: 34px; font-size: 1rem; }
.lb-toolbar .lb-zoom-reset { width: auto; padding: 0 12px; border-radius: 999px; font-family: var(--mono); font-size: 0.78rem; }
.lb-counter { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; margin-left: 6px; }
body.lb-lock { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 18px 4%; gap: 14px;
  }
  .nav-toggle { display: block; }
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-grid .photo { order: -1; max-width: 240px; }
  .project, .project.reverse { grid-template-columns: 1fr; direction: ltr; }
  .grid, .edu-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 40px; }
  section.block { padding: 52px 0; }
  .lb-nav { width: 40px; height: 40px; font-size: 1.4rem; }
  .lb-img { max-height: 72vh; }
  .lb-close { top: 12px; right: 12px; }
}
