/* =========================
   THEMES
   ========================= */
:root{
  --accent: rgb(0, 0, 0);
}

/* Light */
html[data-theme="light"]{
  --bg: #efefef;
  --panel: #ffffff;
  --text: #121212;
  --muted: #6b6b6b;
  --stroke: rgba(0,0,0,0.08);
  --shadow: 0 16px 60px rgba(0,0,0,.10);
  --soft: #f4f4f4;
}

/* Dark */
html[data-theme="dark"]{
  --accent: rgb(255, 255, 255);
  --bg: #0b0b0c;
  --panel: #101012;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --stroke: rgba(255,255,255,0.10);
  --shadow: 0 18px 70px rgba(0,0,0,.55);
  --soft: rgba(255,255,255,0.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    linear-gradient(115deg, rgba(0, 0, 0, 0.95) 0 22%, transparent 22% 100%),
    var(--bg);
  color:var(--text);
  overflow:hidden; /* scroll  */
}

/* Layout */
.app{
  height:100vh;
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:22px;
  padding:22px;
}

/* Three.js background */
#bg{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0; 
  display: block;
  pointer-events: none;
}

/* Info at front */
.app, .loader{
  position: relative;
  z-index: 1;
}

/* subtle “glass” */
.sidebar, .main{
  backdrop-filter: blur(10px);
  background: color-mix(in oklab, var(--panel), transparent 10%);
}


/* =========================
   SIDEBAR 
   ========================= */
.sidebar{
  background:var(--panel);
  border-radius:18px;
  box-shadow:var(--shadow);
  border:1px solid var(--stroke);
  overflow:hidden; 
}

.side-inner{
  height:100%;
  padding:22px;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden; /* NO scroll */
  min-height:0;
}

.side-head{ min-width:0; text-align: center;}

.avatar{
  width: clamp(92px, 12vw, 140px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--soft);
  border: 2px solid var(--stroke);
  flex: 0 0 auto;
  align-self: center;
}
.avatar img{
  width:100%;
  height:100%;
  object-fit: cover;
  object-position: center;
  display:block;
}

.name{
  font-weight:900;
  letter-spacing:.2px;
  font-size:26px;
  line-height:1.05;
  margin-top:6px;
  min-width:0;
  text-align: center;
}
.name span{ color: var(--accent); }
.role{
  color:var(--muted);
  font-weight:700;
  font-size:14px;
  margin-top:4px;
  text-align: center;
}

.quote{
  margin:8px 0 0;
  padding:10px 12px;
  border-left:3px solid var(--accent);
  background: var(--soft);
  border-radius:12px;
  color: var(--text);
  font-size:13px;
  line-height:1.5;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Info rows */
.side-info{
  display:grid;
  gap:10px;
  margin-top:8px;
}
.info-row{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  background: var(--soft);
  border-radius:12px;
  border:1px solid var(--stroke);
  min-width:0;
}
.ico{
  width:32px; height:32px;
  border-radius:11px;
  display:grid;
  place-items:center;
  background: var(--panel);
  border:1px solid var(--stroke);
  font-weight:900;
  color: var(--accent);
}

/* Acciones */
.side-actions{
  margin-top:auto; 
  display:grid;
  gap:10px;
}

/* =========================
   BUTTONS / TABS
   ========================= */

/* Primary button */
.btn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--accent);
  background: #000;/*var(--accent);*/
  color:#fff;
  text-decoration:none;
  font-weight:900;

  text-transform: uppercase;
  letter-spacing: .10em;
  font-size:12px;

  transition: transform .15s ease, filter .15s ease;
}
.btn:hover{
  filter: brightness(1.05);
}

