/* ═══════════════════════════════════════════════════════════════════
   JOAN BELMONTE — COLORIST  |  css/style.css  vFINAL
   ═══════════════════════════════════════════════════════════════════ */

/* ── TEMA OSCURO (por defecto) ───────────────────────────────────── */
:root {
  --bg:               #080808;
  --bg2:              #0f0f0f;
  --bg3:              #161616;
  --text:             #e8e4df;
  --text-sub:         rgba(232,228,223,0.70);
  --muted:            #5a5652;
  --accent:           #c8b89a;
  --border:           rgba(200,184,154,0.11);
  --nav-bg:           rgba(8,8,8,0.60);
  --drawer-bg:        #080808;
  --scroll-thumb:     #2a2826;
  --thumb-filter:     saturate(0.72) brightness(0.88);
  --thumb-hover:      saturate(1.0) brightness(0.65);
  --select-arrow:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a5652'/%3E%3C/svg%3E");
  --option-bg:        #111;
  --nav-h:            64px;
  --font-display:     'Cormorant Garamond', serif;
  --font-body:        'DM Sans', sans-serif;
  --ease:             cubic-bezier(0.25, 0.1, 0.25, 1);
  --t:                0.45s;   /* theme transition duration */
}

/* ── TEMA CLARO ──────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:               #f5f2ed;
  --bg2:              #edeae3;
  --bg3:              #e5e1d9;
  --text:             #1a1714;
  --text-sub:         rgba(26,23,20,0.62);
  --muted:            #8a8278;
  --accent:           #8a6d42;
  --border:           rgba(138,109,66,0.14);
  --nav-bg:           rgba(245,242,237,0.75);
  --drawer-bg:        #f5f2ed;
  --scroll-thumb:     #c2bab0;
  --thumb-filter:     saturate(0.82) brightness(0.96);
  --thumb-hover:      saturate(1.05) brightness(0.72);
  --select-arrow:     url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8278'/%3E%3C/svg%3E");
  --option-bg:        #edeae3;
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background:  var(--bg);
  color:       var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0.01em;
  overflow-x:  hidden;
  cursor: none;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
a   { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
ul  { list-style: none; }

::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 2px; }

/* ── CURSOR ──────────────────────────────────────────────────────── */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width .3s var(--ease), height .3s var(--ease), background var(--t);
}
.cursor.hover { width: 6px; height: 6px; }

/* ═══════════════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════════════ */
   nav {
     position: fixed; top: 0; left: 0; right: 0;
     height: var(--nav-h); z-index: 500;
     display: flex; align-items: center; justify-content: space-between;
     padding: 0 3rem; background: var(--nav-bg);
     backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
     border-bottom: 1px solid var(--border);
     transition: background-color var(--t) var(--ease);
   }

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
  flex-shrink: 0;
  transition: color var(--t);
}

.nav-links { display: flex; align-items: center; gap: 3rem; }
.nav-links a {
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); transition: color .3s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-controls {
  display: flex; align-items: center; height: 100%;
}


.lang-selector {
  display: flex; align-items: center; gap: .9rem;
  padding-left: 2rem; margin-left: 2.5rem;
  border-left: 1px solid var(--border);
  height: 20px; /* Alineación vertical */
}

.lang-btn {
  font-family: var(--font-body); font-size: .62rem;
  text-transform: uppercase; color: var(--muted);
  background: none; border: none; cursor: none;
  transition: color .3s;
}
.lang-btn.active, .lang-btn:hover { color: var(--accent); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: none; border: none;
  color: var(--muted); margin-left: 1.4rem; cursor: none;
}

.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }

