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

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #1a1a1a;
  --panel: #222222;
  --border: #2a2a2a;
  --borderl: #3a3a3a;
  --text: #f4f4f4;
  --text2: #c0c0c0;
  --textm: #8a8a8a;
  --primary: #0b4eff;
  --second: #6b4e9c;
  --teal: #8fb8b0;
  --ft: "Bitcount Grid Double", monospace;
  --fb: "Playfair Display", serif;
  --fl: "Cormorant Garamond", serif;
  --nav-height: 64px;
  font-size: 18px;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  overflow: hidden;
}

/* Navegación */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.8rem;
  background: rgba(10,10,10,0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.nav-clock {
  font-family: var(--fl);
  font-size: 1.4rem;        /* más grande */
  letter-spacing: 0.2em;
  color: var(--primary);
  min-width: 140px;
  font-weight: 600;
}
.nav-logo { font-family: var(--ft); font-size: 1.2rem; letter-spacing: 0.3em; color: var(--text); text-transform: uppercase; }
.nav-links { display: flex; gap: 2.8rem; list-style: none; }
.nav-links a { font-family: var(--fl); font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--textm); cursor: pointer; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

#stage { position: fixed; top: var(--nav-height); left: 0; right: 0; bottom: 0; overflow: hidden; }
#rail { display: flex; height: 100%; transition: transform 0.65s cubic-bezier(0.77,0,0.175,1); will-change: transform; }
.panel { flex: 0 0 100vw; width: 100vw; height: 100%; position: relative; overflow: hidden; }

/* Flechas más grandes y cuadradas */
.arr {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 300;
  width: 64px; height: 64px;
  background: rgba(20,20,20,0.9);
  border: 2px solid var(--borderl);
  color: var(--textm);
  font-size: 2.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: all 0.2s;
  border-radius: 0;   /* cuadrado */
}
.arr:hover { border-color: var(--primary); color: var(--text); background: #000; }
#ap { left: 1.5rem; } #an { right: 1.5rem; }
.arr.gone { opacity: 0; pointer-events: none; }

#pdots { position: fixed; bottom: 1.8rem; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; gap: 0.7rem; }
.pd { width: 8px; height: 8px; border-radius: 50%; background: var(--borderl); cursor: pointer; transition: 0.25s; }
.pd.on { background: var(--primary); transform: scale(1.6); }

/* P0 · Hero */
#p0 { display: flex; }
.sidebar {
  width: 26%; min-width: 260px; height: 100%;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 3rem 2rem; position: relative;
}
.sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg,var(--primary),var(--second)); }
.sb-brand { font-family: var(--ft); font-size: 0.9rem; letter-spacing: 0.3em; color: var(--primary); }
.sb-avatar {
  width: 200px; height: 200px;        /* más grande y cuadrado */
  border: 1px solid var(--borderl);
  overflow: hidden;
  background: var(--card);
  margin: 2rem 0;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: contain; }
.sb-type-wrap { text-align: center; }
.sb-type-lbl { font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.35em; color: var(--textm); margin-bottom: 0.6rem; }
.sb-type { font-family: var(--fl); font-style: italic; font-size: 1.2rem; color: var(--teal); min-height: 1.8em; }
.sb-type::after { content: '|'; animation: blink 0.8s step-end infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }
.btn-cat { padding: 0.9rem 2rem; border: 1.5px solid var(--primary); color: var(--primary); font-family: var(--fl); font-size: 0.85rem; letter-spacing: 0.25em; text-transform: uppercase; background: transparent; cursor: pointer; transition: 0.2s; margin-top: auto; }
.btn-cat:hover { background: var(--primary); color: #fff; }

.carousel { flex: 1; position: relative; overflow: hidden; }
.cs { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
.cs.on { opacity: 1; }
.cs img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.45) saturate(0.7); }
.cs-ov { position: absolute; inset: 0; background: linear-gradient(120deg, rgba(0,0,0,0.6), rgba(0,0,0,0.3)); pointer-events: none; }
.cs-info { position: absolute; bottom: 4rem; left: 3.5rem; max-width: 600px; }
.cs-lbl { font-family: var(--fl); font-size: 0.8rem; letter-spacing: 0.4em; color: var(--teal); margin-bottom: 1rem; }
.cs-h { font-family: var(--ft); font-size: clamp(2.5rem,5vw,5.5rem); line-height: 0.95; margin-bottom: 1.2rem; }
.cs-sub { font-family: var(--fb); font-size: 1rem; color: var(--text2); }
.cdots { position: absolute; bottom: 4rem; right: 3.5rem; display: flex; gap: 0.7rem; }
.cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--textm); cursor: pointer; transition: 0.2s; }
.cdot.on { background: var(--primary); transform: scale(1.5); }

