/* ==================================================================
   SubliSeba — hoja de estilos del sitio público
   CSS3 puro, sin frameworks ni dependencias externas.
   Orden: tokens → base → layout → componentes → galería → lightbox
   ================================================================== */

/* ------------------------------ TOKENS ------------------------------ */
:root {
  --brand:        #7c3aed;
  --brand-dark:   #5b21b6;
  --brand-soft:   #f3eeff;
  --accent:       #f59e0b;

  --ink:          #17161d;
  --ink-soft:     #4a4857;
  --muted:        #6b6979;

  --bg:           #ffffff;
  --surface:      #f7f6fa;
  --surface-2:    #efedf5;
  --line:         #e3e0ec;

  --wa:           #1f9d55;
  --wa-dark:      #177a41;
  --danger:       #b42318;

  --radius:       14px;
  --radius-lg:    22px;
  --shadow-sm:    0 1px 2px rgba(23,22,29,.06), 0 2px 8px rgba(23,22,29,.05);
  --shadow-md:    0 6px 24px rgba(23,22,29,.10);
  --shadow-lg:    0 20px 50px rgba(23,22,29,.18);

  --wrap:         1120px;
  --gap:          clamp(16px, 3vw, 28px);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-soft: #241b3d;
    --ink:        #f2f0f7;
    --ink-soft:   #c9c5d6;
    --muted:      #a29fb2;
    --bg:         #131218;
    --surface:    #1a1922;
    --surface-2:  #23212d;
    --line:       #302e3c;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.4);
    --shadow-md:  0 6px 24px rgba(0,0,0,.45);
    --shadow-lg:  0 20px 50px rgba(0,0,0,.6);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.25rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 1em; }

a { color: var(--brand); }

/* Foco visible y consistente en todo el sitio (accesibilidad). */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}

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

/* ------------------------------ BOTONES ------------------------------ */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;              /* cómodo para el dedo en Android */
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn:hover { box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }

.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; }
.btn-primary:hover { background: var(--brand-dark); }

.btn-wa { --btn-bg: var(--wa); --btn-fg: #fff; }
.btn-wa:hover { background: var(--wa-dark); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--line);
}

.btn-sm { min-height: 42px; padding: 9px 16px; font-size: .92rem; }
.btn-lg { min-height: 56px; padding: 15px 30px; font-size: 1.05rem; }

/* Estado deshabilitado: se usa cuando falta el número de WhatsApp. */
.btn[aria-disabled="true"] {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.btn[aria-disabled="true"]:active { transform: none; }

.ico-wa { flex: none; }

/* ------------------------------ HEADER ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(4px)) {
  .site-header { background: var(--bg); }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
}
.brand-mark { display: flex; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -.02em; }
.brand-text small { font-size: .74rem; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 20px; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}
.nav-list a:hover { background: var(--surface); color: var(--ink); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px clamp(16px, 4vw, 28px) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 14px; font-size: 1.05rem; }
}

/* ------------------------------ HERO ------------------------------ */
.hero {
  padding: clamp(36px, 7vw, 76px) 0 clamp(30px, 6vw, 64px);
  background:
    radial-gradient(900px 420px at 12% -10%, var(--brand-soft), transparent 62%),
    radial-gradient(700px 380px at 96% 8%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) {
  .eyebrow { color: #d3bffd; }
}

.hero-sub {
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.9vw, 1.16rem);
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 22px;
}

.hero-points { display: grid; gap: 8px; color: var(--ink-soft); font-size: .95rem; }
.hero-points li { position: relative; padding-left: 26px; }
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 14px; height: 8px;
  border-left: 2.4px solid var(--brand);
  border-bottom: 2.4px solid var(--brand);
  transform: rotate(-45deg);
}

.hero-art { position: relative; display: grid; place-items: center; }
.hero-art img { width: 100%; max-width: 460px; }
.hero-blob {
  position: absolute;
  inset: 8% 6%;
  border-radius: 46% 54% 58% 42% / 46% 42% 58% 54%;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 22%, transparent),
    color-mix(in srgb, var(--accent) 22%, transparent));
  filter: blur(26px);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 340px; margin-inline: auto; }
}

/* ------------------------------ SECCIONES ------------------------------ */
.section { padding: clamp(44px, 7vw, 84px) 0; }
.section-alt { background: var(--surface); }

.section-head { max-width: 62ch; margin: 0 auto clamp(26px, 4vw, 44px); text-align: center; }
.section-head-left { margin-inline: 0; text-align: left; }
.section-sub { margin: 0; color: var(--muted); font-size: 1.03rem; }

.nota {
  margin: clamp(24px, 4vw, 36px) auto 0;
  max-width: 70ch;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .96rem;
}
.section-alt .nota { background: var(--bg); }

