/* =========================================================
   Cristopher Valle — Portafolio / Nuestro Trabajo
   Sistema de diseño inspirado en cleverrsites.com
   ========================================================= */

:root {
  --black: #141414;
  --white: #ffffff;
  --dark-gray: #232323;
  --medium-gray: #595959;
  --soft-gray: #afafaf;
  --red: #ff5753;

  /* Acento del sitio, tomado del logo CV.
     --accent      relleno (circulo, cortinilla, fondo de botones)
     --accent-ink  texto encima del relleno
     --accent-text acento como TEXTO o linea fina sobre el fondo oscuro
                   (mas claro, si no no alcanza contraste sobre #141414) */
  --accent: #1a63e0;
  --accent-ink: #ffffff;
  --accent-text: #6f9dff;

  --nav-h: 80px;    /* alto de la barra superior */
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  background-color: var(--black);
  color: var(--white);
  font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 20px;
}

img { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0 0 16px;
  position: relative;
  letter-spacing: -.03em;
  font-weight: 300;
}
h1 { font-size: 68px; line-height: 1em; }
h2 { font-size: 54px; line-height: 1.08em; }
h3 { font-size: 40px; line-height: 1.08em; }
p  { margin: 0 0 16px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #333; border: 1px solid var(--white); }

::selection { background: var(--accent); color: var(--accent-ink); }

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

/* ---------------------------------------------------------
   Utilidades
   --------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 60px;
  padding-right: 60px;
  position: relative;
}
.container.medium-container { max-width: 1100px; }

.label {
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 700;
}

.label-small {
  color: var(--soft-gray);
  letter-spacing: -.03em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.label-small.black-link { color: var(--accent-ink); }

.no-margin-bottom { margin-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Navegación: barra superior fija
   --------------------------------------------------------- */

.menu-button {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.hamburger {
  width: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hamburger-line {
  height: 2px;
  width: 24px;
  background-color: var(--white);
  transition: transform .3s ease, opacity .2s ease, width .3s ease;
}
.hamburger-line._2-line { width: 16px; }

.menu-button:hover .hamburger-line._2-line { width: 24px; }

/* estado abierto -> X */
.is-menu-open .hamburger-line._1-line { transform: translateY(8px) rotate(45deg); }
.is-menu-open .hamburger-line._2-line { opacity: 0; }
.is-menu-open .hamburger-line._3-line { transform: translateY(-8px) rotate(-45deg); }

/* Barra superior */
.nav-horizontal {
  z-index: 20;
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  padding-left: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--black);
  border-bottom: 1px solid var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  font-size: 18px;
  letter-spacing: -.03em;
  transition: opacity .2s;
}
.brand:hover { opacity: .7; }

.brand-mark {
  width: auto;
  height: 30px;
  flex: none;
}

.brand-text { display: inline-flex; align-items: baseline; gap: .3em; }
.brand .brand-first { font-weight: 300; }
.brand .brand-last  { font-weight: 700; }
.brand .brand-dot   { color: var(--accent-text); font-weight: 700; }

/* Grupo de acciones a la derecha de la barra: idioma + CTA */
.nav-actions {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.lang-button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 22px;
  border: 0;
  border-left: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.lang-button:hover {
  background-color: var(--dark-gray);
  color: var(--accent-text);
}
.lang-button svg { flex: none; }

.nav-button {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 64px;
  border-left: 1px solid var(--white);
  background-color: var(--dark-gray);
  color: var(--white);
  letter-spacing: -.03em;
  text-transform: uppercase;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.nav-button:hover {
  background-color: var(--accent);
  color: var(--accent-ink);
}

/* Panel de menú deslizante */
.menu-panel {
  z-index: 25;
  position: fixed;
  inset: 0 auto 0 0;
  width: 380px;
  max-width: 100vw;
  padding: 100px 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--black);
  border-right: 1px solid var(--white);
  transform: translateX(-101%);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), visibility .35s;
  overflow-y: auto;
}
.is-menu-open .menu-panel { transform: translateX(0); visibility: visible; }

.menu-overlay {
  z-index: 15;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.is-menu-open .menu-overlay { opacity: 1; visibility: visible; }

.nav-list { display: flex; flex-direction: column; }

.nav-link-box {
  position: relative;
  display: block;
  color: var(--white);
  text-decoration: none;
}

.nav-link-line {
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background-color: var(--medium-gray);
  overflow: hidden;
}
.nav-link-line::after {
  content: "";
  position: absolute;
  inset: 0 100% 0 0;
  background-color: var(--accent-text);
  transition: right .35s cubic-bezier(.22,.61,.36,1);
}
.nav-link-box:hover .nav-link-line::after { right: 0; }

.nav-link {
  display: flex;
  width: 100%;
  padding: 20px 16px 20px 0;
  letter-spacing: -.03em;
  font-size: 18px;
  font-weight: 400;
  transition: transform .25s ease, color .25s ease;
}
.nav-link-box:hover .nav-link { transform: translateX(8px); }
.nav-link.is-current { color: var(--accent-text); }

.social-list {
  display: flex;
  gap: 24px;
  padding-top: 32px;
}
.social-link {
  color: var(--white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: uppercase;
  transition: color .2s;
}
.social-link:hover { color: var(--accent-text); }

/* ---------------------------------------------------------
   Lienzo de página
   --------------------------------------------------------- */

.page {
  flex: 1;
  min-width: 0;
  padding-top: var(--nav-h);
  overflow: hidden;
}

.page-content { position: relative; }

.section { position: relative; }

.section-basic {
  padding-top: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--white);
}

.section-header { position: relative; margin-bottom: 32px; }
.section-header.large-header { margin-bottom: 64px; }

.section-flex {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.section-line {
  width: 1px;
  height: 100px;
  margin: 0 54px;
  background-color: var(--white);
  flex: none;
}

.content-270 { width: 100%; max-width: 270px; }

.size-2 { font-size: 54px; font-weight: 300; line-height: 1.08em; }
.size-2 strong { font-weight: 700; }


/* ---------------------------------------------------------
   Grid de proyectos
   --------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-item { display: flex; }

.project-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--white);
  color: var(--white);
  text-decoration: none;
  transition: background-color .3s ease;
}
.project-item:hover .project-link { background-color: #1a1a1a; }

.project-media {
  position: relative;
  overflow: hidden;
}

.portfolio-link-block { display: block; cursor: none; }

.portfolio-image {
  width: 100%;
  height: 270px;
  object-fit: cover;
  border-bottom: 1px solid var(--white);
  transition: transform .6s cubic-bezier(.22,.61,.36,1);
}
.project-media:hover .portfolio-image { transform: scale(1.04); }

/* Cortinillas que barren la imagen al entrar el cursor */
.stripe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: right center;
}
.stripe-green { background-color: var(--accent); }
.stripe-black { background-color: var(--black); }

@keyframes stripe-wipe {
  0%    { transform: scaleX(0); transform-origin: right center; }
  48%   { transform: scaleX(1); transform-origin: right center; }
  48.1% { transform: scaleX(1); transform-origin: left center; }
  100%  { transform: scaleX(0); transform-origin: left center; }
}

.project-media:hover .stripe-green {
  animation: stripe-wipe .75s cubic-bezier(.65,0,.35,1) forwards;
}
.project-media:hover .stripe-black {
  animation: stripe-wipe .75s cubic-bezier(.65,0,.35,1) .1s forwards;
}

/* Círculo verde que sigue al mouse */
.mouse-link {
  z-index: 3;
  position: absolute;
  top: 0; left: 0;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 100%;
  background-color: var(--accent);
  text-decoration: none;
  opacity: 0;
  transform: translate(var(--mx, 50%), var(--my, 50%)) scale(.4);
  transition: opacity .25s ease, transform .3s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
}
.project-media:hover .mouse-link {
  opacity: 1;
  transform: translate(var(--mx, 50%), var(--my, 50%)) scale(1);
  transition: opacity .25s ease, transform .08s linear;
}

.project-link-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px;
}

.project-link-content h3 { margin-bottom: 8px; }

.project-link-content .label { color: var(--white); }

.project-tags {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  max-width: 400px;
  margin-top: auto;
  padding-top: 24px;
  margin-bottom: -16px;
}

.project-tag {
  margin: 0 16px 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--white);
  text-decoration: none;
  color: inherit;
  transition: color .2s, background-color .2s;
}
.project-tag:hover { background-color: var(--white); color: var(--black); }

.project-tag-text {
  letter-spacing: -.03em;
  font-size: 16px;
  line-height: 1.08em;
}

/* ---------------------------------------------------------
   Llamado a la acción
   --------------------------------------------------------- */

.cta-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  flex-wrap: wrap;
}
/* sin esto el titulo no cede espacio y el boton se desborda */
.cta-flex > * { min-width: 0; }