/* Social */
.social{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.social a{
  width:42px; height:42px;
  border-radius:12px;
  display:grid;
  place-items:center;
  border:1px solid var(--stroke);
  background: var(--panel);
  text-decoration:none;
  color: var(--text);
  font-weight:900;

  text-transform: uppercase;
  letter-spacing: .08em;
  font-size:12px;

  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.social a:hover{
  border-color: color-mix(in oklab, var(--stroke), var(--accent) 35%);
  background: color-mix(in oklab, var(--panel), var(--accent) 6%);
}

.social a i{
  font-size:18px;
  line-height:1;
}

/* =========================
   MAIN
   ========================= */
.main{
  background:var(--panel);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
  border:1px solid var(--stroke);
  display:flex;
  flex-direction:column;
  min-width:0;
}

/* Topbar */
.topbar{
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  background: var(--panel);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.tabs{
  display:flex;
  gap:10px;
  overflow:auto;
}
.tabs::-webkit-scrollbar{ display:none; }

/* Top nav tabs */
.tab{
  padding:10px 16px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: var(--panel);
  cursor:pointer;
  font-weight:900;
  color: var(--text);
  white-space:nowrap;

  text-transform: uppercase;
  letter-spacing:.10em;
  font-size:12px;

  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.tab:hover{
  border-color: color-mix(in oklab, var(--stroke), var(--accent) 35%);
  background: color-mix(in oklab, var(--panel), var(--accent) 6%);
}
.tab.active{
  border-color: color-mix(in oklab, var(--accent), var(--stroke) 25%);
  background: color-mix(in oklab, var(--accent), var(--panel) 88%);
  box-shadow: 0 10px 26px color-mix(in oklab, var(--accent), transparent 85%);
}

/* Theme toggle */
.toggle{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  font-weight:900;
  cursor:pointer;
}
.switch{
  width:38px;
  height:22px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--soft);
  position:relative;
  display:inline-block;
}
.switch::after{
  content:"";
  width:16px; height:16px;
  border-radius:999px;
  background: var(--accent);
  position:absolute;
  top:50%; left:3px;
  transform: translateY(-50%);
  transition: .18s ease;
}
html[data-theme="dark"] .switch::after{
  left: calc(100% - 3px - 16px);
}

/* Scroll solo derecha */
.content{
  flex:1 1 auto;
  overflow-y:auto;
  padding:22px 26px 40px;
  scroll-behavior:smooth;
}

/* Sections typography */
.section{ padding-bottom: 40px; }
.page-head{ margin-bottom: 22px; }

.kicker{
  font-weight:900;
  letter-spacing:.16em;
  font-size:12px;
  color: var(--text);
  text-transform:uppercase;
  opacity:.85;
}
.title{
  font-size:46px;
  line-height:1.05;
  margin:10px 0 8px;
  font-weight:900;
}
.accent{ color: var(--accent); }
.lede{
  max-width: 820px;
  color: var(--muted);
  line-height:1.6;
  font-size:16px;
  margin:0;
}

.h2{
  font-size:18px;
  letter-spacing:.12em;
  text-transform:uppercase;
  margin:0 0 10px;
  font-weight:900;
}
.p{
  margin:0;
  color: color-mix(in oklab, var(--text), transparent 18%);
  line-height:1.75;
  font-size:15px;
}
.p.muted{ color: var(--muted); }

.divider{
  height:1px;
  background: var(--stroke);
  margin:22px 0;
}

/* Perfil */
.stat-row{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
  margin-top:18px;
}
.stat{
  padding:14px 0;
  border-top:1px solid var(--stroke);
}
.stat .num{ font-weight:900; font-size:22px; }
.stat .lbl{ color: var(--muted); margin-top:4px; font-weight:800; }

.two-col{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
}

.info-grid{ display:grid; gap:10px; }
.info-pill{
  padding:12px 14px;
  background: var(--soft);
  border:1px solid var(--stroke);
  border-radius:14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.info-pill b{ font-weight:900; }

/* Timeline */
.timeline{ display:grid; gap:18px; }
.t-item{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:18px;
  padding:18px 0;
  border-top:1px solid var(--stroke);
}
.t-when{ color: var(--muted); font-weight:900; }
.t-body{ position:relative; padding-left:16px; }
.t-body::before{
  content:"";
  position:absolute;
  left:0; top:6px; bottom:6px;
  width:2px;
  background: var(--accent);
  border-radius:99px;
}
.t-title{ font-weight:900; font-size:22px; margin:0; }
.t-sub{ margin:6px 0 10px; color: var(--muted); font-weight:800; }

.t-bullets{
  margin:0;
  padding-left:18px;
  line-height:1.7;
  color: color-mix(in oklab, var(--text), transparent 18%);
}
.tags{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.tag{
  font-size:12px;
  padding:7px 10px;
  border:1px solid var(--stroke);
  border-radius:999px;
  background: var(--panel);
  font-weight:900;
}

/* Filters */
.filters.minimal{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:16px 0 18px;
}
.filters input, .filters select{
  padding:12px 14px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--panel);
  outline:none;
  font-weight:900;
  color: var(--text);
}

/* Projects */
.masonry{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:16px;
}
.work{
  text-decoration:none;
  color: inherit;
  display:block;
}
.work .thumb{
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--stroke);
  background: var(--soft);
  aspect-ratio: 4/3;
  transform: translateY(0);
  transition: .16s ease;
}
.work img{ width:100%; height:100%; object-fit:cover; display:block; }
.work .meta{ padding:10px 2px 0; }
.work .w-title{ font-weight:900; margin:0; font-size:16px; }
.work .w-sub{ margin:6px 0 0; color: var(--muted); font-weight:800; font-size:13px; }

.work:hover .thumb{
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.10);
}

/* =========================
   MODAL (Contact)
   ========================= */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}

.modal.is-open{ display: block; }

.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}

