/* ============================================================
   Portafolio Cristopher López — concepto "Consola DelRey"
   Paleta y tipografía heredadas de la identidad de Del Rey Digital.
   ============================================================ */

@font-face {
  font-family: 'Instrument Sans';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/instrument-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/instrument-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/instrument-sans-600.woff2') format('woff2');
}

:root {
  --bg: #0a0a0a;
  --bg-raised: #131316;
  --bg-raised-2: #1a1a1f;
  --border: #262626;
  --border-soft: #1a1a1c;
  --text: #f5f5f5;
  --text-dim: #a3a3ad;
  --text-faint: #63636b;
  --accent: #6366f1;
  --accent-bright: #818cf8;
  --ok: #34d399;
  --ok-wash: rgba(52, 211, 153, .12);
  --warn: #fbbf24;
  --font-display: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
p { margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .dot--pulse { animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------- shell / rail ---------------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 2rem;
}
.rail-brand { display: flex; align-items: center; gap: .6rem; padding: 0 .6rem; }
.rail-brand svg { width: 20px; height: 20px; flex: none; }
.rail-brand span { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; color: var(--text-dim); }

.rail-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .05rem; }
.rail-nav a {
  display: flex; align-items: baseline; gap: .7rem; padding: .45rem .6rem; border-radius: .6rem;
  font-size: .8438rem; text-decoration: none; color: var(--text-dim);
  transition: background .15s ease, color .15s ease;
}
.rail-nav .idx { font-family: var(--font-mono); font-size: .6875rem; color: var(--text-faint); }
.rail-nav a:hover { background: var(--bg-raised); color: var(--text); }
.rail-nav a.is-active { background: var(--bg-raised-2); color: var(--text); }
.rail-nav a.is-active .idx { color: var(--accent-bright); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; }

.topbar { display: none; }

/* ---------------- content ---------------- */
main { min-width: 0; }
.section { padding: 5.5rem 3.5rem; max-width: 840px; border-bottom: 1px solid var(--border-soft); }
.section:last-of-type { border-bottom: none; }
.section .eyebrow { margin-bottom: 1rem; }
h2 { font-size: 1.75rem; }
.section p.body { color: var(--text-dim); font-size: 1.0625rem; max-width: 62ch; margin-top: 1.25rem; }
.section p.body + p.body { margin-top: 1rem; }

/* ---------------- 01 identidad ---------------- */
.identity {
  background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 22px 22px;
  background-position: -6px -6px;
}
.identity-grid { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; }
.photo-frame {
  width: 148px; height: 148px; border-radius: 1.75rem; padding: 1px; flex: none;
  background: linear-gradient(160deg, var(--accent-bright), rgba(99, 102, 241, .25) 55%, var(--border) 100%);
}
.photo-frame img { width: 100%; height: 100%; border-radius: 1.7rem; object-fit: cover; background: var(--bg-raised); }
.identity h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-top: .6rem; }
.identity .role { font-family: var(--font-mono); font-size: .8125rem; color: var(--accent-bright); margin-top: .6rem; letter-spacing: .02em; }
.identity p.lede { max-width: 58ch; color: var(--text-dim); font-size: 1.0625rem; margin-top: 1.1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.chip {
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 100px; padding: .35rem .8rem;
}
.status-line { display: flex; align-items: center; gap: .6rem; margin-top: 1.75rem; font-family: var(--font-mono); font-size: .8125rem; color: var(--text-dim); }

/* ---------------- 02 enfoque ---------------- */
.principles { display: grid; gap: .75rem; margin-top: 1.75rem; }
.principle {
  display: flex; align-items: flex-start; gap: .85rem; padding: 1rem 1.2rem;
  border: 1px solid var(--border); border-radius: .9rem; background: var(--bg-raised);
}
.principle .n { font-family: var(--font-mono); font-size: .75rem; color: var(--accent-bright); flex: none; width: 1.4rem; margin-top: .15rem; }
.principle .t { font-size: .9375rem; font-weight: 600; color: var(--text); display: block; margin-bottom: .25rem; }
.principle p { font-size: .8125rem; color: var(--text-dim); margin: 0; line-height: 1.5; }

/* ---------------- módulos de proyecto ---------------- */
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.status-chip {
  display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .6875rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ok);
  background: var(--ok-wash); border: 1px solid rgba(52, 211, 153, .25); border-radius: 100px; padding: .3rem .7rem;
}
.module-title { display: flex; align-items: center; gap: .7rem; margin-top: 1.1rem; }
.module-title svg, .module-title img.logo-mark { width: 26px; height: 26px; flex: none; }
.module-title img.logo-mark { border-radius: .4rem; object-fit: contain; }

.metric-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.metric {
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-dim);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: .5rem; padding: .4rem .7rem;
}

.cta-row { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  font-size: .9375rem; font-weight: 500; border-radius: 100px; padding: .7rem 1.3rem;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  font-family: var(--font-display); cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-bright); }
.btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-faint); }

/* ---- tarjeta de acceso restringido ---- */
.access-card {
  margin-top: 1.75rem; display: flex; align-items: flex-start; gap: 1rem;
  border: 1px dashed var(--border); border-radius: 1rem; padding: 1.25rem 1.4rem; background: var(--bg-raised);
}
.access-card svg { flex: none; width: 20px; height: 20px; margin-top: .15rem; color: var(--text-faint); }
.access-card h3 { font-size: .9375rem; font-weight: 600; }
.access-card p { font-size: .875rem; color: var(--text-dim); margin-top: .35rem; max-width: 46ch; }
.access-card .cta-row { margin-top: .9rem; }
.access-card .btn { padding: .55rem 1.1rem; font-size: .875rem; }

