/* ============================================
   Nico Bértolo Lago — v6
   Gris neutro puro (sin calidez). Verde solo en el dot online.
   Toggle real. Hover = solo color/profundidad, nunca desplazamiento.
   ============================================ */

:root{
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-pill: 999px;
  --online: #2FBE5C;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --yt-red: #FF0000;
  --li-blue: #0A66C2;
  --ig-1: #C73B92;
  --ig-2: #F5A24B;
}

html[data-theme="light"]{
  --bg: #FFFFFF;
  --surface: #F0F0F0;
  --surface-2: #E2E2E2;
  --ink: #0A0A0A;
  --ink-soft: rgba(10,10,10,0.5);
  --ink-faint: rgba(10,10,10,0.32);
  --tint: rgba(10,10,10,0.045);
  --tint-strong: rgba(10,10,10,0.08);
  --invert-bg: #0A0A0A;
  --invert-ink: #FFFFFF;
  --toggle-off: #D6D6D6;
  --ios-off: #E9E9EA;
  --blur-scrim: rgba(255,255,255,0.75);
}

html[data-theme="dark"]{
  --bg: #0A0A0A;
  --surface: #161616;
  --surface-2: #222222;
  --ink: #F5F5F5;
  --ink-soft: rgba(245,245,245,0.5);
  --ink-faint: rgba(245,245,245,0.3);
  --tint: rgba(245,245,245,0.055);
  --tint-strong: rgba(245,245,245,0.1);
  --invert-bg: #F5F5F5;
  --invert-ink: #0A0A0A;
  --toggle-off: #333333;
  --ios-off: #39393D;
  --blur-scrim: rgba(10,10,10,0.7);
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', sans-serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.5s var(--ease-soft), color 0.5s var(--ease-soft);
}

@media (hover: hover) and (pointer: fine){ body{ cursor: none; } }

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

a{ color: inherit; }

/* ===== cursor — oculto por defecto, solo activo con puntero fino ===== */
.cursor-dot{
  display: none;
  position: fixed; top:0; left:0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%,-50%);
  transition: width 0.25s var(--ease-soft), height 0.25s var(--ease-soft);
  will-change: transform;
}
.cursor-dot.active{ display: block; }
.cursor-dot.grow{ width: 20px; height: 20px; }

/* ===== frame blur — arriba y abajo de la ventana ===== */
.frame-fade{
  position: fixed;
  left: 0; right: 0;
  height: 100px;
  pointer-events: none;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.frame-fade.top{
  top: 0;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
}
.frame-fade.bottom{
  bottom: 0;
  -webkit-mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%);
  mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%);
}

/* ===== reveal — desenfoque gaussiano notorio ===== */
.reveal{
  opacity: 0;
  filter: blur(22px);
  transform: translateY(16px);
  transition: opacity 1s var(--ease), filter 1s var(--ease), transform 1s var(--ease);
}
.reveal.in{ opacity: 1; filter: blur(0); transform: translateY(0); }

.projects .project-row:nth-child(1){ transition-delay: 0s; }
.projects .project-row:nth-child(2){ transition-delay: 0.1s; }
.projects .project-row:nth-child(3){ transition-delay: 0.2s; }

/* ===== layout ===== */
.shell{ max-width: 560px; margin: 0 auto; padding: 0 22px; }
.narrow{ max-width: 520px; margin: 0 auto; }

/* ===== hero — centrado ===== */
.hero{
  padding: 64px 0 6px;
  display:flex;
  flex-direction: column;
  align-items:center;
  text-align: center;
}

.avatar-badge{
  position: relative;
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
}
.avatar-badge .photo-frame{
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}
.avatar-badge .photo-frame img{ width:100%; height:100%; object-fit: cover; display:block; }
.avatar-badge .fallback{
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  font-size: 24px; font-weight: 500; color: var(--ink-soft);
}
.online-badge{
  position: absolute;
  bottom: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--online);
  border: 3px solid var(--bg);
  box-sizing: content-box;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink{
  0%,100%{ opacity:1; transform: scale(1); }
  50%{ opacity:0.5; transform: scale(0.8); }
}

