/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

/* ── Theme tokens ───────────────────────────────────────── */
    :root {
      --bg:       #0f1117;
      --surface:  #1a1f2e;
      --surface2: #222840;
      --accent:   #4f9cf9;
      --accent2:  #7ee8a2;
      --text:     #e2e8f0;
      --muted:    #8892a4;
      --border:   rgba(255,255,255,0.08);
      --tag-bg:   rgba(79,156,249,0.12);
      --tag-c:    #4f9cf9;
      --tag2-bg:  rgba(126,232,162,0.12);
      --tag2-c:   #7ee8a2;
      --card-hover: rgba(255,255,255,0.04);
      --nav-bg:   rgba(15,17,23,0.85);
    }
    [data-theme="light"] {
      --bg:       #f8f9fc;
      --surface:  #ffffff;
      --surface2: #f0f4ff;
      --accent:   #2563eb;
      --accent2:  #0891b2;
      --text:     #1e3a5f;
      --muted:    #64748b;
      --border:   rgba(0,0,0,0.08);
      --tag-bg:   rgba(37,99,235,0.08);
      --tag-c:    #1d4ed8;
      --tag2-bg:  rgba(8,145,178,0.08);
      --tag2-c:   #0369a1;
      --card-hover: rgba(0,0,0,0.03);
      --nav-bg:   rgba(248,249,252,0.90);
    }

    
/* ── Skip link (accesibilidad) ──────────────────────────────────── */
.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 9999;
  background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 0 0 8px 8px;
  font-size: 14px; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }


/* ── Logo color adaptation per theme ────────────────────────────── */
[data-theme="dark"] .nav-logo-icon img,
:root:not([data-theme="light"]) .nav-logo-icon img {
  filter: brightness(1.6) saturate(0.85);
  transition: filter 0.3s;
}

[data-theme="light"] .nav-logo-icon img {
  filter: none;
  transition: filter 0.3s;
}
/* ── Reset & base ───────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'Space Grotesk', sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 16px;
      line-height: 1.7;
      transition: background 0.3s, color 0.3s;
    }
    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }
    ::selection { background: var(--accent); color: #fff; }

    /* ── Navbar ─────────────────────────────────────────────── */
    nav {
      position: fixed; top: 0; left: 0; right: 0; z-index: 100;
      background: var(--nav-bg);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 0 2rem;
      height: 56px;
      display: flex; align-items: center; justify-content: space-between;
      transition: background 0.3s, border-color 0.3s;
    }
    .nav-logo {
      display: flex; align-items: center; gap: 10px;
      font-weight: 700; font-size: 15px; color: var(--text);
      letter-spacing: -0.02em; text-decoration: none;
    }
    .nav-logo:hover { text-decoration: none; }
    .nav-logo-icon {
      width: 32px; height: 32px; flex-shrink: 0;
      color: var(--accent); transition: color 0.2s;
    }
    .nav-logo-text { color: var(--text); }
    .nav-logo-text span { color: var(--accent); }
    .lang-btn {
      background: none; border: 1px solid var(--border);
      border-radius: 8px; cursor: default; padding: 5px 10px;
      color: var(--muted); font-size: 12px; font-weight: 600;
      font-family: 'Space Grotesk', sans-serif;
      letter-spacing: 0.04em; opacity: 0.5;
      transition: border-color 0.2s, color 0.2s;
      white-space: nowrap;
    }
    .nav-links {
      display: flex; align-items: center; gap: 1.75rem; list-style: none;
    }
    .nav-links a {
      font-size: 14px; font-weight: 500; color: var(--muted);
      transition: color 0.2s;
    }
    .nav-links a:hover { color: var(--text); text-decoration: none; }
    .nav-right { display: flex; align-items: center; gap: 12px; }
    .theme-btn {
      background: none; border: 1px solid var(--border);
      border-radius: 8px; cursor: pointer; padding: 6px 10px;
      color: var(--muted); font-size: 16px; line-height: 1;
      transition: border-color 0.2s, color 0.2s;
    }
    .theme-btn:hover { border-color: var(--accent); color: var(--accent); }
    .cta-nav {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 13px; font-weight: 600;
      background: var(--accent); color: #fff;
      border: none; border-radius: 8px;
      padding: 7px 16px; cursor: pointer;
      transition: opacity 0.2s;
      white-space: nowrap;
    }
    .cta-nav:hover { opacity: 0.88; }
    .hamburger { display: none; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 22px; }

    