.cta-text { max-width: 620px; }

.cta-sub {
  margin: 20px 0 0;
  max-width: 480px;
  color: var(--soft-gray);
  font-size: 16px;
  line-height: 1.5;
}

.cta-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 22px 36px;
  background-color: var(--accent);
  color: var(--accent-ink);
  letter-spacing: -.03em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, transform .2s cubic-bezier(.22,.61,.36,1);
}
.cta-button:hover {
  background-color: var(--accent-text);
  transform: translateY(-2px);
}
.cta-button svg { flex: none; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.footer { padding: 80px 0 40px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 60px;
}

.footer-title {
  margin-bottom: 24px;
  color: var(--soft-gray);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-link {
  color: var(--white);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: -.03em;
  transition: color .2s;
}
.footer-link:hover { color: var(--accent-text); }

.footer-contact { display: grid; gap: 20px; margin: 0; }
.footer-contact dt {
  color: var(--soft-gray);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}
.footer-contact dd { margin: 4px 0 0; font-size: 16px; }
.footer-contact a { color: var(--white); text-decoration: none; }
.footer-contact a:hover { color: var(--accent-text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--medium-gray);
  color: var(--soft-gray);
  font-size: 13px;
}
.footer-bottom a { color: var(--soft-gray); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent-text); }

/* ---------------------------------------------------------
   Formulario de contacto
   --------------------------------------------------------- */

.contact-form {
  width: 100%;
  max-width: 680px;
}

.field { margin-bottom: 28px; }

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--soft-gray);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.field-input {
  display: block;
  width: 100%;
  padding: 18px 20px;
  border: 1px solid var(--white);
  background-color: transparent;
  color: var(--white);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -.03em;
  transition: border-color .2s;
}
.field-input::placeholder { color: var(--medium-gray); }
.field-input:focus {
  outline: none;
  border-color: var(--accent-text);
}
.field-input.has-error { border-color: var(--red); }

