/* ===== Tokens ===== */
:root {
  --ink: #12151a;
  --surface: #1a1f26;
  --line: #2a313b;
  --text: #e6e2da;
  --muted: #a1a9b3;
  --accent: #ff8a3d;
  --accent-strong: #ffa05c;
  --ok: #7fd1a0;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 68ch;
  --gutter: 24px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: var(--gutter); top: -48px;
  background: var(--accent); color: var(--ink);
  padding: 8px 14px; border-radius: 4px; z-index: 20;
}
.skip:focus { top: 12px; }

/* ===== Header ===== */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 21, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.cursor-mark { color: var(--accent); }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 6px 0; }
.top nav a:hover { color: var(--text); }

/* ===== Hero ===== */
.hero { padding: 72px 0 56px; }

.terminal {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.terminal .prompt { color: var(--ok); }
.terminal .t-out { color: var(--text); }
.terminal h1 {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 4px 0 14px;
}
.terminal .role { color: var(--muted); margin-bottom: 14px; }

.cursor {
  display: inline-block; width: 0.6em; height: 1.1em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lead { max-width: var(--measure); margin-top: 36px; color: var(--text); font-size: 1.15rem; line-height: 1.7; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.actions[hidden], [hidden] { display: none !important; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--ink); }

/* ===== Sections ===== */
.block { padding: 64px 0 8px; }
.block:last-of-type { padding-bottom: 72px; }

h2 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.path { color: var(--accent); }

h3 { font-size: 1.15rem; line-height: 1.35; font-weight: 650; }

.note { color: var(--muted); font-size: 0.97rem; margin-top: 16px; max-width: var(--measure); }

/* ===== Projects ===== */
.project {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.project:first-of-type { margin-top: 20px; }

.status { font-size: 0.92rem; margin-top: 6px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-public { color: var(--ok); }
.status-public::before { background: var(--ok); }

.project-body { max-width: var(--measure); }
.project-body > p + ul { margin-top: 14px; }
.project-body ul { display: grid; gap: 8px; color: var(--text); }
.project-body li, .job li { position: relative; padding-left: 20px; }
.project-body li::before, .job li::before {
  content: ""; position: absolute; left: 2px; top: 0.78em;
  width: 8px; height: 1px; background: var(--accent);
}
.tags { margin-top: 16px; font-family: var(--font-mono); font-size: 0.88rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-weight: 600; }
.project .note { margin-top: 14px; }

.shot { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 10px 14px; color: var(--muted); font-size: 0.9rem; }

@media (min-width: 760px) {
  .project { grid-template-columns: 220px 1fr; gap: 32px; }
}

/* ===== Experience ===== */
.job {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.job:first-of-type { margin-top: 20px; }
.job ul { display: grid; gap: 8px; max-width: var(--measure); }
.job-org { color: var(--text); margin-top: 4px; }
.job-date { color: var(--muted); font-size: 0.95rem; }

@media (min-width: 760px) {
  .job { grid-template-columns: 220px 1fr; gap: 32px; }
}

.education { padding-top: 32px; border-top: 1px solid var(--line); }
.education h3 { margin-bottom: 16px; }
.education dl { display: grid; gap: 16px; }
.education dt { font-weight: 600; }
.education dd { color: var(--muted); font-size: 0.97rem; }

/* ===== Stack ===== */
.stack { margin-top: 20px; border-top: 1px solid var(--line); }
.stack > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.stack dt { font-weight: 600; }
.stack dd { color: var(--muted); }

@media (min-width: 760px) {
  .stack > div { grid-template-columns: 220px 1fr; gap: 32px; }
  .stack dd { color: var(--text); }
}

/* ===== Contact ===== */
.contact { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px; font-weight: 600; font-size: 1.05rem; }
#contacto .lead { margin-top: 16px; }

/* ===== Footer ===== */
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn { transition: none; }
}

/* ===== Small screens ===== */
@media (max-width: 520px) {
  :root { --gutter: 18px; }
  .hero { padding-top: 48px; }
  .terminal { padding: 18px; font-size: 0.88rem; }
  .top nav { gap: 2px 14px; }
}
