:root {
  --bg: #0a0c10;
  --desk: #0f131a; /* retro dark */
  --panel: #0b0f15;
  --panel-border: #1c2430;
  --win: rgba(24, 32, 44, 0.82);
  --win-solid: #18202c;
  --win-border: #5f748f;
  --accent: #7cc5ff;
  --text: #e7edf5;
  --muted: #9fb3c9;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --radius: 12px;
  --z-panel: 1000;
  --z-menu: 9999;
  --z-window: 1200;
  --z-tooltip: 1400;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-size: 0.97rem;
  line-height: 1.55;
  margin: 0;
  background: radial-gradient(1200px 800px at 20% 10%, #111927 0%, #0a0c10 60%, #06080d 100%);
  color: var(--text);
  user-select: none;
  overflow: hidden;
  font-family: "Cascadia Code", "Cascadia Mono", "Fira Code", monospace;
  font-feature-settings: "liga" 1, "calt" 1; /* Habilita ligaduras si el navegador las soporta */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Desktop */
.desktop {
  position: fixed; inset: 0; display: grid; grid-template-rows: 1fr 42px;
  background-image:
    url("https://fedoraproject.org/w/uploads/f/f9/F42-01-night.jpg"),
    radial-gradient(1px 1px at 25% 30%, rgba(124,197,255,.15) 0, transparent 60%),
    radial-gradient(1px 1px at 70% 60%, rgba(124,197,255,.08) 0, transparent 60%);
  background-size: cover, auto, auto;
  background-position: center;
  background-repeat: no-repeat;
}
.desktop-grid { padding: 20px; display: flow; grid-auto-rows: 92px; grid-template-columns: repeat(auto-fill, 92px); gap: 18px; align-content: start; }
.icon { width: 92px; height: 92px; display: grid; grid-template-rows: 56px 1fr; place-items: center; border-radius: 10px; cursor: default; }
.icon:hover { background: rgba(255,255,255,0.04); }
.icon img { width: 42px; height: 42px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.icon span { text-align: center; font-size: 12px; color: var(--muted); padding: 0 6px; }
/* Panel */
.panel {
  position: relative;
  grid-row: 2;
  display: grid;
  grid-template-columns: 91px 1fr 280px;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: var(--panel); border-top: 1px solid var(--panel-border); box-shadow: 0 -12px 24px rgba(0,0,0,.35) inset; z-index: var(--z-panel); }
.start { display: flex; align-items: center; gap: 8px; background: #2a3a50; padding: 6px 10px; border: 1px solid #1b2633; border-radius: 8px; cursor: default; }
.start:hover { outline: 1px solid #2b3a4e; }
.start svg { width: 16px; height: 16px; }
.taskbar { display: flex; gap: 8px; overflow-x: visible; padding: 2px; scrollbar-width: thin; }
.task { background: #0d141d; border: 1px solid #1c2736; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: default; }
.task.active { outline: 1px solid var(--accent); color: var(--text); }
.status { display: flex; gap: 10px; justify-content: end; align-items: center; font-size: 12px; color: var(--muted); }
.badge { padding: 4px 8px; border: 1px solid #1c2736; border-radius: 8px; }
/* Start Menu */
.menu {
  position: fixed;
  bottom: 50px;
  left: 10px;
  width: 320px;
  background: #0d131b;
  border: 1px solid #1b2736; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: grid; gap: 8px;
  z-index: var(--z-menu);
}
.menu .item { padding: 10px; border-radius: 10px; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; cursor: default; }
.menu .item:hover { background: rgba(255,255,255,0.05); }
.menu .hint { font-size: 11px; color: var(--muted); }
/* Windows */
.window { position: absolute; top: 140px; left: 140px; width: 720px; min-width: 340px; height: 460px; min-height: 220px; background: var(--win); border: 1px solid var(--win-border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-rows: 38px 1fr; overflow: hidden; backdrop-filter: blur(12px) saturate(1.05); -webkit-backdrop-filter: blur(12px) saturate(1.05); }
.window.solid { background: var(--win-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
.titlebar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 0 8px; background: linear-gradient(180deg, rgba(124,197,255,.12), rgba(124,197,255,0)); border-bottom: 1px solid rgba(124,197,255,.18); cursor: move; }
.titlebar .title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.titlebar .controls { display: flex; gap: 6px; }
.btn { width: 28px; height: 24px; display: grid; place-items: center; border: 1px solid #2a3a50; border-radius: 8px; background: #0d141d; cursor: default; }
.btn:hover { outline: 1px solid var(--accent); }
.content { padding: 16px; overflow: auto; }
.resizer { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.ghost { position:absolute; border:2px dashed rgba(124,197,255,.6); border-radius: var(--radius); pointer-events:none; }
a, .link { color: var(--accent); text-decoration: none; }
.kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background: #0b1118; border: 1px solid #1c2736; border-radius: 6px; padding: 2px 6px; }
.grid { display: grid; gap: 10px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.muted { color: var(--muted); }
.hr { height: 1px; background: #1c2736; margin: 8px 0; }
.pill { font-size: 12px; padding: 4px 8px; border-radius: 999px; background: rgba(124,197,255,.1); border: 1px solid rgba(124,197,255,.25); }
.list { display: grid; gap: 8px; }
.list li { margin-left: 18px; }
@media (max-width: 840px) {
  .window { width: calc(100vw - 24px); left: 12px; }
  .desktop-grid { grid-template-columns: repeat(auto-fill, 76px); grid-auto-rows: 88px; gap: 12px; }
  .icon { width: 76px; height: 88px; }
}
/* --- compositor: transiciones base y material --- */
.window {
  transition: transform .24s ease, opacity .24s ease, box-shadow .18s ease;
  will-change: transform, opacity, box-shadow;
}
.window.is-opening { opacity: 0; transform: scale(.96); }
.window.is-open    { opacity: 1; transform: scale(1); }
.window.is-closing { opacity: 0; transform: scale(.96); }

.window.has-shadow-weak  { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.window.has-shadow-strong{ box-shadow: 0 16px 40px rgba(0,0,0,.55); }

/* Efectos avanzados */
.window.fly {
  transition: transform .24s ease, opacity .24s ease !important;
}

@keyframes shake-x {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.window.shake { animation: shake-x .28s ease; }

@keyframes pulse-attn {
  0%, 100% { box-shadow: 0 0 0 rgba(124,197,255,0); }
  50% { box-shadow: 0 0 0 3px rgba(124,197,255,.35); }
}
.task.attention { animation: pulse-attn 1.2s ease-in-out 2; }
.window.attention { animation: pulse-attn 1.2s ease-in-out 2; }

.window {
  transition: transform .24s ease, opacity .24s ease, box-shadow .18s ease, backdrop-filter .24s ease, background .24s ease;
  will-change: transform, opacity, box-shadow;
}

.desktop.parallax {
  transition: background-position .06s linear;
}
/* ===== Scrollbar design for window content ===== */
.content {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(124,197,255,.3) rgba(20,28,38,.6); /* thumb / track */
}

/* Chrome, Edge, Safari */
.content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.content::-webkit-scrollbar-track {
  background: rgba(20,28,38,.6);
  border-radius: 10px;
  margin: 4px;
}

.content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124,197,255,.5), rgba(124,197,255,.25));
  border-radius: 10px;
  border: 2px solid rgba(20,28,38,.6); /* halo para integrar con fondo */
  backdrop-filter: blur(4px);
}

.content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(124,197,255,.7), rgba(124,197,255,.4));
}

.content::-webkit-scrollbar-corner {
  background: rgba(20,28,38,.6);
}

.window.solid .content::-webkit-scrollbar-thumb {
  background: rgba(124,197,255,.25);
  border-color: #0d141d;
}

@media (max-width: 768px) {
  .window {
    left: 50% !important;
    top: 60px !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 32px) !important;
    height: calc(100vh - 240px) !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 10px;
  }
  .titlebar {
    cursor: default; /* Evitar drag accidental en móvil */
  }
}

@media (max-width: 768px) {
  .menu {
    width: 70vw;
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
  }
}

/* === Projects Layout === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 32px;
  padding: 12px 0;
}

.project-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-group h3 {
  font-size: 1.1rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(124,197,255,0.25);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* Lista interna de proyectos */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 20px;
}

/* Proyecto individual */
.project {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(124,197,255,0.12);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-height: 72px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.project:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(124,197,255,0.3);
}

.project h4 {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.project a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  margin-top: 4px;
}

.project img {
  max-height: 150px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.project .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  min-height: 38px;
  text-wrap: balance;
}

.project .usage {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.about-profile {
  white-space: pre-line;
  line-height: 1.6;
}

/* Responsive: columna única */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-list {
    grid-template-columns: 1fr;
  }
}

/* --- Descripciones de grupo --- */
.group-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* --- Descripciones de proyecto --- */
.project .desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.3;
  margin: 0;
  min-height: 32px; /* asegura que todos los bloques tengan altura similar */
  text-wrap: balance;
}

/* === About section styling === */
.about {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 4px;
  line-height: 1.5;
  color: var(--text);
}

.about-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.about-avatar {
  font-size: 28px;
  background: rgba(124,197,255,0.12);
  border: 1px solid rgba(124,197,255,0.25);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.about-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.about-summary {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 4px 0 0;
}

.about-body {
  color: var(--text);
  font-size: 0.95rem;
}

.about-info {
  gap: 10px 24px;
  margin-top: 4px;
}

.about-col {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(124,197,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.about-col:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(124,197,255,0.25);
}

.about-col strong {
  color: var(--accent);
}

@media (max-width: 768px) {
  .about-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .about-info {
    grid-template-columns: 1fr;
  }
}

/* === Experience Section === */
.experience {
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.5;
}

.exp-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.exp-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(124, 197, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.exp-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 197, 255, 0.25);
}

.exp-card header {
  margin-bottom: 6px;
}

.exp-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin: 0;
}

.role {
  font-size: 0.9rem;
  color: var(--text);
  margin: 2px 0 0;
}

.period {
  color: var(--muted);
  font-style: italic;
}

.exp-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.exp-card li {
  margin-bottom: 4px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .exp-card {
    padding: 10px 12px;
  }
  .exp-card ul {
    padding-left: 16px;
  }
}

/* === Skills Section === */
.skills {
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.5;
}

.skills-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px 24px;
}

.skills-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Sub-bloques */
.skills-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(124, 197, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
  color: var(--accent);
  font-weight: 600;
}

.skills-block:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 197, 255, 0.25);
}

/* Subtítulos internos */
.skills-block h3 {
  font-weight: 600;
  border-bottom: 1px solid rgba(124, 197, 255, 0.15);
  padding-bottom: 2px;
  margin-bottom: 6px;
  font-size: 1.05rem;
  color: var(--text);
}

/* Textos */
.skills-block p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0;
}

.skills-block .desc {
  color: var(--muted);
  text-wrap: balance;
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.95;
}

.skills-block:hover .desc {
  color: var(--text);
  opacity: 1;
  transition: color 0.25s ease, opacity 0.25s ease;
}


@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* === Education Section === */
.education {
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.5;
}

.edu-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(124, 197, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.edu-block:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 197, 255, 0.25);
}

.edu-block header {
  margin-bottom: 4px;
}

.edu-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}

.edu-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.edu-detail {
  color: var(--text);
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.edu-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.edu-list li {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .edu-block {
    padding: 10px 12px;
  }
}

/* === Download Section === */
.download {
  display: flex;
  flex-direction: column;
  gap: 16px;
  line-height: 1.5;
}

.download-header {
  margin-bottom: 6px;
}

.download-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Botón principal: descargar */
.btn-download {
  display: inline-block;
  text-align: center;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(124, 197, 255, 0.25);
  background: linear-gradient(180deg, rgba(124,197,255,.15), rgba(124,197,255,.05));
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-download:hover {
  background: rgba(124,197,255,.25);
  border-color: rgba(124,197,255,.4);
}

/* Botón secundario: ver CV */
.btn-view {
  display: inline-block;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(124,197,255,0.15);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-view:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(124,197,255,0.3);
  color: var(--text);
}

.download-footer {
  display: flex;
  justify-content: start;
  font-size: 0.9rem;
}

.download-footer nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-footer a {
  font-weight: 500;
}

@media (max-width: 640px) {
  .download-actions {
    gap: 8px;
  }
  .btn-download, .btn-view {
    width: 100%;
    text-align: center;
  }
}

/* === Contact Section === */
.contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.5;
}

.contact-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(124, 197, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 197, 255, 0.25);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.95rem;
}

.contact-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.contact-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.contact-link:hover {
  color: #b4ddff;
  text-shadow: 0 0 4px rgba(124,197,255,0.4);
}

.contact-footnote {
  font-size: 0.85rem;
  margin-top: 4px;
  color: var(--muted);
  text-align: left;
}

@media (max-width: 640px) {
  .contact-card {
    padding: 10px 12px;
  }
  .contact-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Document Viewer === */
.doc-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(124,197,255,.12), rgba(124,197,255,0));
  border-bottom: 1px solid rgba(124,197,255,.18);
  padding: 8px 12px;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
}

.doc-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-doc {
  display: inline-block;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(124,197,255,0.25);
  color: var(--accent);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-doc:hover {
  background: rgba(124,197,255,0.15);
  border-color: rgba(124,197,255,0.4);
  color: #b4ddff;
}

.doc-frame {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 10px 10px;
  background: rgba(0, 0, 0, 0.2);
}

.doc-content {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
  .doc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

.about {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 0.97rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
}


.about p, .about h2, .about h3 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

.skills, .projects, code, pre, .kbd, .desc {
  font-family: "Cascadia Code", "Cascadia Mono", monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