.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; width: 32px;
}
.nav-toggle span {
  display: block; width: 22px; height: 1px; background: var(--text);
  transition: transform .35s var(--ease), opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-drawer {
  position: fixed; inset: var(--nav-h) 0 0 0;
  z-index: 490; background: var(--drawer-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: translateX(100%); transition: transform .45s var(--ease);
  visibility: hidden; /* Evita que sea interactivo si está cerrado */
}
.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-links {
  display: flex; flex-direction: column; align-items: center; gap: 2.5rem;
}
.drawer-links a {
  font-family: var(--font-display); font-size: 2.4rem;
  color: var(--text); transition: color .3s;
}

.drawer-divider {
  width: 40px; height: 1px; background: var(--border); margin: 3rem 0;
}

.drawer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.drawer-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Control de iconos (Sol/Luna) igual que en desktop */
.drawer-theme-btn .icon-sun { display: none; }
.drawer-theme-btn .icon-moon { display: block; }

[data-theme="light"] .drawer-theme-btn .icon-sun { display: block; }
[data-theme="light"] .drawer-theme-btn .icon-moon { display: none; }

.drawer-theme-btn svg {
  width: 18px;
  height: 18px;
}


/* Estilo para el botón de volver en la página de proyecto */
.back-link {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

/* Animación sutil de la flecha al hacer hover */
.back-link:hover::before {
    transform: translateX(-3px);
}

/* Si prefieres usar un pseudo-elemento para la flecha en lugar de texto: */
/*
.back-link::before {
    content: '←';
    transition: transform 0.3s ease;
}
*/

/* ═══════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════ */
#hero {
  position: relative; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  filter: brightness(0.6) contrast(1.1);
}

.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,.7) 100%);
}

.hero-content {
  position: relative; z-index: 3; text-align: center;
  animation: fadeUp 1.4s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}

.hero-name {
  font-family: var(--font-display); font-size: clamp(3.8rem, 11vw, 10rem);
  font-weight: 300; letter-spacing: .06em; color: #e8e4df;
}

.scroll-hint {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  z-index: 3; animation: fadeInHint 1.5s 1s both;
}

