  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    color-scheme: dark;
    --bg: #0a0e17;
    --surface: #131822;
    --surface2: #1b2129;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e4e6ee;
    --muted: #8a8f9d;
    --muted-dim: #7d818f;
    --text-body: #a6aab6;
    --accent: #4a8ef7;
    --accent2: #3f6fc0;
    --accent-dim: rgba(74, 142, 247, 0.10);
    --danger: #f07470;
  }

  /* ---------- Superficies del navegador ---------- */
  html { scrollbar-color: var(--border-strong) var(--bg); }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  ::selection { background: var(--accent); color: var(--bg); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  input, textarea { caret-color: var(--accent); }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding: 0 1.25rem 4rem;
    transition: background 0.2s, color 0.2s;
  }

  .page { width: 100%; max-width: 1160px; margin: 0 auto; }

  [id="proceso"], [id="portafolio"], [id="contacto"] { scroll-margin-top: 5rem; }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    max-width: 1160px;
    min-height: 4rem;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
  }
  .site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
  }
  .site-brand-mark { width: 22px; height: 22px; flex-shrink: 0; }
  .site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }
  .site-nav a {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.16s, background 0.16s, border-color 0.16s;
  }
  .site-nav a:hover,
  .site-nav a:focus-visible { color: var(--text); }
  .site-nav .site-nav-cta {
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 0.45rem 0.95rem;
  }
  .site-nav .site-nav-cta:hover,
  .site-nav .site-nav-cta:focus-visible { color: var(--bg); background: var(--accent); }

  /* ---------- Nav offcanvas + back to top (solo mobile) ---------- */
  .nav-toggle { display: none; }
  .nav-offcanvas, .nav-overlay { display: none; }
  .back-to-top { display: none; }

  @media (max-width: 768px) {
    /* En mobile la nav vive dentro del menú */
    .site-nav { display: none; }

    .nav-toggle {
      position: fixed;
      top: 10px;
      right: 1rem;
      width: 44px;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 8px;
      cursor: pointer;
      transition: color 0.18s, border-color 0.18s;
      z-index: 90;
    }
    .nav-toggle:hover { color: var(--accent); border-color: var(--border-strong); }
    .nav-toggle-icon { width: 16px; height: 16px; flex-shrink: 0; }
    .nav-toggle .icon-close { display: none; }
    body.nav-open .nav-toggle .icon-bars { display: none; }
    body.nav-open .nav-toggle .icon-close { display: block; }

    .nav-overlay {
      display: block;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s, visibility 0.2s;
      z-index: 70;
    }
    .nav-offcanvas {
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0;
      right: 0;
      width: 78%;
      max-width: 300px;
      height: 100%;
      background: var(--surface);
      border-left: 1px solid var(--border);
      padding: 4.75rem 1.5rem 2rem;
      transform: translateX(100%);
      transition: transform 0.24s ease;
      z-index: 80;
      overflow-y: auto;
    }
    .nav-offcanvas .nav-label {
      font-family: 'DM Mono', monospace;
      font-size: 12px;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--muted-dim);
      margin-bottom: 1.25rem;
    }
    .nav-offcanvas a {
      font-size: 16px;
      color: var(--text);
      text-decoration: none;
      padding: 0.7rem 0;
      border-bottom: 1px solid var(--border);
      transition: color 0.16s;
    }
    .nav-offcanvas a:hover,
    .nav-offcanvas a:focus-visible { color: var(--accent); }
    .nav-offcanvas .nav-cta { color: var(--accent); font-weight: 400; }

    body.nav-open { overflow: hidden; }
    body.nav-open .nav-overlay { opacity: 1; visibility: visible; }
    body.nav-open .nav-offcanvas { transform: translateX(0); }

    .back-to-top {
      position: fixed;
      bottom: 1.1rem;
      right: 1.1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 9px;
      cursor: pointer;
      opacity: 0;
      visibility: hidden;
      transform: translateY(6px);
      transition: opacity 0.2s, visibility 0.2s, transform 0.2s, color 0.18s, border-color 0.18s;
      z-index: 55;
    }
    .back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
    .back-to-top:hover { color: var(--accent); border-color: var(--border-strong); }
    .back-to-top-icon { width: 16px; height: 16px; flex-shrink: 0; }
  }

  /* ---------- Hero media ---------- */
  .hero-media {
    margin-bottom: 3.5rem;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.75rem 1.5rem;
    background:
      linear-gradient(0deg, rgba(8, 11, 18, 0.7) 0%, rgba(8, 11, 18, 0) 55%),
      #0a0e17 url('../img/hero-bg.webp') left center / cover no-repeat;
    border-radius: 8px;
    overflow: hidden;
  }

  .hero-media .eyebrow { color: rgba(255, 255, 255, 0.82); }
  .hero-media h1 {
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  }
  .hero-media h1 .em { color: #dbe9ff; }
  .hero-media .tagline {
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 0;
    max-width: 46ch;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.75rem;
    margin-top: 1.75rem;
  }
  .hero-link {
    font-size: 15px;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.16s;
  }
  .hero-link:hover { text-decoration-color: #fff; }

  /* ---------- Botón principal ---------- */
  .btn,
  .cf-submit {
    display: inline-flex;
    align-items: center;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bg);
    background: var(--accent);
    border: none;
    border-radius: 4px;
    padding: 0.85rem 1.6rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, opacity 0.18s;
  }
  .btn:hover,
  .btn:focus-visible,
  .cf-submit:hover { background: var(--accent2); color: #fff; }

  h1 {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 16px;
    max-width: 16ch;
    text-wrap: balance;
  }
  h2, h3 { text-wrap: balance; }
  h1 .em { color: var(--accent); font-weight: 500; }

  .tagline {
    font-size: 17px;
    color: var(--muted);
    margin-bottom: 3.5rem;
  }

  /* ---------- Section label ---------- */
  .section-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(24px, 2.6vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text);
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 1.75rem;
  }
  .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }
  .section-label .count {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-dim);
    white-space: nowrap;
  }
  .section-label::after { align-self: center; }

  /* ---------- Proceso (tarjetas) ---------- */
  .process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .process-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 3 / 4;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0a0e17;
    overflow: hidden;
    isolation: isolate;
  }
  .process-card--discovery { --card-img: url('../img/process-bg-descubrimiento.webp'); }
  .process-card--design { --card-img: url('../img/process-bg-diseno.webp'); }
  .process-card--dev { --card-img: url('../img/process-bg-desarrollo.webp'); }
  .process-card--delivery { --card-img: url('../img/process-bg-entrega.webp'); }

  /* Imagen y degradado en capas propias para poder adaptarlas al tema */
  .process-card::before,
  .process-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }
  .process-card::before { background: var(--card-img) center top / cover no-repeat; }
  .process-card::after {
    background: linear-gradient(180deg, rgba(10, 14, 23, 0) 35%, rgba(10, 14, 23, 0.85) 100%);
  }

  .process-card-body { position: relative; z-index: 1; }
  .process-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 19px;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 8px;
    transition: color 0.2s;
  }
  .process-card-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #c3c8d4;
    transition: color 0.2s;
  }



  @media (max-width: 900px) {
    .process-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 560px) {
    .process-grid { grid-template-columns: 1fr; }
    .process-card { aspect-ratio: 4 / 3; }
    .process-card::after {
      background: linear-gradient(180deg, rgba(10, 14, 23, 0) 10%, rgba(10, 14, 23, 0.92) 62%);
    }
    .hero-media {
      background:
        linear-gradient(0deg, rgba(8, 11, 18, 0.85) 0%, rgba(8, 11, 18, 0.25) 70%),
        #0a0e17 url('../img/hero-bg.webp') 78% center / cover no-repeat;
    }
  }

  section.section-block { margin-bottom: 5rem; }

  /* ---------- Portafolio: destacados con captura + índice ---------- */
  .pf-featured {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .portfolio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.18s, background 0.18s;
  }
  .portfolio-card:hover,
  .portfolio-card:focus-within {
    background: var(--surface2);
    border-color: var(--border-strong);
  }
  .portfolio-card--featured { padding: 0; gap: 0; overflow: hidden; }
  .pf-shot {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
    border-bottom: 1px solid var(--border);
  }
  .pf-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 1.5rem;
  }

  .pf-index {
    list-style: none;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
  }
  .pf-row {
    position: relative;
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr) 11rem;
    align-items: baseline;
    gap: 0.5rem 2rem;
    padding: 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.18s;
  }
  .pf-row:hover,
  .pf-row:focus-within { background: var(--surface2); }
  .pf-row-head { display: flex; flex-direction: column; gap: 6px; }

  .pf-tag {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .pf-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--accent);
    flex-shrink: 0;
  }

  .pf-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color 0.18s;
  }
  .pf-title a {
    color: inherit;
    text-decoration: none;
    outline: none;
  }
  .pf-title a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
  .pf-title a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
  .portfolio-card .pf-title a::after { border-radius: 8px; }
  .portfolio-card:hover .pf-title,
  .portfolio-card:focus-within .pf-title,
  .pf-row:hover .pf-title,
  .pf-row:focus-within .pf-title { color: var(--accent); }

  .pf-desc {
    font-size: 14.5px;
    color: var(--muted);
    line-height: 1.6;
    flex-grow: 1;
  }

  .pf-url {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.02em;
    margin-top: auto;
  }
  .pf-row .pf-desc { flex-grow: 0; max-width: 62ch; }
  .pf-row .pf-url { text-align: right; overflow-wrap: anywhere; }
  .pf-arrow {
    display: inline-block;
    margin-left: 3px;
    transition: transform 0.18s, color 0.18s;
  }
  .pf-arrow svg { width: 11px; height: 11px; vertical-align: -1px; }
  .portfolio-card:hover .pf-arrow,
  .portfolio-card:focus-within .pf-arrow,
  .pf-row:hover .pf-arrow,
  .pf-row:focus-within .pf-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
  }

  @media (max-width: 860px) {
    .pf-row { grid-template-columns: minmax(0, 1fr) auto; }
    .pf-row .pf-desc { grid-column: 1 / -1; grid-row: 2; }
  }
  @media (max-width: 560px) {
    .pf-featured { grid-template-columns: 1fr; }
    .pf-row { grid-template-columns: 1fr; padding: 1.1rem 0.25rem; }
    .pf-row .pf-url { text-align: left; }
    .pf-row .pf-desc { grid-row: auto; }
  }

  /* ---------- Footer ---------- */
  footer {
    position: relative;
    margin-top: 3.5rem;
    padding: 4rem 2rem 2rem;
    background: #0a0e17 url('../img/guide-divider.webp') center / cover no-repeat;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    overflow: hidden;
  }
  footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 11, 18, 0.3) 0%, rgba(8, 11, 18, 0.72) 100%);
  }
  footer > * { position: relative; z-index: 1; }

  .footer-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(34px, 6vw, 64px);
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
  }
  .footer-brand:hover { color: #dbe9ff; }

  .footer-meta {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.04em;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }
  .footer-meta a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
  .footer-meta a:hover { color: #dbe9ff; }

  @media (max-width: 560px) {
    footer { padding: 3rem 1.5rem 1.75rem; gap: 2rem; }
  }

  /* ---------- Contacto ---------- */
  #contacto { border-top: 1px solid var(--border); padding-top: 3rem; }
  .contact-grid {
    display: grid;
    grid-template-columns: 1fr minmax(0, 480px);
    gap: 2.5rem 4rem;
    align-items: start;
  }
  .contact-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 1rem;
  }
  .contact-intro {
    font-size: 17px;
    color: var(--text-body);
    line-height: 1.65;
    max-width: 40ch;
    margin-bottom: 1.25rem;
  }
  .contact-alt { font-size: 15px; color: var(--muted); }
  .contact-alt a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(74, 142, 247, .35);
    text-underline-offset: 3px;
  }
  .contact-alt a:hover { text-decoration-color: currentColor; }
  @media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
  }
  .cf-legend {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted-dim);
    margin-bottom: 1.1rem;
  }
  .cf-required { color: var(--accent); }
  .cf-row { margin-bottom: 1.1rem; }
  .cf-row label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
  }
  .cf-row input,
  .cf-row textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    padding: 0.7rem 0.85rem;
    outline: none;
    transition: border-color 0.18s, background 0.18s;
  }
  .cf-row input:focus,
  .cf-row textarea:focus { border-color: var(--accent); background: var(--surface2); }
  .cf-row textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
  .cf-row input[aria-invalid="true"],
  .cf-row textarea[aria-invalid="true"] { border-color: var(--danger); }
  .cf-error {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--danger);
  }
  /* Honeypot: oculto para personas, presente en el DOM para bots */
  .cf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .cf-submit:disabled { opacity: 0.6; cursor: default; }
  .cf-status {
    margin-top: 1rem;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--muted);
  }
  .cf-status-ok { color: var(--accent); }
  .cf-status-error { color: var(--danger); }
  .cf-status a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

  @media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; }
  }

  @media (max-width: 560px) {
    body { padding: 0 1rem 3rem; }
    .tagline { font-size: 15.5px; margin-bottom: 2.5rem; }
  }

  @media (max-width: 560px) {
    section.section-block { margin-bottom: 3.5rem; }
  }