/* ---- captura de pantalla (con marcador si falta) ---- */
.shot {
  margin-top: 1.75rem; border-radius: 1rem; overflow: hidden; border: 1px solid var(--border);
  aspect-ratio: 16 / 10; background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .shot-placeholder {
  display: none; flex-direction: column; align-items: center; gap: .5rem; padding: 1.5rem; text-align: center;
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint);
}
.shot .shot-placeholder svg { width: 22px; height: 22px; opacity: .6; }
.shot.shot--missing { border-style: dashed; }
.shot.shot--missing img { display: none; }
.shot.shot--missing .shot-placeholder { display: flex; }

/* ---------------- juego (game-frame) ---------------- */
.game-frame {
  margin-top: 1.75rem; border-radius: 1rem; overflow: hidden; border: 1px solid var(--border);
  aspect-ratio: 16 / 10; background: var(--bg-raised); position: relative;
}
.game-frame iframe { width: 100%; height: 100%; border: 0; display: none; }
.game-frame.is-live iframe { display: block; }
.game-frame.is-live .game-cover { display: none; }

.game-close {
  position: absolute; top: .75rem; right: .75rem; z-index: 15;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(148,163,184,.3);
  background: rgba(11,18,32,.78); color: #f1f5f9; font-size: 1rem; line-height: 1;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  font-family: var(--font-display);
}
.game-close:hover { background: rgba(239,68,68,.6); border-color: #ef4444; }
.game-frame.is-live .game-close { display: flex; }

.game-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; text-align: center; padding: 1.5rem;
}
.game-cover p { font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint); max-width: 30ch; }

/* ---------------- filosofia ---------------- */
.filosofia-content {
  display: flex; flex-direction: column; gap: 1.25rem;
  margin-top: 1.5rem; padding: 1.75rem;
  border: 1px solid var(--border); border-radius: 1rem;
  background: var(--bg-raised);
  border-left: 3px solid var(--accent-bright);
}
.filosofia-content p.body { margin-top: 0; }

/* ---------------- frameworks ---------------- */
.framework-grid { display: grid; gap: 1rem; margin-top: 1.75rem; }
@media (min-width: 640px) { .framework-grid { grid-template-columns: 1fr 1fr; } }
.framework-grid--solo { grid-template-columns: 1fr; margin-top: 1rem; }
.framework-card {
  border: 1px solid var(--border); border-radius: 1rem; padding: 1.4rem 1.5rem; background: var(--bg-raised);
  display: flex; flex-direction: column; gap: .75rem;
}
.framework-card .eyebrow { margin-bottom: 0; }
.framework-card .eyebrow .n { color: var(--accent-bright); margin-right: .15rem; }
.framework-card h3 { font-size: 1.0625rem; }
.framework-card p { font-size: .875rem; color: var(--text-dim); }
.framework-card--special { border-color: rgba(99, 102, 241, .35); background: linear-gradient(180deg, var(--bg-raised-2), var(--bg-raised)); }
.framework-note {
  margin-top: 1.5rem; font-size: .9375rem; color: var(--text-dim); max-width: 62ch;
  border-left: 2px solid var(--accent); padding-left: 1.1rem;
}

/* ---------------- contacto / footer ---------------- */
.contact-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center;
  margin-top: 1.75rem;
}
.contact-info { display: flex; flex-direction: column; gap: .85rem; }
.contact-email {
  font-family: var(--font-mono); font-size: .875rem; color: var(--text-dim);
  text-decoration: none; transition: color .15s; overflow-wrap: anywhere;
}
.contact-email:hover { color: var(--accent-bright); }
.contact-sites {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  font-family: var(--font-mono); font-size: .8125rem;
}
.contact-label { color: var(--text-faint); margin-right: .25rem; }
.contact-sites a {
  color: var(--text-dim); text-decoration: none;
  border: 1px solid var(--border); border-radius: .5rem; padding: .35rem .65rem;
  transition: border-color .15s, color .15s;
}
.contact-sites a:hover { border-color: var(--accent-bright); color: var(--accent-bright); }
.contact-foot { margin-top: 2rem; font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint); }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .shell { display: block; }
  .rail { display: none; }
  .topbar {
    display: flex; gap: .4rem; overflow-x: auto; position: sticky; top: 0; z-index: 5;
    background: rgba(10, 10, 10, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
    padding: .9rem 1rem;
  }
  .topbar a {
    font-family: var(--font-mono); font-size: .75rem; white-space: nowrap; text-decoration: none;
    color: var(--text-dim); border: 1px solid var(--border); border-radius: 100px; padding: .4rem .8rem; flex: none;
  }
  .topbar a.is-active { color: var(--text); border-color: var(--accent); }
  .section { padding: 3rem 1.35rem; }
  .identity-grid { grid-template-columns: 1fr; text-align: left; }
  .photo-frame { width: 104px; height: 104px; }
  .game-frame { aspect-ratio: 3 / 4; max-height: 560px; }
  .contact-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 1.25rem; }
  .contact-sites { justify-content: center; }
}