/* P1 · Strip */
#p1 { display: flex; flex-direction: column; background: var(--bg); }
.strip-head { height: 90px; display: flex; align-items: center; justify-content: space-between; padding: 0 3.5rem; border-bottom: 1px solid var(--border); }
.sh-lbl { font-family: var(--fl); font-size: 0.75rem; letter-spacing: 0.4em; color: var(--textm); }
.sh-title { font-family: var(--ft); font-size: 2rem; letter-spacing: 0.08em; }
.sh-hint { font-family: var(--fl); font-size: 0.8rem; letter-spacing: 0.25em; color: var(--textm); display: flex; gap: 0.5rem; }
.sh-hint span { animation: arr 1s infinite alternate; }
@keyframes arr { to { transform: translateX(6px); } }
.strip { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.strip::-webkit-scrollbar { display: none; }
.pc { flex: 0 0 75vw; height: 100%; scroll-snap-align: center; position: relative; overflow: hidden; cursor: pointer; border-right: 1px solid var(--border); }
.pc img.pc-img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.4) saturate(0.65); transition: 0.6s; }
.pc:hover img.pc-img { transform: scale(1.05); filter: brightness(0.55) saturate(0.9); }
.pc-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.2) 60%, transparent); pointer-events: none; }
.pc-foot { position: absolute; bottom: 0; left: 0; right: 0; padding: 2.5rem 3rem; display: flex; justify-content: space-between; align-items: flex-end; }
.pc-num { font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.35em; color: var(--textm); margin-bottom: 0.5rem; }
.pc-name { font-family: var(--ft); font-size: clamp(2rem,3.5vw,3.2rem); line-height: 1; }
.pc-tech { display: flex; gap: 0.5rem; font-size: 1.2rem; }
.pc-tech i { color: var(--teal); transition: transform 0.2s; }
.pc-tech i:hover { transform: scale(1.2); color: var(--primary); }
.pc-cta {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.85); opacity: 0;
  transition: 0.3s; font-family: var(--fl); font-size: 0.9rem; letter-spacing: 0.3em;
  padding: 1rem 2.8rem; border: 1px solid rgba(255,255,255,0.6); color: #fff;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(5px); white-space: nowrap;
}
.pc:hover .pc-cta { opacity: 1; transform: translate(-50%,-50%) scale(1); }

