/* Juliohome — hoja de estilos. Tema oscuro unico, acento ambar. Fuentes self-hosted (OFL). */

@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --surface: #121418;
  --surface-2: #171a1f;
  --term: #0d0f12;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #eceef0;
  --muted: #a0a6ad;
  --faint: #80878f;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --accent-soft: rgba(245, 165, 36, 0.12);
  --crit: #d03b3b;
  --dot: #6b737c;
  --bar-base: #5f6670;
  --font-display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1160px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(245, 165, 36, 0.10), transparent 62%),
    radial-gradient(900px 620px at -12% 18%, rgba(108, 182, 255, 0.05), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
::selection { background: rgba(245, 165, 36, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Idioma: solo se ve el bloque del idioma activo */
html[data-lang="en"] .t[lang="es"],
html[data-lang="es"] .t[lang="en"] { display: none !important; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 11, 13, 0.62);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(10, 11, 13, 0.78); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.brand-tag { font-family: var(--font-mono); font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; letter-spacing: 0.04em; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14.5px; transition: color 0.2s ease; }
.nav a:hover { color: var(--ink); }
.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; }
.lang button {
  font: 600 12px/1 var(--font-mono); letter-spacing: 0.06em; color: var(--faint);
  background: transparent; border: 0; border-radius: 999px; padding: 6px 10px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font: 600 15px/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.28); }
.btn.done { border-color: var(--accent); }

/* ---------- Portada ---------- */
.hero { position: relative; isolation: isolate; padding-top: 76px; padding-bottom: 92px; }
.hero::before {
  content: ""; position: absolute; inset: -68px 0 0 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 72% 34%, #000 22%, transparent 76%);
  mask-image: radial-gradient(ellipse 62% 58% at 72% 34%, #000 22%, transparent 76%);
}
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font: 500 12.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(245, 165, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 165, 36, 0); } }
h1 {
  margin: 22px 0 22px;
  font: 400 clamp(46px, 7.2vw, 94px)/0.98 var(--font-display);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 em { font-style: italic; color: var(--accent); }
.lead { margin: 0; max-width: 54ch; font-size: clamp(17px, 1.6vw, 19.5px); line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* Panel tipo terminal con cifras medidas */
.ledger {
  background: linear-gradient(180deg, #11141a, var(--term));
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.ledger-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ledger-top i { width: 10px; height: 10px; border-radius: 50%; background: #2a2f37; display: block; }
.ledger-top span { margin-left: 8px; font: 500 12px/1 var(--font-mono); color: var(--faint); }
.ledger-body { padding: 18px 18px 20px; font: 400 13px/1.9 var(--font-mono); }
.ledger .line { display: flex; align-items: baseline; gap: 10px; opacity: 0; animation: line-in 0.5s var(--ease) forwards; }
.ledger .cmd { color: var(--ink); }
.ledger .cmd b { color: var(--accent); font-weight: 600; }
.ledger .k { color: var(--muted); white-space: nowrap; }
.ledger .lead-dots { flex: 1 1 16px; min-width: 16px; border-bottom: 1px dotted rgba(255, 255, 255, 0.18); transform: translateY(-5px); }
.ledger .v { color: var(--ink); white-space: nowrap; }
.ledger .v b { color: var(--accent); font-weight: 600; }
.ledger .note { color: var(--faint); }
.ledger .cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); transform: translateY(2px); animation: blink 1.1s steps(1) infinite; }
.ledger .line:nth-child(1) { animation-delay: 0.15s; }
.ledger .line:nth-child(2) { animation-delay: 0.45s; }
.ledger .line:nth-child(3) { animation-delay: 0.6s; }
.ledger .line:nth-child(4) { animation-delay: 0.75s; }
.ledger .line:nth-child(5) { animation-delay: 0.9s; }
.ledger .line:nth-child(6) { animation-delay: 1.05s; }
.ledger .line:nth-child(7) { animation-delay: 1.2s; }
.ledger .line:nth-child(8) { animation-delay: 1.45s; }
.ledger .line:nth-child(9) { animation-delay: 1.6s; }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Franja en movimiento ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: rgba(255, 255, 255, 0.012); }
.marquee-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.marquee li { display: inline-flex; align-items: center; font: 500 14px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.marquee li::after { content: ""; width: 5px; height: 5px; margin: 0 26px; border-radius: 1px; background: var(--accent); transform: rotate(45deg); opacity: 0.8; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { padding-top: 104px; padding-bottom: 104px; }
.section + .section { border-top: 1px solid var(--line); }
.kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 500 12.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
h2 { margin: 0; font: 400 clamp(36px, 4.6vw, 58px)/1.02 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; max-width: 18ch; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 48px; }
.section-head p { margin: 0; max-width: 42ch; color: var(--muted); text-wrap: pretty; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: border-color 0.3s ease, transform 0.3s var(--ease);
}
.card:hover { border-color: var(--line-2); }

/* Dos formas de trabajar */
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.way { padding: 34px 32px 32px; }
.way-num { font: 500 13px/1 var(--font-mono); color: var(--faint); letter-spacing: 0.08em; }
.way h3 { margin: 18px 0 12px; font: 400 36px/1.05 var(--font-display); letter-spacing: -0.005em; }
.way p { margin: 0 0 22px; color: var(--muted); text-wrap: pretty; }
.checks { list-style: none; margin: 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.checks svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--accent); }

/* Casos */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.case { padding: 30px 30px 26px; display: flex; flex-direction: column; }
.tag { font: 500 11.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.case h3 { margin: 14px 0 12px; font: 400 32px/1.08 var(--font-display); letter-spacing: -0.005em; text-wrap: balance; }
.case > p { margin: 0 0 24px; color: var(--muted); text-wrap: pretty; }
.figure { margin: auto 0 0; padding: 20px 20px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.22); }
.figure figcaption { margin-top: 12px; font-size: 13px; color: var(--faint); text-wrap: pretty; }
.figure > .stat-v { font-size: 38px; }
.chart-gap { height: 18px; }
.figure .limits { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }

/* Graficos en HTML (se adaptan al ancho; los anchos de barra vienen en clases generadas por build.py) */
.c-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.c-label { font-size: 13px; color: var(--muted); }
.c-val { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* Unidades: un punto por respuesta; la alucinacion es una X roja (forma + color) */
.u-group + .u-group { margin-top: 16px; }
.u-grid { display: grid; grid-template-columns: repeat(23, minmax(0, 1fr)); gap: 5px; margin-top: 9px; max-width: 440px; }
.u { display: block; aspect-ratio: 1 / 1; border-radius: 50%; background: var(--dot); }
.u.bad { position: relative; background: transparent; }
.u.bad::before, .u.bad::after { content: ""; position: absolute; left: 50%; top: 50%; width: 125%; height: 2px; border-radius: 2px; background: var(--crit); }
.u.bad::before { transform: translate(-50%, -50%) rotate(45deg); }
.u.bad::after { transform: translate(-50%, -50%) rotate(-45deg); }
.c-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.c-legend span { display: inline-flex; align-items: center; gap: 8px; }
.c-legend .u { width: 9px; height: 9px; }

/* Barras horizontales: base cuadrada, extremo de dato redondeado, valor en la punta */
.bars { display: grid; gap: 12px; }
.b-row .c-label { margin-bottom: 6px; }
.b-plot { display: flex; align-items: center; margin-right: 92px; }
.b-bar { display: block; height: 14px; flex: none; border-radius: 0 4px 4px 0; }
.b-bar.base { background: var(--bar-base); }
.b-bar.accent { background: var(--accent); }
.b-bar.solid { border-radius: 0; }
.b-bar.range { margin-left: 2px; opacity: 0.42; }
.b-val { flex: none; margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }

html.js .b-bar { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s var(--ease) 0.2s; }
html.js .in .b-bar { transform: none; }
html.js .in .b-bar.range { transition-delay: 1.1s; }
html.js .u { opacity: 0; transform: scale(0.3); transition: opacity 0.35s ease, transform 0.35s var(--ease); }
html.js .in .u { opacity: 1; transform: none; }

/* Caso de controles: comando bloqueado + cifras */
.blocked { font: 400 12.5px/1.75 var(--font-mono); padding: 14px 16px; border-radius: 10px; background: var(--term); border: 1px solid var(--line); }
.blocked .no { color: var(--crit); font-weight: 600; }
.blocked .why { color: var(--ink); }
.blocked .fix { color: var(--muted); }
.blocked .fix b { color: var(--accent); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.stat-v { font: 600 30px/1.1 var(--font-sans); letter-spacing: -0.02em; }
.stat-l { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* Tambien construido */
.also { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.also-item { padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.also-item svg { width: 26px; height: 26px; color: var(--accent); }
.also-item h3 { margin: 4px 0 0; font: 600 16px/1.3 var(--font-sans); letter-spacing: -0.01em; }
.also-item p { margin: 0; font-size: 14.5px; color: var(--muted); text-wrap: pretty; }
.also-item .chip { margin-top: auto; align-self: flex-start; font: 500 12px/1 var(--font-mono); color: var(--ink); padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--accent-soft); }

/* Proceso */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 1px solid var(--line-2); }
.step { padding: 26px 24px 0 0; position: relative; }
.step::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.step-n { font: 500 12.5px/1 var(--font-mono); color: var(--faint); letter-spacing: 0.08em; }
.step h3 { margin: 12px 0 8px; font: 400 28px/1.1 var(--font-display); }
.step p { margin: 0; color: var(--muted); font-size: 15px; text-wrap: pretty; }
.callout { margin-top: 48px; display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); color: var(--muted); }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
.callout b { color: var(--ink); font-weight: 600; }

/* Sobre mi */
.about { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: start; }
.about blockquote { margin: 0; font: 400 clamp(30px, 3.4vw, 44px)/1.12 var(--font-display); text-wrap: balance; }
.about blockquote em { color: var(--accent); }
.about-text p { margin: 0 0 16px; color: var(--muted); font-size: 17px; text-wrap: pretty; }
.about-text p:first-child { color: var(--ink); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.stack li { font: 500 12px/1 var(--font-mono); color: var(--muted); padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 999px; }

/* Contacto */
.contact-panel {
  position: relative; overflow: hidden;
  padding: 64px 56px; border-radius: 26px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(640px 320px at 85% -10%, rgba(245, 165, 36, 0.20), transparent 62%),
    radial-gradient(520px 300px at 0% 110%, rgba(108, 182, 255, 0.07), transparent 60%),
    var(--surface);
}
.contact-panel h2 { max-width: 16ch; }
.contact-panel p { margin: 18px 0 0; max-width: 48ch; color: var(--muted); font-size: 18px; }
.contact-panel .cta { margin-top: 32px; }

/* Pie */
.foot { border-top: 1px solid var(--line); padding-top: 30px; padding-bottom: 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 14px; }
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--faint); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- Aparicion al hacer scroll ---------- */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s ease, transform 0.9s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .reveal.d1 { transition-delay: 0.08s; }
html.js .reveal.d2 { transition-delay: 0.16s; }
html.js .reveal.d3 { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .also { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; border-top: 0; }
  .step { border-top: 1px solid var(--line-2); }
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .section-head { flex-direction: column; align-items: start; gap: 18px; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .nav a { display: none; }
  .hero { padding-top: 44px; padding-bottom: 64px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .ways, .cases, .also, .steps { grid-template-columns: 1fr; }
  .way, .case { padding: 24px 20px 22px; }
  .case h3 { font-size: 28px; }
  .way h3 { font-size: 30px; }
  .contact-panel { padding: 40px 24px; border-radius: 20px; }
  .ledger-body { font-size: 12px; padding: 16px 14px 18px; }
  .ledger .line { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
  .figure { padding: 16px 14px 12px; }
  .u-grid { gap: 4px; }
  .b-plot { margin-right: 84px; }
}
@media (max-width: 380px) {
  .brand-tag { display: none; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ledger .line { opacity: 1; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .b-bar { transform: none; }
  html.js .u { opacity: 1; transform: none; }
}

/* Generado por build.py: anchos de barra (el CSP no permite estilos en linea) */
.bw1 { width: 100%; }
.bw2 { width: calc(20% - 1px); }
.bw3 { width: calc(5% - 1px); }
.bw4 { width: 52.5%; }
.bw5 { width: 91.333%; }
