/* ==========================================================================
   Esteban Bueno — portfolio
   Design tokens
   ========================================================================== */
:root {
  --bg: #0b1120;
  --bg-panel: #121a2e;
  --bg-panel-2: #17213a;
  --border: rgba(231, 233, 242, 0.09);
  --border-strong: rgba(231, 233, 242, 0.18);
  --text: #e7e9f2;
  --text-dim: #98a1b8;
  --text-faint: #6c7590;
  --accent: #e8a33d;
  --accent-soft: rgba(232, 163, 61, 0.14);
  --accent-2: #4fd1c5;
  --accent-2-soft: rgba(79, 209, 197, 0.14);
  --warn: #e2734f;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display: "Space Grotesk", var(--sans);

  --container: 1180px;
  --header-h: 72px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
p { margin: 0; }
code { font-family: var(--mono); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #10151f;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Buttons & shared bits
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #191008; }
.btn-primary:hover { background: #f0ae4c; }
.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.icon-link {
  display: inline-flex;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.icon-link:hover { color: var(--accent); background: var(--accent-soft); }

.tag-list, .tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-list li, .tech-strip li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-2-soft);
  flex-shrink: 0;
}
.status-dot-progress { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
}
.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.main-nav ul { display: flex; gap: 28px; }
.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--accent); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.is-open { max-height: 320px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 24px 16px; }
  .main-nav li { border-top: 1px solid var(--border); }
  .main-nav a { display: block; padding: 14px 0; }
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 64px 0 88px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 65%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 65%, transparent 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-kicker {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 34ch;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin-bottom: 18px;
}
.hero-bio {
  color: var(--text-dim);
  max-width: 52ch;
  font-size: 1.05rem;
  margin-bottom: 30px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

/* Terminal */
.terminal-window {
  background: #0e1526;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #e2734f; }
.dot-yellow { background: #e8c33d; }
.dot-green { background: #4fd1c5; }
.terminal-bar p {
  margin: 0 0 0 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.terminal-body {
  margin: 0;
  padding: 20px 18px 24px;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.85;
  min-height: 260px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-body .line-cmd { color: var(--text); }
.terminal-body .line-cmd::before { content: "esteban@est1:~$ "; color: var(--accent); }
.terminal-body .line-out { color: var(--text-dim); display: block; padding-left: 0; }
.terminal-body .line-ok { color: var(--accent-2); }
.terminal-caret {
  display: inline-block;
  width: 8px; height: 1em;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: 88px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 18px; }
.section-lead { color: var(--text-dim); max-width: 60ch; margin-bottom: 36px; }

/* Profil */
.profil-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.profil-text p { color: var(--text-dim); margin-bottom: 16px; max-width: 62ch; }
.info-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  align-self: start;
}
.info-card dl div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.info-card dl div:last-child { border-bottom: none; padding-bottom: 0; }
.info-card dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.info-card dd { margin: 0; color: var(--text); font-size: 0.95rem; }

@media (max-width: 860px) {
  .profil-grid { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline-wrap { position: relative; }
.timeline-track {
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-fill {
  width: 100%;
  height: 0%;
  background: var(--accent);
  transform-origin: top;
}
.timeline { position: relative; padding-left: 36px; display: flex; flex-direction: column; gap: 40px; }
.timeline-item { position: relative; }
.timeline-marker {
  position: absolute;
  left: -36px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
}
.timeline-item.is-current .timeline-marker {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.timeline-content h3 { font-size: 1.15rem; margin-bottom: 8px; }
.timeline-content p { color: var(--text-dim); max-width: 62ch; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 24px;
}
.skill-card h3 { font-size: 1.05rem; margin-bottom: 14px; }
.skill-card ul { display: flex; flex-direction: column; gap: 10px; }
.skill-card li {
  color: var(--text-dim);
  font-size: 0.92rem;
  padding-left: 16px;
  position: relative;
}
.skill-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 6px; height: 6px;
  background: var(--accent-2);
  border-radius: 50%;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.project-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.project-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.project-card p { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 16px; }
.server-address {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 16px;
}
.server-address code { font-size: 0.85rem; color: var(--accent-2); flex: 1; }
.copy-btn {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Infrastructure */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.status-grid li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel);
  padding: 20px;
}
.status-grid p { font-size: 0.95rem; margin-bottom: 3px; }
.status-grid span { font-size: 0.8rem; color: var(--text-faint); font-family: var(--mono); }

/* Contact */
.contact-grid > div { max-width: 62ch; }
.contact-grid p { color: var(--text-dim); margin-bottom: 24px; }
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }
.contact-list li { display: flex; align-items: center; gap: 12px; color: var(--text-dim); }
.contact-list a:hover { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.footer-inner a:hover { color: var(--accent); }