h1{
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.subline{ font-weight: 300; font-size: 14.5px; color: var(--ink-soft); margin-bottom: 10px; }

.meta-line{
  display:flex; align-items:center; justify-content:center; gap: 7px;
  font-weight: 300; font-size: 12px; color: var(--ink-faint);
  margin-bottom: 22px;
}
.meta-line svg{ width: 11px; height: 11px; opacity: 0.8; }

/* ===== socials — iconos oficiales, feedback por color/profundidad ===== */
.social-icons{ display:flex; justify-content:center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.social-icon-btn{
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface);
  display:flex; align-items:center; justify-content:center;
  text-decoration:none;
  transition: background 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}
.social-icon-btn:hover{ background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--tint-strong); }
.social-icon-btn:active{ transform: scale(0.94); }
.social-icon-btn svg{ width: 19px; height: 19px; }
.social-icon-btn .chip{
  position:absolute; bottom: -2px; right: -2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font-size: 8px; font-weight: 700;
  display:flex; align-items:center; justify-content:center;
  border: 2px solid var(--bg); box-sizing: content-box;
}

/* ===== sections ===== */
.section{ padding-top: 46px; }
.section-title{ font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 14px; text-align: center; }

/* ===== projects — full redondos ===== */
.projects{ display:flex; flex-direction:column; gap: 8px; }
.project-row{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 12px 20px 12px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  text-decoration:none;
  color: var(--ink);
  transition: background 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft);
}
.project-row:hover{ background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--tint-strong); }
.project-row:active{ transform: scale(0.99); }
.project-mark{
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--tint-strong);
  flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.project-mark img{ width:100%; height:100%; object-fit: cover; }
.project-mark .fallback{ font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }
.project-body{ flex:1; min-width:0; }
.project-name{ font-size: 15.5px; font-weight: 500; letter-spacing: -0.012em; margin-bottom: 2px; }
.project-desc{ font-size: 12.5px; font-weight: 400; color: var(--ink-soft); }
.project-arrow-btn{
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--tint-strong);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  color: var(--ink-soft);
  transition: background 0.35s var(--ease-soft), color 0.35s var(--ease-soft);
}
.project-row:hover .project-arrow-btn{ background: var(--invert-bg); color: var(--invert-ink); }

.projects-note{ font-size: 12px; font-weight: 300; color: var(--ink-faint); text-align: center; padding-top: 12px; }

/* ===== FAQ — chat real: pregunta izq, respuesta dcha ===== */
.chat{ display:flex; flex-direction:column; gap: 2px; }
.chat-item{ display:flex; flex-direction:column; }

.chat-q{
  width:100%;
  display:flex;
  justify-content:flex-start;
  background:none; border:none;
  padding: 8px 0 0;
  cursor:pointer;
  font-family: inherit;
}
.chat-q-bubble{
  background: var(--tint-strong);
  color: var(--ink);
  padding: 10px 15px;
  border-radius: 14px 14px 14px 3px;
  font-size: 13px;
  font-weight: 400;
  max-width: 76%;
  text-align: left;
  transition: background 0.3s var(--ease-soft);
}
.chat-q:hover .chat-q-bubble{ background: var(--surface-2); }

.chat-a-wrap{ max-height: 0; overflow:hidden; transition: max-height 0.55s var(--ease); }
.chat-item.open .chat-a-wrap{ max-height: 220px; }

.chat-a-row{ display:flex; justify-content:flex-end; align-items:flex-end; gap: 9px; padding: 8px 0 12px; }
.chat-avatar{ width: 26px; height: 26px; border-radius: 50%; overflow:hidden; flex-shrink:0; background: var(--surface); order: 2; }
.chat-avatar img{ width:100%; height:100%; object-fit:cover; }
.chat-avatar .fallback{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size: 9px; color: var(--ink-soft); }
.chat-a-bubble{
  order: 1;
  background: var(--invert-bg);
  color: var(--invert-ink);
  padding: 10px 15px;
  border-radius: 14px 14px 3px 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 78%;
  text-align: left;
  opacity: 1;
  transition: opacity 0.35s var(--ease-soft);
}
.typing-dots{ display:flex; gap:4px; padding: 3px 2px; }
.typing-dots span{ width:4px; height:4px; border-radius:50%; background: var(--invert-ink); opacity: 0.6; animation: bounce 1.3s infinite ease-in-out; }
.typing-dots span:nth-child(2){ animation-delay: 0.15s; }
.typing-dots span:nth-child(3){ animation-delay: 0.3s; }
@keyframes bounce{ 0%,60%,100%{ transform: translateY(0); opacity:0.4; } 30%{ transform: translateY(-3px); opacity:1; } }

