/* ═══ Portal de Rodo — Rodo Trust Authority (GitLab-inspired palette/type) ═══ */

:root {
  --bg: #0B0A0D; --surface: #18171D; --surface-2: #211F27; --border: rgba(255,255,255,.1);
  --text: #FBFAFD; --text-dim: #9C9AA6; --text-faint: #68656F;
  --blue: #1F75CB; --blue-hover: #3B8FDA; --green: #108548; --red: #DD2B0E; --purple: #7B58CF;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, 'DejaVu Sans Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); font-weight: 400;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: 14px; cursor: pointer; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
a { color: inherit; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 4px;
}
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Nav ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 40px; max-width: 1180px; margin: 0 auto;
}
.nav-brand { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--text-dim); text-decoration: none; flex: none; }
.seal { width: 30px; height: 30px; flex: none; }
.nav-search { flex: 1; min-width: 0; max-width: 320px; position: relative; }
.nav-search input {
  width: 100%; height: 34px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px;
  padding: 0 12px 0 32px;
}
.nav-search input::placeholder { color: var(--text-faint); }
.nav-search input:focus { outline: none; border-color: var(--blue); }
.nav-search svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.nav-links { display: flex; gap: 20px; font-size: 13.5px; flex: none; }
.nav-links a { text-decoration: none; color: var(--text-dim); transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--blue); color: #fff; border: none; padding: 8px 16px;
  border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; flex: none;
}
.nav-cta:hover { background: var(--blue-hover); }
.burger { display: none; background: none; border: none; color: var(--text); font-size: 20px; padding: 4px; }
.sidenav {
  position: fixed; top: 0; right: 0; bottom: 0; width: 260px; z-index: 60;
  background: var(--surface); border-left: 1px solid var(--border); padding: 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.sidenav a { color: var(--text); text-decoration: none; padding: 10px 4px; font-size: 14px; border-bottom: 1px solid var(--border); }

/* ── Hero ────────────────────────────────────────── */
.hero {
  max-width: 1180px; margin: 0 auto; padding: 56px 40px 76px; position: relative;
  display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: 48px; align-items: center;
}
.hero-seal {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 26px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.seal-svg { width: 100%; height: 100%; overflow: visible; }
.seal-svg text { font-family: var(--mono); letter-spacing: .04em; }
.seal-text-top { font-size: 6.6px; fill: var(--text); }
.seal-text-bottom { font-size: 5.6px; fill: var(--text-faint); }
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--text-faint); margin: 0 0 14px; }
h1 { font-size: clamp(32px,5.2vw,52px); line-height: 1.1; margin: 0 0 18px; max-width: 15ch; text-wrap: balance; }
h1 .accent { color: var(--blue); }
.hero-sub { font-size: 16px; color: var(--text-dim); max-width: 56ch; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 10px 18px; border-radius: 6px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; font-family: var(--sans);
}
.btn-primary, .btn { background: var(--blue); color: #fff; }
.btn:hover, .btn-primary:hover { background: var(--blue-hover); }
.btn.ghost, .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover, .btn-ghost:hover { border-color: var(--text-dim); background: transparent; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #F04A2C; }
.btn:disabled { background: var(--surface-2); color: var(--text-faint); cursor: default; }

.hero-photo { position: relative; justify-self: center; }
.photo-frame {
  width: 260px; height: 320px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--bg));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
  color: var(--text-faint);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-seal {
  position: absolute; right: -16px; bottom: -16px; width: 78px; height: 78px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.4), 0 0 0 4px var(--bg);
}
.photo-seal .seal-text-top { font-size: 7px; }