.field-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.form-error {
  margin: 0 0 20px;
  color: var(--red);
  font-size: 14px;
}
.form-error[hidden] { display: none; }

/* Los dos botones de envío, a la par */
.form-actions {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.action-button {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s cubic-bezier(.22,.61,.36,1);
}
.action-button:hover { transform: translateY(-2px); }
.action-button svg { flex: none; }
/* en pantallas angostas el texto envuelve a dos lineas en vez de
   cortarse: los botones tienen que seguir cabiendo a la par */
.action-button span {
  text-align: center;
  line-height: 1.3;
}

/* verde de WhatsApp: es el color con el que se reconoce */
.action-whatsapp {
  background-color: #25d366;
  color: #fff;
}
.action-whatsapp:hover { background-color: #1fbb59; }

/* SMS toma el acento del sitio, para diferenciarlo */
.action-sms {
  background-color: transparent;
  border-color: var(--white);
  color: var(--white);
}
.action-sms:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.form-note {
  margin: 20px 0 0;
  color: var(--soft-gray);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   Botón flotante de WhatsApp
   Verde oficial de WhatsApp a proposito: es el color con el que
   la gente reconoce el boton al instante, aunque el acento del
   sitio sea azul.
   --------------------------------------------------------- */

.whatsapp-fab {
  --wa: #25d366;
  z-index: 40;
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 60px;
  padding: 0;
  border-radius: 999px;
  background-color: var(--wa);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  transition: transform .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s ease;
}
.whatsapp-fab:hover { box-shadow: 0 10px 30px rgba(37, 211, 102, .45); }
.whatsapp-fab:active { transform: scale(.96); }

.whatsapp-fab-icon {
  flex: none;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
}

/* La etiqueta se despliega en hover/focus: ancho 0 -> ancho real */
.whatsapp-fab-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.03em;
  opacity: 0;
  transition: max-width .35s cubic-bezier(.22,.61,.36,1),
              opacity .25s ease,
              padding-left .35s cubic-bezier(.22,.61,.36,1);
}
.whatsapp-fab:hover .whatsapp-fab-label,
.whatsapp-fab:focus-visible .whatsapp-fab-label {
  max-width: 260px;
  padding-left: 22px;
  opacity: 1;
}

/* Pulso suave para que se note sin ser invasivo */
.whatsapp-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--wa);
  animation: wa-pulse 2.6s ease-out infinite;
  z-index: -1;
}
@keyframes wa-pulse {
  0%       { transform: scale(1);   opacity: .55; }
  70%,100% { transform: scale(1.5); opacity: 0; }
}
.whatsapp-fab:hover::before { animation-play-state: paused; opacity: 0; }

