/* =============================================================
   Surfside · escaparate de demos
   ============================================================= */
:root {
  --bg: #0a0e13;
  --bg-2: #10161e;
  --card: #121a24;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #eaf1f5;
  --ink-2: #9fb2bf;
  --ink-mut: #61727f;
  --aqua: #38d0c8;
  --blue: #4a8dff;
  --grad: linear-gradient(115deg, #38d0c8, #4a8dff);
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.1rem, 4vw, 3rem);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, svg, iframe { display: block; border: 0; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }
::selection { background: var(--aqua); color: #04121a; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 6px; }

/* Fondo */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 90%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 90%);
}
.bg-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%); z-index: -2; pointer-events: none;
  width: 90vw; height: 60vh;
  background: radial-gradient(50% 50% at 50% 50%, rgba(56,208,200,.16), transparent 70%), radial-gradient(40% 40% at 70% 30%, rgba(74,141,255,.14), transparent 70%);
  filter: blur(30px);
}

/* Cabecera */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem var(--gutter); max-width: 1200px; margin-inline: auto;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; }
.brand .dim { color: var(--ink-mut); font-weight: 500; }
.head-cta {
  font-size: 0.9rem; font-weight: 500; color: var(--ink-2);
  padding: 0.5rem 1rem; border: 1px solid var(--line-2); border-radius: 999px;
  transition: border-color 0.25s, color 0.25s;
}
.head-cta:hover { border-color: var(--aqua); color: var(--ink); }

/* Intro */
main { max-width: 1200px; margin-inline: auto; padding: 0 var(--gutter) 4rem; }
.intro { padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); max-width: 22ch; max-width: min(46rem, 100%); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--aqua); margin-bottom: 1.4rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 0 rgba(56,208,200,.6); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(56,208,200,.5); } 70% { box-shadow: 0 0 0 10px rgba(56,208,200,0); } 100% { box-shadow: 0 0 0 0 rgba(56,208,200,0); } }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.3rem); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin-top: 1.3rem; font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--ink-2); max-width: 52ch; }

/* Rejilla de demos */
.demos { display: grid; gap: clamp(1.2rem, 3vw, 1.8rem); grid-template-columns: 1fr; }
.demo {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: 20px; overflow: clip;
  display: grid; grid-template-rows: auto 1fr;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s var(--ease);
}
.demo:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: 0 26px 60px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(56,208,200,0.12); }

/* Previsualización con marco de navegador */
.demo-preview { position: relative; display: block; }
.frame { background: #0c1219; }
.frame-bar {
  display: flex; align-items: center; gap: 6px; padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line); background: #0e151d;
}
.frame-bar span { width: 10px; height: 10px; border-radius: 50%; background: #2b3742; }
.frame-bar span:nth-child(1) { background: #ff6058; } .frame-bar span:nth-child(2) { background: #ffbe2f; } .frame-bar span:nth-child(3) { background: #2aca44; }
.frame-bar em { margin-left: 0.6rem; font-style: normal; font-size: 0.74rem; color: var(--ink-mut); font-family: var(--display); letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-view { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0c1219; }
.frame-view iframe {
  position: absolute; top: 0; left: 0;
  width: 1280px; height: 800px; transform-origin: top left;
  transform: scale(var(--scale, 0.3));
  pointer-events: none; background: #fff;
}
.demo-preview::after { /* velo para clic + realce hover */
  content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(10,14,19,0.25));
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.demo-preview:hover::after { opacity: 1; }
.open-tag {
  position: absolute; right: 0.8rem; bottom: 0.8rem;
  font-family: var(--display); font-size: 0.8rem; font-weight: 600; color: #04121a;
  background: var(--aqua); padding: 0.35rem 0.7rem; border-radius: 8px;
  opacity: 0; transform: translateY(6px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.demo-preview:hover .open-tag { opacity: 1; transform: translateY(0); }

/* Cuerpo de la tarjeta */
.demo-body { padding: 1.3rem 1.4rem 1.5rem; display: grid; align-content: start; gap: 0.55rem; }
.demo-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.2rem; }
.tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; padding: 0.2rem 0.6rem; border-radius: 6px;
  background: rgba(56,208,200,0.12); color: var(--aqua); border: 1px solid rgba(56,208,200,0.2);
}
.tag.alt { background: rgba(255,255,255,0.05); color: var(--ink-2); border-color: var(--line); }
.demo-body h2 { font-size: 1.3rem; }
.demo-body p { color: var(--ink-2); font-size: 0.95rem; }
.demo-body strong { color: var(--ink); font-weight: 600; }
.demo-links { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--display); font-weight: 600; font-size: 0.92rem;
  padding: 0.65rem 1.1rem; border-radius: 10px;
  background: var(--grad); color: #04121a;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn span { transition: transform 0.25s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(56,208,200,0.5); }
.btn:hover span { transform: translate(2px, -2px); }

/* Pie */
.site-foot {
  max-width: 1200px; margin-inline: auto; padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  justify-content: space-between; align-items: center; color: var(--ink-mut); font-size: 0.85rem;
}
.foot-note a { color: var(--ink-2); }
.foot-note a:hover { color: var(--aqua); }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--r, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Responsive */
@media (min-width: 720px) { .demos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .demos { grid-template-columns: repeat(3, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; }
}