.modal-card{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 28px));
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
}

.modal-title{
  margin:0;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-x{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  cursor: pointer;
  font-weight: 900;
}

.modal-form{
  padding: 16px;
  display: grid;
  gap: 12px;
}

.f span{
  display:block;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.f input, .f textarea{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--soft);
  color: var(--text);
  outline: none;
  font-weight: 700;
}

.f textarea{ resize: vertical; min-height: 120px; }

.modal-actions{
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

.btn.ghost{
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.form-note{
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  min-height: 18px;
}

/* Honeypot invisible */
.hp{
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* Mobile friendly */
@media (max-width: 520px){
  .modal-card{
    top: 18px;
    transform: translate(-50%, 0);
  }
}

/* SEND button hover */
.modal-form .btn:not(.ghost):hover{
  filter: brightness(1.08);
  box-shadow: 
    0 12px 28px color-mix(in oklab, var(--accent), transparent 75%);
    cursor: pointer;
}

/* Active */
.modal-form .btn:not(.ghost):active{
  transform: translateY(1px);
  box-shadow: none;
}

/* Cancel (ghost) button */
.modal-form .btn.ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}

/* Hover */
.modal-form .btn.ghost:hover{
  background: color-mix(in oklab, var(--panel), var(--accent) 8%);
  border-color: color-mix(in oklab, var(--stroke), var(--accent) 35%);
  cursor: pointer;
}

/* Active */
.modal-form .btn.ghost:active{
  transform: translateY(1px);
}

/* =========================
   SERVICES + PARTNERS
   ========================= */

.service-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
}

.svc{
  padding:16px 18px;
  border-radius:18px;
  background: var(--soft);
  border: 1px solid var(--stroke);
  display:grid;
  gap:10px;
}

.svc-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.svc-title{
  font-weight:900;
  font-size:18px;
  margin:0;
}

.svc-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.badge{
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--panel);
  font-weight:900;
  color: var(--text);
}

.badge.accent{
  background: color-mix(in oklab, var(--accent), var(--panel) 88%);
  border-color: color-mix(in oklab, var(--accent), var(--stroke) 40%);
}

.svc-desc{
  margin:0;
  color: color-mix(in oklab, var(--text), transparent 18%);
  line-height:1.75;
  font-size:15px;
}

.svc-points{
  margin:0;
  padding-left:18px;
  line-height:1.7;
  color: color-mix(in oklab, var(--text), transparent 18%);
}

.partner-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
}