/* ── Hero brand line ─────────────────────────────────────────────── */
.hero-brand {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
/* ── Sections ────────────────────────────────────────────── */
    section { padding: 96px 2rem; max-width: 1000px; margin: 0 auto; }
    section:first-of-type { padding-top: 140px; }
    .eyebrow {
      font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--accent);
      margin-bottom: 12px;
    }
    h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
    h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
    h3 { font-size: 1.05rem; font-weight: 700; }
    .divider { border: none; border-top: 1px solid var(--border); margin: 0; }

    /* ── Hero ───────────────────────────────────────────────── */
    #hero { padding-top: 160px; padding-bottom: 100px; }
    .hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
    .tag {
      font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
      letter-spacing: 0.04em;
    }
    .tag-a { background: var(--tag-bg); color: var(--tag-c); }
    .tag-b { background: var(--tag2-bg); color: var(--tag2-c); }
    .tag-n {
      background: var(--border);
      color: var(--muted);
    }
    .hero-sub {
      font-size: 1.15rem; color: var(--muted); margin: 20px 0 36px;
      max-width: 600px; line-height: 1.65;
    }
    .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
    .btn-primary {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 15px; font-weight: 600;
      background: var(--accent); color: #fff;
      border: none; border-radius: 10px;
      padding: 13px 28px; cursor: pointer;
      transition: opacity 0.2s, transform 0.15s;
      display: inline-block;
    }
    .btn-primary:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
    .btn-ghost {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 15px; font-weight: 500;
      background: none; color: var(--muted);
      border: 1px solid var(--border);
      border-radius: 10px; padding: 13px 28px;
      cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.15s;
      display: inline-block;
    }
    .btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); text-decoration: none; }

    /* Typewriter signature */
    .typewriter-wrap {
      margin: 48px 0 0;
      font-family: 'Space Grotesk', monospace;
      font-size: 13px; color: var(--muted);
    }
    .typewriter-prompt { color: var(--accent2); margin-right: 6px; }
    #typewriter { color: var(--text); }
    .cursor {
      display: inline-block; width: 2px; height: 14px;
      background: var(--accent); margin-left: 2px;
      vertical-align: middle; animation: blink 1s step-end infinite;
    }
    @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

    /* ── Services ────────────────────────────────────────────── */
    .services-intro { color: var(--muted); max-width: 560px; margin-bottom: 48px; }
    .services-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 16px;
    }
    .service-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px; padding: 28px;
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }
    .service-card:hover { background: var(--card-hover); border-color: var(--accent); transform: translateY(-2px); }
    .service-icon {
      font-size: 26px; margin-bottom: 14px; display: block;
      filter: grayscale(0.2);
    }
    .service-card h3 { margin-bottom: 8px; }
    .service-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
    .service-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
    .stag {
      font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px;
      background: var(--surface2); color: var(--muted);
    }

    /* ── Projects ────────────────────────────────────────────── */
    .projects-intro { color: var(--muted); max-width: 560px; margin-bottom: 48px; }
    .projects-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 16px;
    }
    .project-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px; padding: 28px;
      display: flex; flex-direction: column;
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }
    .project-card:hover { background: var(--card-hover); border-color: var(--accent2); transform: translateY(-2px); }
    .project-meta { font-size: 11px; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; }
    .project-card h3 { margin-bottom: 8px; }
    .project-card p { font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; }
    .project-link {
      margin-top: 20px; font-size: 13px; font-weight: 600;
      color: var(--accent); display: inline-flex; align-items: center; gap: 4px;
      transition: gap 0.2s;
    }
    .project-link:hover { gap: 8px; text-decoration: none; }

    /* ── About ───────────────────────────────────────────────── */
    .about-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 64px; align-items: start;
    }
    .about-text p { color: var(--muted); margin-bottom: 1rem; font-size: 15px; line-height: 1.75; }
    .about-text p:last-child { margin-bottom: 0; }
    .stack-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
    .stack-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
    .stack-list li {
      display: flex; align-items: center; gap: 10px;
      font-size: 14px; color: var(--muted);
    }
    .stack-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); flex-shrink: 0; }
    .stack-list li strong { color: var(--text); font-weight: 600; }
    .stat-row { display: flex; gap: 32px; margin-top: 32px; }
    .stat { display: flex; flex-direction: column; }
    .stat-num { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
    .stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

    /* ── Contact ─────────────────────────────────────────────── */
    #contact { text-align: center; }
    .contact-sub { color: var(--muted); max-width: 480px; margin: 16px auto 40px; }
    .contact-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
    .contact-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 12px; padding: 18px 28px;
      display: flex; align-items: center; gap: 12px;
      transition: border-color 0.2s, transform 0.2s;
      text-decoration: none; color: var(--text);
    }
    .contact-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
    .contact-icon { font-size: 22px; }
    .contact-info { text-align: left; }
    .contact-info strong { display: block; font-size: 14px; font-weight: 600; }
    .contact-info span { font-size: 12px; color: var(--muted); }

    /* ── Footer ──────────────────────────────────────────────── */
    footer {
      border-top: 1px solid var(--border);
      padding: 32px 2rem;
      max-width: 1000px; margin: 0 auto;
      display: flex; justify-content: space-between; align-items: center;
      font-size: 13px; color: var(--muted);
    }
    footer a { color: var(--muted); }
    footer a:hover { color: var(--accent); }

    /* ── Scroll reveal ───────────────────────────────────────── */
    .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
    .reveal.visible { opacity: 1; transform: translateY(0); }

    /* ── Responsive ──────────────────────────────────────────── */
    @media (max-width: 700px) {
      .nav-links { display: none; }
      .hamburger { display: block; }
      .about-grid { grid-template-columns: 1fr; gap: 40px; }
      section { padding: 72px 1.25rem; }
      #hero { padding-top: 120px; }
      .stat-row { gap: 20px; }
    }
    
    @media (max-width: 500px) {
      .theme-btn { display: none; }
      /* .lang-btn { display: none; } */
    }

    @media (max-width: 400px) {
      .lang-btn { display: none; }
    }


    /* ── Reduced motion ──────────────────────────────────────── */
    @media (prefers-reduced-motion: reduce) {
      .cursor { animation: none; }
      .reveal { opacity: 1; transform: none; transition: none; }
      .btn-primary:hover, .btn-ghost:hover,
      .service-card:hover, .project-card:hover,
      .contact-card:hover { transform: none; }
    }
/* ── Landscape mobile ───────────────────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  #hero { padding-top: 80px; padding-bottom: 60px; }
  h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
  .hero-sub { font-size: 1rem; margin-bottom: 20px; }
  section { padding: 60px 2rem; }
}