/* ── Sections / About ────────────────────────────── */
section { max-width: 1180px; margin: 0 auto; padding: 8px 40px 64px; }
.section-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--text-faint);
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.about { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 36px; align-items: start; }
.about-code { background: #0A090C; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.about-code-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #141318; border-bottom: 1px solid var(--border); }
.about-code-bar span { width: 9px; height: 9px; border-radius: 50%; background: #3A3840; }
.about-code-bar span:nth-child(1) { background: var(--red); }
.about-code-bar span:nth-child(2) { background: #D9A122; }
.about-code-bar span:nth-child(3) { background: var(--green); }
.about-code-name { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.hcl { margin: 0; padding: 20px 22px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #C6C4CC; overflow-x: auto; }
.hcl-com { color: #6E9E7E; } .hcl-kw { color: #5B9DD9; }
.hcl-type { color: #9B8AE0; } .hcl-str { color: #D6A94E; } .hcl-num { color: #8FBF8A; }
.about-copy p { font-size: 15px; color: var(--text-dim); max-width: 56ch; margin: 0 0 16px; }
.about-copy strong { color: var(--text); font-weight: 600; }
.highlights { list-style: none; margin: 22px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.highlights li { font-size: 13.5px; padding-left: 20px; position: relative; color: var(--text-dim); }
.highlights li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.highlights li b { color: var(--text); }
.about-cta { font-size: 13px; color: var(--text-dim); }
.about-cta a { color: var(--blue); text-decoration: none; font-weight: 600; }
.about-cta a:hover { text-decoration: underline; }

/* ── Arcade grid ─────────────────────────────────── */
.arcade-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.arcade-head h2 { font-size: 26px; margin: 0; }
.arcade-head p { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; position: relative; overflow: hidden; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.card:hover, .card:focus-visible { border-color: var(--blue); background: var(--surface-2); }
.card:hover .icon-box, .card:focus-visible .icon-box { border-color: var(--blue); color: var(--blue); }
.icon-box {
  width: 38px; height: 38px; border-radius: 8px; flex: none;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  transition: border-color .15s, color .15s;
}
.icon-box svg { width: 19px; height: 19px; }
.card .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--purple); margin-bottom: 8px; display: block; }
.card h3 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.card p { font-size: 12.5px; color: var(--text-dim); margin: 0; }
.card .done-badge { color: var(--green); font-size: 11px; font-weight: 600; margin-left: 4px; }
.grid .empty { color: var(--text-dim); grid-column: 1 / -1; }

/* ── Blade ───────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(4,4,6,.72); z-index: 90;
  animation: fade-in .2s;
}
.blade {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 100; box-shadow: -20px 0 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  animation: slide-in .25s ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(102%); } }
.blade-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.blade-seal {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.blade-seal svg { width: 18px; height: 18px; }
.blade-head h2 { font-size: 18px; margin: 0; flex: 1; font-weight: 600; }
.blade-head .x { background: none; border: 1px solid var(--border); color: var(--text-dim); width: 30px; height: 30px; border-radius: 50%; font-size: 14px; }
.blade-head .x:hover { color: var(--text); border-color: var(--text-dim); }
.blade-body { padding: 24px; overflow-y: auto; flex: 1; font-size: 14.5px; color: var(--text-dim); }
.blade-body > p:first-child { margin-top: 0; }
.blade.shake { animation: shake .5s linear 6; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ── MessageBar ──────────────────────────────────── */
.msgbar { display: flex; border-radius: 6px; margin: 12px 0; font-size: 13px; overflow: hidden; border: 1px solid var(--border); }
.msgbar .stripe { width: 4px; flex: none; }
.msgbar .txt { padding: 10px 12px; flex: 1; color: var(--text); }
.msgbar.ok   { background: rgba(16,133,72,.12); } .msgbar.ok .stripe   { background: var(--green); }
.msgbar.err  { background: rgba(221,43,14,.12); } .msgbar.err .stripe  { background: var(--red); }
.msgbar.info { background: rgba(31,117,203,.12); } .msgbar.info .stripe { background: var(--blue); }
.msgbar.warn { background: rgba(217,161,34,.12); } .msgbar.warn .stripe { background: #D9A122; }

/* ── Controles compartidos de juegos ─────────────── */
.field {
  border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px;
  font-size: 13.5px; font-family: inherit; width: 100%; background: var(--bg); color: var(--text);
}
.field::placeholder { color: var(--text-faint); }
.field:focus { outline: none; border-color: var(--blue); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.stack { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.note {
  font-size: 12px; color: var(--text-faint);
  border: 1px dashed var(--border); border-radius: 6px;
  padding: 8px 10px; margin-top: 14px;
}

/* Terminal */
.term {
  background: #0A090C; color: #DDD; border-radius: 6px; padding: 12px 14px;
  font-family: var(--mono); font-size: 12.5px; min-height: 160px; margin-top: 10px;
  white-space: pre-wrap; overflow-x: auto; overflow-y: auto; max-height: 340px;
  border: 1px solid var(--border);
}
.term .prompt { color: var(--purple); }
.term input {
  background: transparent; border: none; color: #fff;
  font-family: var(--mono); font-size: 12.5px; width: 58%; outline: none;
}

/* Certificado x509 */
.cert { border: 1px solid var(--border); border-radius: 6px; margin-top: 12px; font-family: var(--mono); font-size: 12px; background: var(--bg); overflow-x: auto; }
.cert .cert-head { background: var(--green); color: #fff; padding: 6px 12px; font-weight: 600; font-family: var(--sans); font-size: 12.5px; }
.cert table { border-collapse: collapse; width: 100%; }
.cert td { padding: 5px 12px; border-top: 1px solid var(--border); vertical-align: top; color: var(--text-dim); }
.cert td:first-child { color: var(--text-faint); width: 110px; white-space: nowrap; }
.cert .fp { word-break: break-all; }

/* API playground */
.api-out { background: #0A090C; color: #D4D4D4; font-family: var(--mono); font-size: 12px; border-radius: 6px; padding: 12px; white-space: pre-wrap; margin-top: 8px; overflow-x: auto; border: 1px solid var(--border); }
.api-out .s2xx { color: #6A9955; } .api-out .s418 { color: #DCDCAA; } .api-out .s4xx { color: #F48771; }
.curl { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; overflow-x: auto; }
.curl span { flex: 1; white-space: nowrap; }

/* Barras de progreso/carga */
.meter { background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; position: relative; }
.meter .fill { background: var(--blue); height: 100%; transition: width .2s; }
.meter .fill.hot { background: var(--red); }
.meter .fill.warm { background: #D9A122; }
.meter .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; font-family: var(--mono); color: #fff; }

/* Option cards */
.opt { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; text-align: left; font-size: 13px; width: 100%; color: var(--text); }
.opt:hover { border-color: var(--text-dim); }
.opt.good { background: rgba(16,133,72,.15); border-color: var(--green); }
.opt.bad { background: rgba(221,43,14,.15); border-color: var(--red); }
.opt:disabled { cursor: default; opacity: .75; }

/* Config de servidor (sec-vulns) */
.conf { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 0; margin-top: 10px; overflow-x: auto; }
.conf button { display: block; width: 100%; text-align: left; background: none; border: none; font-family: var(--mono); font-size: 12px; padding: 3px 14px; white-space: pre; color: var(--text-dim); }
.conf button:hover { background: var(--surface-2); }
.conf button.found { background: rgba(221,43,14,.15); color: #F27C63; font-weight: 700; }
.conf button:disabled { cursor: default; }

/* ── Marca de agua ───────────────────────────────── */
.watermark {
  position: fixed; right: 16px; bottom: 14px; z-index: 80; text-align: right;
  color: var(--text-faint); font-size: 14px; pointer-events: none; line-height: 1.3;
  background: rgba(24,23,29,.85); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px;
  backdrop-filter: blur(6px);
}
.watermark small { font-size: 11px; display: block; font-family: var(--mono); }

/* ── Footer ──────────────────────────────────────── */
footer {
  max-width: 1180px; margin: 0 auto; padding: 36px 40px 80px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; color: var(--text-faint); font-size: 13px;
}
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--text); }
footer .foot-links { display: flex; gap: 16px; flex-wrap: wrap; }

.noscript {
  padding: 14px 20px; background: #D9A122; color: #1a1a1a; border-top: 2px solid var(--red);
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  .about { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { justify-self: start; order: -1; margin-bottom: 8px; }
  .photo-frame { width: 170px; height: 210px; }
  .photo-seal { width: 58px; height: 58px; right: -10px; bottom: -10px; }
  .photo-seal .seal-text-top { font-size: 8.5px; }
  .hero-seal { width: 76px; height: 76px; }
}
@media (max-width: 720px) {
  .nav-links, .nav-search { display: none; }
  .burger { display: block; }
}
@media (max-width: 640px) {
  .topbar, .hero, section, footer { padding-left: 20px; padding-right: 20px; }
  h1 { font-size: 30px; }
  .grid { grid-template-columns: 1fr; }
  .term input { width: 90%; }
}

/* ── Movimiento reducido ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .blade, .overlay { animation: none; }
  .blade.shake { animation: none; }
  .meter .fill { transition: none; }
  .card { transition: none; }
}
