:root {
  --bg: #04122A;
  --bg-2: #0B2A55;
  --panel: rgba(11, 42, 85, .55);
  --line: rgba(96, 165, 250, .22);
  --text: #E0F2FE;
  --muted: #9DB8D9;
  --accent: #3B82F6;
  --accent-2: #38BDF8;
  --card: #F8FBFF;
  --ink: #0A2540;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.65 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(56, 189, 248, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(59, 130, 246, .16), transparent 60%),
    linear-gradient(180deg, #04122A 0%, #061A3A 50%, #04122A 100%);
  background-color: var(--bg);
  min-height: 100vh;
}

/* technical grid and dust, like in the app */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    linear-gradient(rgba(96, 165, 250, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .06) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::after {
  background-image:
    radial-gradient(circle, rgba(147, 197, 253, .5) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(56, 189, 248, .35) 1px, transparent 1.6px);
  background-size: 120px 120px, 190px 190px;
  background-position: 0 0, 60px 90px;
  animation: drift 60s linear infinite;
}
@keyframes drift { to { background-position: 120px 240px, 250px 470px; } }
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent-2); }

/* top bar */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0;
}
.nav .brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .14em; }
.nav .brand img { width: 36px; height: 36px; border-radius: 8px; }
.nav .links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav .links a {
  color: var(--text); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 8px;
}
.nav .links a:hover, .nav .links a.active { background: rgba(59, 130, 246, .22); }
/* Portfolio leads back to the whole ATLAS series, so it stands out as a button */
.nav .links a.home {
  font-weight: 700; color: #fff; border: 1px solid rgba(56, 189, 248, .55);
  background: linear-gradient(90deg, var(--accent), #0EA5E9);
  box-shadow: 0 0 18px rgba(56, 189, 248, .35);
}
.nav .links a.home:hover { filter: brightness(1.12); background: linear-gradient(90deg, var(--accent), #0EA5E9); }
/* the page you are on: outlined tile with a glowing bar underneath */
.nav .links a { position: relative; border: 1px solid transparent; }
.nav .links a.active:not(.home) {
  color: #fff; font-weight: 700; border-color: rgba(56, 189, 248, .7);
  background: rgba(56, 189, 248, .16); box-shadow: 0 0 14px rgba(56, 189, 248, .3);
}
.nav .links a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -7px; height: 3px; border-radius: 2px;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2);
}

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.01em; }
.hero h1 .hl { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 0 24px; }
.hero .logo { width: 100%; max-width: 340px; justify-self: center; border-radius: 22px; box-shadow: 0 30px 80px rgba(2, 8, 23, .6), 0 0 0 1px var(--line); }
.kicker { font-family: Consolas, "Courier New", monospace; color: var(--accent-2); font-size: 13px; letter-spacing: .08em; margin-bottom: 10px; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: #fff; margin: 0 8px 8px 0; border: 1px solid transparent;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn:hover { filter: brightness(1.12); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.tags li {
  font-family: Consolas, "Courier New", monospace; font-size: 12.5px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: rgba(59, 130, 246, .12);
}

/* sections */
section { padding: 36px 0; }
h2 { font-size: 28px; margin: 0 0 8px; }
h3 { margin: 0 0 6px; font-size: 18px; }
.sub { color: var(--muted); margin: 0 0 24px; max-width: 760px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  backdrop-filter: blur(4px);
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .num { font-family: Consolas, monospace; color: var(--accent-2); font-size: 13px; }

/* project cards on the portfolio page */
.projects { display: grid; gap: 18px; grid-template-columns: 1.6fr 1fr; align-items: start; }
.project { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--text); transition: transform .2s, border-color .2s; }
a.project:hover { transform: translateY(-3px); border-color: rgba(96, 165, 250, .6); }
.project .screenshot { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.project .title-logo { display: flex; align-items: center; gap: 14px; }
.project .title-logo img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.project .title-logo h3 { margin: 0; }
.project .status { font-size: 12px; font-family: Consolas, monospace; color: #86EFAC; }
.project.soon { border-style: dashed; }
.project.soon h3 { margin: 0; }
.project.soon .status { color: var(--muted); }

/* screenshots and diagrams */
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(2, 8, 23, .55); }
.shot img { display: block; width: 100%; height: auto; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

.diagram { background: var(--card); border-radius: 16px; padding: 18px; }
.diagram img { display: block; width: 100%; height: auto; }

/* tables and code */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--accent-2); font-weight: 600; }
.table-wrap { overflow-x: auto; }
code { font-family: Consolas, "Courier New", monospace; font-size: .92em; background: rgba(59, 130, 246, .14); padding: 1px 6px; border-radius: 6px; }
pre {
  background: #031027; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  overflow-x: auto; font: 14px/1.6 Consolas, "Courier New", monospace; color: #CFE6FF; margin: 0;
}
pre code { background: none; padding: 0; }
pre .c { color: #60A5FA; }

/* two column text + figure */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
ul.check { list-style: none; padding: 0; margin: 0; }
ul.check li { padding-left: 22px; position: relative; margin-bottom: 8px; color: var(--muted); }
ul.check li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 9px; height: 9px; border-radius: 3px; background: var(--accent-2); }
ul.check strong { color: var(--text); }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 40px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero, .split, .shots, .projects { grid-template-columns: 1fr; }
  .hero { padding-top: 24px; }
  .hero .logo { max-width: 240px; }
  .nav { flex-direction: column; align-items: flex-start; }
  .nav .links a { padding: 6px 10px; }
}