/* ===== footer ===== */
.page-footer{
  margin-top: 56px;
  padding: 24px 0 128px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-brand{ font-size: 12.5px; font-weight: 400; color: var(--ink-soft); }
.footer-links{ display:flex; gap: 16px; }
.footer-links a{ font-size: 12px; font-weight: 400; color: var(--ink-faint); text-decoration:none; transition: color 0.3s var(--ease-soft); }
.footer-links a:hover{ color: var(--ink); }

/* ===== dock ===== */
.dock{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display:flex;
  align-items:center;
  gap: 2px;
  padding: 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}
.dock a{
  display:flex; align-items:center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 400;
  text-decoration:none;
  color: var(--ink-soft);
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}
.dock a:hover{ background: var(--tint-strong); color: var(--ink); }
.dock a:active{ transform: scale(0.96); }

/* interruptor real — iOS switch, verde de verdad */
.theme-toggle{
  position: relative;
  display: flex;
  align-items: center;
  width: 51px; height: 31px;
  border-radius: var(--radius-pill);
  background: var(--ios-off);
  box-shadow: inset 0 0 0 1px var(--tint-strong);
  border: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink:0;
  margin-left: 4px;
  transition: background 0.3s var(--ease-soft);
}
.theme-toggle.on{
  background: #34C759;
  box-shadow: none;
}
.theme-toggle .knob{
  display: block;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}
.theme-toggle.on .knob{ transform: translateX(20px); }

@media (max-width: 420px){
  .dock{ padding: 4px; gap: 0; }
  .dock a{ padding: 7px 10px; font-size: 11px; }
}

/* ===== book / legal pages ===== */
.book-page{ min-height: 100vh; display:flex; flex-direction:column; justify-content:center; padding: 110px 22px 100px; }
.book-back{
  position: fixed; top: 20px; left: 20px; z-index: 50;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft);
  text-decoration:none;
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}
.book-back:hover{ background: var(--surface-2); color: var(--ink); }
.book-back:active{ transform: scale(0.92); }
.book-back svg{ width: 15px; height: 15px; }
.book-title{ font-family: 'Inter Tight', sans-serif; font-weight: 500; font-size: clamp(26px, 4.5vw, 36px); letter-spacing: -0.03em; margin-bottom: 8px; text-align:center; }
.book-sub{ font-size: 13.5px; font-weight: 300; color: var(--ink-soft); max-width: 380px; margin-bottom: 34px; text-align:center; margin-left:auto; margin-right:auto; }

.field{ margin-bottom: 12px; }
.field label{ display:block; font-size: 11.5px; font-weight: 400; color: var(--ink-faint); margin-bottom: 7px; padding-left: 18px; }
.field input, .field textarea{
  width:100%; border:none;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 14px 20px;
  font-family: 'Inter Tight', sans-serif; font-weight: 400; font-size: 14.5px; letter-spacing: -0.01em;
  color: var(--ink); outline:none;
  transition: background 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}
.field input:focus, .field textarea:focus{ background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--ink-faint); }
.field textarea{ border-radius: var(--radius-md); resize: vertical; min-height: 100px; font-family: inherit; }
.field input::placeholder, .field textarea::placeholder{ color: var(--ink-faint); }

.send-row{ display:flex; flex-direction:column; gap: 10px; margin-top: 16px; }
.send-btn{
  display:flex; align-items:center; justify-content:center; gap: 9px;
  width:100%;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  border:none;
  cursor:pointer;
  font-family: 'Inter Tight', sans-serif; font-size: 13.5px; font-weight: 500;
  text-decoration:none;
  transition: opacity 0.3s var(--ease-soft), background 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}
.send-btn svg{ width: 16px; height: 16px; flex-shrink:0; }
.send-btn.primary{ background: var(--invert-bg); color: var(--invert-ink); }
.send-btn.secondary{ background: var(--surface); color: var(--ink); }
.send-btn:not(.disabled):hover{ opacity: 0.85; }
.send-btn:not(.disabled):active{ transform: scale(0.98); }
.send-btn.disabled{
  pointer-events: none;
  opacity: 0.35;
}
.send-note{ font-size: 11.5px; font-weight: 300; color: var(--ink-faint); text-align:center; margin-top: 4px; transition: opacity 0.3s var(--ease-soft); }

/* legal doc pages */
.legal-doc h2{ font-size: 15px; font-weight: 500; margin: 26px 0 8px; letter-spacing: -0.01em; }
.legal-doc h2:first-child{ margin-top: 0; }
.legal-doc p{ font-size: 13.5px; font-weight: 300; color: var(--ink-soft); line-height: 1.7; margin-bottom: 8px; }
.legal-doc ul{ padding-left: 18px; margin-bottom: 8px; }
.legal-doc li{ font-size: 13.5px; font-weight: 300; color: var(--ink-soft); line-height: 1.7; }