/* P2 · Manifiesto */
#p2 { display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 80% 60% at 50% 50%, #0a1a4a 0%, #0a0a0a 70%); }
#p2::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.5); pointer-events: none; }
.vis { position: relative; z-index: 1; text-align: center; max-width: 850px; padding: 3rem; }
.vis-icon { font-size: 3rem; opacity: 0.5; display: block; margin-bottom: 2rem; }
.vis-txt { font-family: var(--ft); font-size: clamp(1.5rem,3vw,2.5rem); letter-spacing: 0.2em; line-height: 1.4; margin-bottom: 3rem; }
.btn-exp { display: inline-block; padding: 1.1rem 3.5rem; background: #fff; color: #000; font-family: var(--fl); font-size: 0.9rem; letter-spacing: 0.35em; cursor: pointer; border: 1px solid transparent; transition: 0.22s; }
.btn-exp:hover { background: transparent; color: #fff; border-color: #fff; }
.vc-l, .vc-r { position: absolute; bottom: 2.5rem; font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.4em; color: var(--textm); z-index: 1; }
.vc-l { left: 3rem; } .vc-r { right: 3rem; }

/* P3 · Editorial */
#p3 { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.ed-l { border-right: 1px solid var(--border); padding: 4rem 4.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1.8rem; }
.ed-label { font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.45em; color: var(--textm); }
.ed-title { font-family: var(--ft); font-size: clamp(3rem,5vw,4.5rem); line-height: 0.9; }
.ed-body { font-family: var(--fb); font-size: 1rem; line-height: 1.8; color: var(--text2); }
.ed-quote { font-family: var(--fl); font-style: italic; font-size: 1.2rem; color: var(--teal); border-left: 3px solid var(--primary); padding-left: 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.chip { padding: 0.5rem 1.2rem; border: 1px solid var(--borderl); font-family: var(--fl); font-size: 0.75rem; letter-spacing: 0.18em; color: var(--textm); transition: 0.2s; display: flex; align-items: center; gap: 0.5rem; }
.chip i { font-size: 1.2rem; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.ed-r { padding: 4rem 3.5rem; display: flex; flex-direction: column; gap: 2rem; overflow-y: auto; }
.ed-img-frame { height: 240px; background: var(--card); border: 1px solid var(--border); overflow: hidden; }
.ed-img-frame img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5) saturate(0.6); }
.ed-code-frame { flex: 1; background: var(--card); border: 1px solid var(--border); padding: 2.5rem; }
.ed-code-frame::before { content: '// STACK TÉCNICO 2026'; display: block; font-family: var(--fl); font-size: 0.65rem; letter-spacing: 0.35em; color: var(--textm); margin-bottom: 1.8rem; }
code.sc { font-family: monospace; font-size: 0.95rem; color: var(--teal); line-height: 2; display: block; white-space: pre; }
code .kw { color: var(--primary); } code .s { color: #f0a060; }

/* P4 · Grid */
#p4 { display: flex; flex-direction: column; background: var(--bg); }
.grid-head { height: 90px; display: flex; align-items: center; padding: 0 3.5rem; border-bottom: 1px solid var(--border); }
.grid-body { flex: 1; overflow-y: auto; padding: 2.5rem 3.5rem; }
.proj-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.5rem; }
.gc { border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: 0.2s; }
.gc:nth-child(3n+2) { margin-top: 24px; }
.gc:hover { border-color: var(--borderl); }
.gi { width: 100%; height: 160px; overflow: hidden; position: relative; background: var(--panel); }
.gi img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.45) saturate(0.6); transition: 0.5s; }
.gc:hover .gi img { transform: scale(1.08); filter: brightness(0.65) saturate(0.8); }
.gi-cta { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(0,0,0,0.6); transition: 0.25s; font-family: var(--fl); font-size: 0.75rem; letter-spacing: 0.35em; color: #fff; }
.gc:hover .gi-cta { opacity: 1; }
.ginfo { padding: 1rem 1.2rem; display: flex; justify-content: space-between; align-items: center; }
.gname { font-family: var(--fb); font-size: 0.95rem; }
.gicon { display: flex; gap: 0.3rem; color: var(--primary); font-size: 1rem; }

/* P5 · Órbita (fondo negro puro) */
#p5 { display: grid; grid-template-rows: 1fr 1fr; background: #000; position: relative; }
.orbit-half { display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #222; position: relative; z-index: 1; }
.osys { position: relative; width: 240px; height: 240px; }
.sun { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle,#fff8c0,#ffc200 50%,#ff7000); box-shadow: 0 0 30px 10px rgba(255,190,0,0.3); }
.eo { position: absolute; top: 50%; left: 50%; width: 140px; height: 140px; margin: -70px 0 0 -70px; border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; animation: orb 10s linear infinite; }
.earth { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%,#5ba3ff,#1040cc 60%,#081844); }
.mo { position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border: 1px solid rgba(255,255,255,0.05); border-radius: 50%; animation: orb 26s linear infinite; }
.moon { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%,#ccc,#888); }
@keyframes orb { to { transform: rotate(360deg); } }
.orb-lbl { position: absolute; bottom: 1rem; font-family: var(--fl); font-size: 0.65rem; letter-spacing: 0.4em; color: var(--textm); }
.contact-half { display: flex; align-items: center; padding: 0 5rem; gap: 4rem; z-index: 1; flex-wrap: wrap; }
.c-big { font-family: var(--ft); font-size: clamp(2.2rem,4.5vw,4.5rem); white-space: nowrap; color: var(--text); }
.c-links { display: flex; flex-direction: column; gap: 0.8rem; flex: 1; min-width: 280px; }
.cl a { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.8rem; border: 1px solid var(--border); background: rgba(20,20,20,0.8); color: var(--text2); text-decoration: none; font-family: var(--fl); font-size: 0.9rem; letter-spacing: 0.12em; transition: 0.25s; }
.cl a:hover { border-color: var(--primary); color: var(--text); transform: translateX(6px); box-shadow: 0 4px 20px rgba(11,78,255,0.15); }
.social-icon { width: 24px; height: 24px; object-fit: contain; }
.cla { margin-left: auto; opacity: 0.4; } .cl a:hover .cla { opacity: 1; }
.p-foot { position: absolute; bottom: 1.2rem; right: 2.5rem; font-family: var(--fl); font-size: 0.65rem; letter-spacing: 0.3em; color: var(--textm); z-index: 2; }

/* MODAL */
.mbg { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.92); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.mbg.on { opacity: 1; pointer-events: all; }
.mbox { background: var(--card); border: 1px solid var(--borderl); width: min(860px,94vw); max-height: 88vh; overflow-y: auto; transform: translateY(20px); transition: 0.3s; }
.mbg.on .mbox { transform: translateY(0); }
.mh { padding: 2rem 2.5rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.mt { font-family: var(--ft); font-size: 2rem; }
.mc { background: none; border: 1px solid var(--borderl); color: var(--textm); padding: 0.5rem 1.2rem; font-family: var(--fl); font-size: 0.75rem; letter-spacing: 0.25em; cursor: pointer; transition: 0.2s; }
.mc:hover { border-color: var(--text); color: var(--text); }
.mi { width: 100%; height: 280px; overflow: hidden; position: relative; background: var(--panel); }
.mi img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55) saturate(0.7); }
.mb { padding: 2rem 2.5rem 2.5rem; }
.md { font-family: var(--fb); font-size: 1rem; color: var(--text2); line-height: 1.8; margin-bottom: 1.8rem; }
.mtl { font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.35em; color: var(--textm); margin-bottom: 0.8rem; }
.mbadges { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.mbadge { padding: 0.4rem 1rem; border: 1px solid var(--borderl); font-family: var(--fl); font-size: 0.7rem; letter-spacing: 0.15em; color: var(--teal); }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  #p0 { flex-direction: column; }
  .proj-grid { grid-template-columns: repeat(2,1fr); }
  .contact-half { padding: 2rem 2.5rem; gap: 2rem; }
  .c-big { font-size: 1.8rem; }
  #p3 { grid-template-columns: 1fr; }
  .ed-r { display: none; }
}
@media (max-width: 480px) {
  .nav-links { display: none; }
  .proj-grid { grid-template-columns: 1fr; }
}