@keyframes fadeInHint {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.scroll-line {
  width: 1px; height: 45px;
  background: linear-gradient(to bottom, rgba(232,228,223,0.4) 0%, transparent 100%);
  animation: loopScrollLine 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes loopScrollLine {
  0%, 100% { transform: scaleY(0); opacity: 0; }
  30%, 60% { transform: scaleY(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════
   PORTFOLIO
   ═══════════════════════════════════════════════════════════════════ */
#portfolio { background: var(--bg); padding: 4rem 0 8rem; }

.portfolio-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px;
}

.project-card {
  position: relative; cursor: pointer; overflow: hidden; aspect-ratio: 16/9;
  background: var(--bg3); border-radius: 8px;
  transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: transform;
}

.project-card:hover { transform: scale(1.01); }

.img-wrap { position: absolute; inset: 0; overflow: hidden; border-radius: 8px; }

.project-thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.5s cubic-bezier(0.2, 1, 0.3, 1),
              filter 1.2s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: transform, filter;
}

.project-card:hover .project-thumb {
  transform: scale(1.04); filter: saturate(1.05) brightness(0.9);
}

.project-overlay {
  position: absolute; inset: 0; z-index: 3; padding: 2rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
  opacity: 0; transition: opacity 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

.project-overlay > * {
  transform: translateY(20px); opacity: 0;
  transition: transform 1.4s cubic-bezier(0.2, 1, 0.3, 1),
              opacity 1.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.project-card:hover .project-overlay { opacity: 1; }
.project-card:hover .project-overlay > * { transform: translateY(0); opacity: 1; }

.project-title-card {
  font-family: var(--font-display); font-size: 1.6rem; color: #e8e4df;
}

.project-credits { font-size: .68rem; color: rgba(232,228,223,.6); line-height: 1.7; }



/* ═══════════════════════════════════════════════════════════════════
   PAGINA DE PROYECTO
   ═══════════════════════════════════════════════════════════════════ */



/* Padding superior para compensar la Nav fija[cite: 7] */
/* Correcciones específicas para Proyecto Detail */
.project-detail-page main {
    padding-top: 100px;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 3rem;
}

.video-wrapper {
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
    margin-bottom: 4rem;
}

#det-frames-container {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Responsive para la página de proyecto */
@media (max-width: 900px) {
    .container { padding: 0 1.5rem; }
    .project-detail-page main { padding-top: 80px; }
    .info-grid { grid-template-columns: 1fr; gap: 2rem; }
    #det-frames-container { grid-template-columns: 1fr; }
    .project-header h1 { font-size: 2.2rem; }
}


/* ═══════════════════════════════════════════════════════════════════
   ABOUT & CONTACT
   ═══════════════════════════════════════════════════════════════════ */
   #about {
     background: var(--bg2);
     padding: 8rem 0; /* Aseguramos aire arriba y abajo */
   }

   .about-inner {
     max-width: 900px;
     margin: 0 auto;
     display: flex;
     flex-direction: column;
     align-items: flex-start; /* Todo alineado a la izquierda */
     text-align: left;
     padding: 0 3rem;
   }

   .about-text {
     max-width: 720px; /* Evita que las líneas de texto sean infinitas */
     margin-bottom: 4rem;
   }

   .about-text p {
     font-size: 1.05rem;
     line-height: 1.9;
     margin-bottom: 1.8rem;
     color: var(--text-sub);
   }

   .about-text p:first-of-type {
     font-size: 1.25rem;
     color: var(--text);
     font-weight: 400;
     line-height: 1.6;
   }

   .about-social {
     margin-top: 2rem;
     display: flex;
     gap: 2rem;
   }

   .social-link {
     font-size: 0.65rem;
     letter-spacing: 0.2em;
     text-transform: uppercase;
     color: var(--muted);
     transition: color 0.3s;
     display: flex;
     align-items: center;
     gap: 0.7rem;
   }

   .social-link svg { width: 14px; height: 14px; }
   .social-link:hover { color: var(--accent); }

   /* Ajuste específico para el móvil en esta sección */
@media (max-width: 900px) {
  .about-inner {
    padding: 4rem 1.5rem !important;
  }
  .about-text p:first-of-type {
    font-size: 1.15rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   RESTABLECIMIENTO DE CONTACTO
   ═══════════════════════════════════════════════════════════════════ */
#contact {
  background: var(--bg);
  padding: 8rem 0;
}

.contact-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 3rem;
}

.contact-lead {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 300;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.contact-email {
  margin-bottom: 4rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.contact-form {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-field label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field input, .form-field select, .form-field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s;
}

.form-field input:focus, .form-field textarea:focus {
  border-bottom-color: var(--accent);
}

.btn-submit {
  align-self: flex-start;
  padding: 1rem 2.5rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .68rem;
  transition: 0.3s;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE MÓVIL
   ═══════════════════════════════════════════════════════════════════ */
   @media (max-width: 900px) {
     nav { padding: 0 1.5rem; }

     .nav-links, .lang-selector, .theme-toggle {
       display: none !important;
     }

     .nav-toggle {
       display: flex !important;
       align-items: center; justify-content: center;
     }

     /* Aseguramos que el contenido del menú móvil se vea blanco/claro */
     .mobile-drawer .drawer-links a {
       color: var(--text);
     }

     .portfolio-grid { grid-template-columns: 1fr !important; padding: 0 1rem; }

     .project-overlay {
       opacity: 1 !important;
       background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%) !important;
     }

     .project-overlay > * { transform: translateY(0) !important; opacity: 1 !important; }

     .contact-lead {
       font-size: 1.6rem !important; white-space: normal; letter-spacing: -0.01em;
     }


  body { cursor: auto !important; }
  .cursor { display: none !important; }
}

footer { padding: 2rem 3rem; display: flex; justify-content: space-between; font-size: .6rem; color: var(--muted); }
.reveal { opacity: 0; transform: translateY(22px); transition: 0.8s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }
