/* ============================================================
   Carlos Revuelto · Desired State — Platform Engineer portfolio
   Design system + global styles
   ============================================================ */

:root {
  /* Colors */
  --bg:            #0a0e1a;
  --bg-soft:       #0f1525;
  --bg-card:       #121a2e;
  --border:        #1f2a44;
  --text:          #e6ecf7;
  --text-muted:    #9aa7c2;
  --accent:        #38bdf8;
  --accent-2:      #6366f1;
  --accent-grad:   linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  --success:       #34d399;

  /* Layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 12px; }
.section-head p { color: var(--text-muted); }
.muted { color: var(--text-muted); }
.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 0.95rem;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-soft); }
.nav-links a.nav-cta {
  background: var(--accent-grad); color: #fff; font-weight: 600;
}
.nav-links a.nav-cta:hover { opacity: .9; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 24px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, opacity .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-grad); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 80px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -200px; right: -150px;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.22), transparent 60%);
  filter: blur(20px); z-index: 0;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: .15em; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 20px; text-wrap: balance; }
.lead { color: var(--text-muted); font-size: 1.1rem; max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.6rem; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stats span { color: var(--text-muted); font-size: 0.85rem; }

/* Terminal card */
.terminal { background: #0c1120; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: #0a0f1c; border-bottom: 1px solid var(--border); }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f56; }
.terminal-bar span:nth-child(2) { background: #ffbd2e; }
.terminal-bar span:nth-child(3) { background: #27c93f; }
.terminal-bar p { margin-left: 10px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }
.terminal-body { padding: 20px; font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; color: #cdd6f4; white-space: pre-wrap; }
.c-comment { color: #6b7a99; }
.c-key { color: #c792ea; }
.c-str { color: #c3e88d; }
.c-num { color: #f78c6c; }
.c-var { color: #82aaff; }
.c-prompt { color: var(--success); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-icon { font-size: 1.8rem; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--accent-grad); border-radius: var(--radius);
  padding: 44px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; font-size: 1.6rem; }
.cta-band p { color: rgba(255,255,255,.85); }
.cta-band .btn-primary { background: #fff; color: #1e1b4b; }

/* ---------- Page header ---------- */
.page-head { padding: 64px 0 24px; text-align: center; }
.page-head .eyebrow { margin-bottom: 12px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
.page-head p { color: var(--text-muted); max-width: 600px; margin: 14px auto 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.about-photo {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  aspect-ratio: 1; display: grid; place-items: center; font-size: 5rem;
  background-image: radial-gradient(circle at 30% 20%, rgba(56,189,248,.18), transparent 60%);
  overflow: hidden;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-grid h2 { font-size: 1.5rem; margin: 0 0 14px; }
.about-grid p { color: var(--text-muted); margin-bottom: 16px; }
.fact-list { display: grid; gap: 10px; margin-top: 20px; }
.fact-list li { display: flex; gap: 10px; color: var(--text-muted); }
.fact-list strong { color: var(--text); min-width: 110px; }

/* Timeline */
.timeline { position: relative; margin-top: 8px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item::before { content: ""; position: absolute; left: -28px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 0 4px var(--bg); }
.timeline-item h3 { font-size: 1.1rem; }
.timeline-item .meta { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin: 2px 0 8px; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Skills ---------- */
.skill-group { margin-bottom: 36px; }
.skill-group h3 { font-size: 1.15rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-family: var(--mono); font-size: 0.85rem; padding: 8px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-muted); transition: .2s;
}
.tag:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; }
.project-card .card-icon { font-size: 2rem; }
.project-context { display: grid; gap: 12px; margin-top: 4px; }
.ctx { position: relative; padding-left: 14px; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }
.ctx::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; }
.ctx-problem::before { background: #f78c6c; }
.ctx-solution::before { background: var(--success); }
.ctx-impact::before { background: var(--accent); }
.ctx-label {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 500;
  margin-right: 6px; padding: 1px 7px; border-radius: 999px;
}
.ctx-problem .ctx-label { color: #f78c6c; background: rgba(247,140,108,.12); }
.ctx-solution .ctx-label { color: var(--success); background: rgba(52,211,153,.12); }
.ctx-impact .ctx-label { color: var(--accent); background: rgba(56,189,248,.12); }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
/* Wide / featured card spanning the full grid row */
.project-card-wide { grid-column: 1 / -1; }
.project-video {
  position: relative; width: 100%; margin: 4px 0 18px;
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.project-video iframe,
.project-video video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.project-tags span { font-family: var(--mono); font-size: 0.72rem; padding: 4px 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; color: var(--accent); }
.project-links { margin-top: auto; display: flex; gap: 16px; padding-top: 8px; }
.project-links a { font-size: 0.88rem; font-weight: 600; color: var(--accent); }
.project-links a:hover { text-decoration: underline; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.contact-info h2 { font-size: 1.4rem; margin-bottom: 12px; }
.contact-info p { color: var(--text-muted); margin-bottom: 24px; }
.contact-methods { display: grid; gap: 14px; }
.contact-methods a { display: flex; align-items: center; gap: 12px; color: var(--text-muted); transition: color .2s; }
.contact-methods a:hover { color: var(--text); }
.contact-methods .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); font-size: 1.1rem; }

.form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.form button { width: 100%; }
.form-hint { margin-top: 12px; font-size: 0.85rem; text-align: center; }
.form-status { margin-top: 16px; font-size: 0.9rem; text-align: center; min-height: 20px; }
.form-status.ok { color: var(--success); }
.form-status.err { color: #f87171; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-inner > p:first-child { font-weight: 700; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.site-footer .muted { font-size: 0.82rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-card { order: -1; }

  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    padding: 16px 24px; transform: translateY(-150%); transition: transform .3s;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 14px; }
  /* The CTA is an action, not a nav item — separate it from the link list so its
     filled background doesn't crowd the item above it. */
  .nav-links li:last-child { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .grid-3, .grid-2, .form-row { grid-template-columns: 1fr; }
  .cta-band { padding: 32px; text-align: center; justify-content: center; }
  .section { padding: 56px 0; }
}

/* Honeypot field — off-screen rather than display:none, which some bots skip */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