@media (max-width: 575px) {
  .whatsapp-fab { right: 16px; bottom: 16px; height: 54px; }
  .whatsapp-fab-icon { width: 54px; height: 54px; }
  .whatsapp-fab-icon svg { width: 26px; height: 26px; }
  /* en tactil no hay hover, la etiqueta nunca se abre: se deja solo el icono */
  .whatsapp-fab-label { display: none; }
}

/* ---------------------------------------------------------
   Animaciones de entrada al hacer scroll
   --------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 991px) {
  h1 { font-size: 54px; }
  h2, .size-2 { font-size: 44px; }
  h3 { font-size: 32px; }

  .container { padding-left: 40px; padding-right: 40px; }
  .nav-horizontal { padding-left: 40px; }
  .nav-button { padding: 0 32px; }

  .project-grid { gap: 60px; }
  .project-link-content { padding: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .section-flex { flex-direction: column; align-items: flex-start; }
  .section-line {
    width: 100%;
    height: 1px;
    margin: 28px 0;
  }
  .content-270 { max-width: none; }

  .project-grid { grid-template-columns: 1fr; gap: 40px; }
  .portfolio-image { height: 220px; }
  .portfolio-link-block { cursor: pointer; }
  .mouse-link { display: none; }

  .cta-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }
}

@media (max-width: 575px) {
  h1 { font-size: 40px; }
  h2, .size-2 { font-size: 34px; }
  h3 { font-size: 26px; }

  .container { padding-left: 24px; padding-right: 24px; }
  .nav-horizontal { padding-left: 20px; }
  .nav-button { padding: 0 18px; font-size: 11px; text-align: center; }
  .lang-button { padding: 0 14px; gap: 6px; font-size: 11px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-mark { height: 26px; }

  .cta-button {
    justify-content: center;
    width: 100%;
    padding: 20px 24px;
    font-size: 12px;
  }

  .section-basic { padding-top: 56px; padding-bottom: 56px; }
  .project-link-content { padding: 24px; }
  .menu-panel { padding: 90px 28px 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer { padding-top: 56px; }

  .field-input { padding: 16px; font-size: 15px; }
  .form-actions { gap: 12px; }
  .action-button { padding: 18px 12px; font-size: 12px; gap: 8px; }
}

/* En pantallas muy angostas el logo solo, para que quepan las acciones */
@media (max-width: 419px) {
  .brand-text { display: none; }
  .nav-button { padding: 0 12px; font-size: 10px; }
  .lang-button { padding: 0 10px; font-size: 10px; }
  /* el globo se va: con dos letras basta y libera espacio */
  .lang-button svg { display: none; }

  /* los dos botones siguen a la par: solo se aprieta el texto */
  .action-button { padding: 16px 8px; font-size: 11px; gap: 6px; }
  .action-button svg { width: 17px; height: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