/* ------------------------------ TARJETAS DE PRODUCTO ------------------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-icon {
  width: 52px; height: 52px;
  margin-bottom: 14px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
@media (prefers-color-scheme: dark) { .card-icon { color: #cbb2ff; } }

.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .95rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.card-count { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* ------------------------------ FILTROS ------------------------------ */
.filtros {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: clamp(18px, 3vw, 26px);
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}
@media (max-width: 720px) { .filtros { justify-content: flex-start; } }

.filtro {
  flex: none;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  font-size: .93rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.filtro:hover { border-color: var(--brand); color: var(--brand); }
.filtro[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.filtro-num { opacity: .7; font-weight: 500; }

/* ------------------------------ GALERÍA ------------------------------ */
.galeria-estado {
  margin: 0 0 18px;
  text-align: center;
  color: var(--muted);
}
.galeria-estado:empty { display: none; }

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: clamp(12px, 2.2vw, 20px);
}
@media (max-width: 420px) {
  .galeria { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.trabajo { animation: aparecer .32s ease both; }
@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.trabajo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .18s ease;
}
.trabajo-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.trabajo-img {
  position: relative;
  aspect-ratio: 1 / 1;      /* evita saltos de layout (CLS) */
  background: var(--surface-2);
  overflow: hidden;
}
.trabajo-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.trabajo-btn:hover .trabajo-img img { transform: scale(1.04); }

.badge-demo {
  position: absolute;
  top: 8px; left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(23,22,29,.78);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.trabajo-info { padding: 12px 14px 14px; }
.trabajo-cat {
  margin: 0 0 3px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand);
}
.trabajo-titulo { margin: 0 0 3px; font-size: .98rem; font-weight: 700; }
.trabajo-desc {
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.galeria-vacia {
  grid-column: 1 / -1;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}

/* ------------------------------ CONTACTO ------------------------------ */
.contacto-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 860px) { .contacto-inner { grid-template-columns: 1fr; } }

.contacto-datos { display: grid; gap: 10px; margin-top: 22px; }
.contacto-datos li { display: flex; gap: 10px; color: var(--ink-soft); }
.contacto-datos a { color: var(--ink-soft); }
.contacto-datos .dato-label { font-weight: 700; color: var(--ink); }

.contacto-aside {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.pasos { display: grid; gap: 14px; counter-reset: paso; }
.pasos li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); font-size: .95rem; }
.pasos span {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
}

/* ------------------------------ FOOTER ------------------------------ */
.site-footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-inner { display: grid; gap: 6px; text-align: center; }
.footer-inner p { margin: 0; }
.footer-cats { color: var(--muted); font-size: .9rem; }
.footer-legal { color: var(--muted); font-size: .82rem; }

/* ------------------------------ LIGHTBOX ------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 32px);
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 14, .86);
  backdrop-filter: blur(3px);
  animation: fundido .18s ease both;
}
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(4px, 1.5vw, 14px);
  width: 100%;
  max-width: 1000px;
  animation: emerger .22s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes emerger {
  from { opacity: 0; transform: scale(.97) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.lightbox-figure {
  margin: 0;
  display: grid;
  gap: 0;
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 40px);
  grid-template-rows: minmax(0, 1fr) auto;
}
.lightbox-figure img {
  width: 100%;
  max-height: min(66vh, 620px);
  object-fit: contain;
  background: var(--surface-2);
}

.lightbox-caption { padding: 16px clamp(16px, 3vw, 24px) 20px; overflow-y: auto; }
.lb-cat {
  margin: 0 0 2px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand);
}
.lb-titulo { margin: 0 0 6px; font-size: 1.2rem; }
.lb-desc { margin: 0 0 10px; color: var(--ink-soft); font-size: .95rem; }
.lb-meta { margin: 0 0 12px; color: var(--muted); font-size: .82rem; }

.lb-btn {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-btn:disabled { opacity: .3; cursor: default; }

.lb-close {
  position: absolute;
  top: -6px; right: -6px;
  z-index: 2;
  width: 46px; height: 46px;
  background: rgba(10,9,14,.72);
}

@media (max-width: 760px) {
  .lightbox { padding: 0; }
  .lightbox-panel {
    grid-template-columns: 1fr;
    max-width: none;
    height: 100%;
    align-content: center;
  }
  .lightbox-figure { border-radius: 0; max-height: 100vh; }
  .lightbox-figure img { max-height: 58vh; }
  .lb-prev, .lb-next {
    position: absolute;
    top: 28vh;
    z-index: 2;
    background: rgba(10,9,14,.6);
  }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: 12px; right: 12px; }
}

/* ------------------------------ MOVIMIENTO REDUCIDO ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