/* ---------- roadmap page (mapa.html) ---------- */
.rm-console {
  display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center;
  margin: 28px 0 8px; padding: 28px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(160deg, rgba(13, 42, 90, .8), rgba(4, 18, 42, .8));
}
.rm-console > div { min-width: 0; }
.rm-title { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 12px; text-wrap: balance; }
.rm-title .hl { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rm-console .lead { color: var(--muted); margin: 0 0 16px; max-width: 640px; }
.rm-console .tags { margin-bottom: 14px; }
.rm-ring { position: relative; width: 160px; height: 160px; }
.rm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rm-ring .track { fill: none; stroke: #12305F; stroke-width: 12; }
.rm-ring .bar { fill: none; stroke: url(#rg); stroke-width: 12; stroke-linecap: round; }
.rm-pct { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rm-pct b { font-size: 40px; line-height: 1; }
.rm-pct span { font: 11px Consolas, monospace; color: var(--muted); letter-spacing: .1em; }
.rm-next { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 10px 16px; border-radius: 12px; border: 1px dashed rgba(56, 189, 248, .55); background: rgba(56, 189, 248, .07); }
.rm-next .kicker { margin: 0; }
.rm-next a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent-2); }

.rm-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 0; margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.rm-legend li { display: flex; align-items: center; gap: 8px; }
.rm-legend li::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--line); background: #031027; }
.rm-legend li.done::before { background: #4ADE80; border-color: #4ADE80; }
.rm-legend li.current::before { border-color: var(--accent-2); box-shadow: 0 0 10px rgba(56, 189, 248, .6); }

.rm-route { position: relative; display: grid; gap: 22px; }
.rm-route::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--accent) 0 14px, transparent 14px 24px); opacity: .5;
}
.rm-phase { position: relative; z-index: 1; justify-self: center; text-align: center; padding: 10px 20px; border-radius: 12px; background: #031027; border: 1px solid var(--line); max-width: 440px; }
.rm-phase h3 { font-size: 17px; margin: 0; }
.rm-phase p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.rm-finish { padding: 16px 24px; }

.rm-station { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: start; }
.rm-node {
  grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; width: 52px; height: 52px; margin-top: 14px; border-radius: 14px;
  display: grid; place-content: center; font-weight: 800; font-size: 17px; background: #031027; border: 2px solid var(--line); color: var(--muted);
}
.rm-card { grid-row: 1; min-width: 0; }
.rm-station.left .rm-card { grid-column: 1; }
.rm-station.right .rm-card { grid-column: 3; }
.rm-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rm-card h3 { font-size: 20px; margin: 0; }
.rm-card h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent-2); }
.rm-tag { font: 600 11px Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: rgba(59, 130, 246, .15); color: var(--muted); white-space: nowrap; }
.rm-card .rm-skill { margin: 4px 0 12px; }
.rm-card .tags { margin-bottom: 12px; }
.rm-card .rm-wow { font-size: 14px; margin: 0 0 12px; padding-left: 10px; border-left: 2px solid var(--accent-2); }
.rm-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rm-steps li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 9px; background: rgba(3, 16, 39, .6); color: var(--text); font-size: 14.5px; }
.rm-steps li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--accent); }
.rm-steps li.ok { color: var(--muted); }
.rm-steps li.ok::before { background: #4ADE80 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23031027' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: #4ADE80; }
.rm-meter { height: 6px; border-radius: 3px; background: #12305F; margin-top: 12px; overflow: hidden; }
.rm-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.rm-station.done .rm-node { background: #4ADE80; border-color: #4ADE80; color: #031027; }
.rm-station.done .rm-card { border-color: rgba(74, 222, 128, .45); }
.rm-station.done .rm-tag { background: rgba(74, 222, 128, .15); color: #4ADE80; }
.rm-station.done .rm-meter i { background: #4ADE80; }
.rm-station.current .rm-node { border-color: var(--accent-2); color: var(--accent-2); box-shadow: 0 0 0 6px rgba(56, 189, 248, .12), 0 0 26px rgba(56, 189, 248, .45); animation: rm-pulse 2.4s ease-in-out infinite; }
.rm-station.current .rm-card { border-color: var(--accent-2); box-shadow: 0 0 34px rgba(56, 189, 248, .14); }
.rm-station.current .rm-tag { background: rgba(56, 189, 248, .15); color: var(--accent-2); }
.rm-station:not(.done):not(.current) .rm-card { border-style: dashed; }
@keyframes rm-pulse { 50% { box-shadow: 0 0 0 10px rgba(56, 189, 248, .06), 0 0 34px rgba(56, 189, 248, .6); } }
@media (prefers-reduced-motion: reduce) { .rm-station.current .rm-node { animation: none; } }

@media (max-width: 820px) {
  .rm-console { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .rm-ring { width: 120px; height: 120px; }
  .rm-route::before { left: 26px; }
  .rm-phase { justify-self: stretch; text-align: left; margin-left: 52px; }
  .rm-station { grid-template-columns: 52px 1fr; column-gap: 14px; }
  .rm-node { grid-column: 1; }
  .rm-station.left .rm-card, .rm-station.right .rm-card { grid-column: 2; }
}
.map-link { align-self: flex-start; margin: 4px 0 0; }