.partner{
  padding:16px 18px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: var(--panel);
  display:grid;
  gap:10px;
  text-decoration:none;
  color: inherit;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.partner:hover{
  border-color: color-mix(in oklab, var(--stroke), var(--accent) 35%);
  background: color-mix(in oklab, var(--panel), var(--accent) 4%);
  transform: translateY(-1px);
}

/* ======= PARTNERS: FULL-WIDTH LOGO BANNER FIX ======= */
.partner-head{
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:stretch;
  min-width:0;
}

/* Logo as full-width banner */
.partner-logo{
  width:100%;
  height:120px;
  border-radius:16px;
  border:1px solid var(--stroke);

  /* Dark */
  background:#ffffff;

  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

/* Keep aspect ratio */
.partner-logo img{
  max-width:92%;
  max-height:72%;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
}

/* Center the text to match style */
.partner-name,
.partner-type{
  text-align:center;
}

.partner-name{
  font-weight:900;
  margin:0;
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.partner-type{
  margin:4px 0 0;
  color: var(--muted);
  font-weight:800;
  font-size:13px;
}

.partner-desc{
  margin:0;
  color: color-mix(in oklab, var(--text), transparent 18%);
  line-height:1.7;
  font-size:14px;
}

/* Light theme */
html[data-theme="light"] .partner-logo{
  background: var(--panel);
}

@media (max-width: 1100px){
  .partner-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px){
  .service-grid{ grid-template-columns: 1fr; }
  .partner-grid{ grid-template-columns: 1fr; }
  .partner-logo{ height:100px; }
}

/* =========================
   EXPERTISE (inside Services)
   ========================= */
.expertise-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
  margin-top:14px;
}

.xp{
  padding:16px 18px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: var(--panel);
  display:grid;
  gap:10px;
}

.xp-title{
  font-weight:900;
  margin:0;
  font-size:18px;
}

.xp-sub{
  margin:0;
  color: var(--muted);
  font-weight:800;
  line-height:1.6;
}

.xp-points{
  margin:0;
  padding-left:18px;
  line-height:1.7;
  color: color-mix(in oklab, var(--text), transparent 18%);
}

.xp-value{
  margin-top:6px;
  padding:10px 12px;
  border-radius:14px;
  background: var(--soft);
  border:1px solid var(--stroke);
  font-weight:900;
  color: color-mix(in oklab, var(--text), transparent 12%);
}

@media (max-width: 1100px){
  .expertise-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px){
  .expertise-grid{ grid-template-columns: 1fr; }
}

/* Contact */
.contact-min{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}
.cbox{
  padding:16px 18px;
  border:1px solid var(--stroke);
  background: var(--panel);
  border-radius:18px;
}
.cbox .c-title{ font-weight:900; margin:0; }
.cbox .c-text{ margin:8px 0 0; color: var(--muted); font-weight:800; }

/* Footer */
.footer{ padding-bottom: 8px; }


/* =========================
   LOADER OVERLAY
   ========================= */
.loader{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;

  background:
    radial-gradient(900px 500px at 30% 20%, color-mix(in oklab, var(--accent), transparent 70%), transparent 55%),
    radial-gradient(900px 500px at 70% 80%, color-mix(in oklab, var(--accent), transparent 82%), transparent 60%),
    linear-gradient(115deg, rgba(0, 0, 0, 0.95) 0 22%, transparent 22% 100%),
    var(--bg);

  transition: opacity .35s ease, visibility .35s ease;
}

.loader-center{
  width: min(520px, 92vw);
  text-align: center;
  padding: 10px 10px;
}

.loader-title{
  font-weight: 900;
  font-size: 28px;
  letter-spacing: .2px;
  margin: 16px 0 6px;
  color: var(--text);
}
.loader-title .accent{ color: var(--accent); }

.loader-sub{
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

/* Orbital animation */
.orbital{
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto;
  filter: drop-shadow(0 18px 40px color-mix(in oklab, var(--accent), transparent 80%));
}

/* Rings */
.ring{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--stroke), var(--accent) 30%);
  background: transparent;
  opacity: .9;
}

.ring.r1{ transform: scale(1.00); animation: ringPulse 1.2s ease-in-out infinite; }
.ring.r2{ transform: scale(0.72); animation: ringPulse 1.2s ease-in-out infinite .15s; }
.ring.r3{ transform: scale(0.46); animation: ringPulse 1.2s ease-in-out infinite .30s; }

@keyframes ringPulse{
  0%, 100%{ opacity: .40; }
  50%{ opacity: 1; }
}

/* Orbiting dots */
.dot{
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.dot.d1{ animation: orbit1 1.0s linear infinite; }
.dot.d2{ animation: orbit2 1.35s linear infinite; opacity: .85; }
.dot.d3{ animation: orbit3 1.75s linear infinite; opacity: .70; }

@keyframes orbit1{
  0%   { transform: translate(-50%, -50%) rotate(0deg) translateX(58px); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateX(58px); }
}
@keyframes orbit2{
  0%   { transform: translate(-50%, -50%) rotate(0deg) translateX(42px); }
  100% { transform: translate(-50%, -50%) rotate(-360deg) translateX(42px); }
}
@keyframes orbit3{
  0%   { transform: translate(-50%, -50%) rotate(0deg) translateX(26px); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translateX(26px); }
}

.loader.hide{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce){
  .ring, .dot{ animation: none !important; }
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1100px){
  .masonry{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .title{ font-size:40px; }
}

/* Una columna - Sidebar sin scroll */
@media (max-width: 980px){
  body{ overflow:auto; } 
  .app{ grid-template-columns: 1fr; height:auto; }

  .sidebar{ border-radius: 18px; }
  .side-inner{ padding: 16px; gap: 10px; }

  .main{ height: auto; }
  .content{ max-height: 78vh; } 

  .stat-row{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col{ grid-template-columns: 1fr; }
  .t-item{ grid-template-columns: 1fr; }
  .contact-min{ grid-template-columns: 1fr; }
}

/* =========================
   ALTURA BAJA
   ========================= */
@media (max-height: 760px){
  .side-inner{ padding: 16px; gap: 10px; }

  .quote{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .side-info{ gap: 8px; }
  .info-row{ padding: 8px 10px; }

  .btn{ padding: 11px 14px; }
  .social a{ width: 40px; height: 40px; }
}

@media (max-height: 640px){
  .quote{ display:none; }
}
