/* ============================================================
   PACO CUEVAS — DESIGN SYSTEM
   Tokens, components, utilities compartidos entre todas las páginas
   frontend-design skill: grain texture, focus-fade, cursor, depth FX
   ============================================================ */

/* === GRAIN TEXTURE OVERLAY — depth & atmosphere === */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}

/* === CUSTOM CURSOR === */
@media (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }
  #cursor {
    position: fixed; top: 0; left: 0;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--emerald);
    pointer-events: none; z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform .08s, width .2s, height .2s, background .2s, opacity .3s;
    will-change: transform;
  }
  #cursor-ring {
    position: fixed; top: 0; left: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,159,125,0.55);
    pointer-events: none; z-index: 99998;
    transform: translate(-50%, -50%);
    transition: transform .18s ease-out, width .3s, height .3s, border-color .2s, opacity .3s;
    will-change: transform;
  }
  body.cursor-hover #cursor {
    width: 16px; height: 16px;
    background-image: var(--grad-g1);
    background-color: transparent;
  }
  body.cursor-hover #cursor-ring {
    width: 52px; height: 52px;
    border-color: rgba(0,159,125,0.35);
  }
  body.cursor-cta #cursor {
    width: 22px; height: 22px;
    background-image: var(--grad-g1);
    background-color: transparent;
    box-shadow: 0 0 14px 4px rgba(0,159,125,.65), 0 0 30px 8px rgba(255,210,58,.22);
  }
  body.cursor-cta #cursor-ring {
    width: 62px; height: 62px;
    border-color: rgba(0,159,125,.50);
    box-shadow: 0 0 18px 4px rgba(0,159,125,.22);
  }
}

/* === TOKENS === */
:root {
  --ink:     #002C2B;
  --forest:  #004F4C;
  --emerald: #009F7D;
  --signal:  #FFD23A;
  --paper:   #FFFBF0;
  --sand:    #F2E9D0;
  --flare:   #FF6F61;

  --ink-card:    #053A36;
  --ink-card-2:  #07433F;
  --forest-card: #0A5754;
  --paper-card:  #FFFFFF;

  --grad-g1: linear-gradient(95deg, #009F7D 0%, #FFD23A 100%);
  --grad-g2: linear-gradient(95deg, #004F4C 0%, #00C896 100%);
  --glow-g1: 0 0 0 1px rgba(0,159,125,.20), 0 4px 24px -4px rgba(0,159,125,.45);
  --glow-g2: 0 0 0 1px rgba(0,79,76,.20), 0 4px 24px -4px rgba(0,79,76,.35);

  --glass-base:    #053A36;
  --glass-overlay: linear-gradient(165deg, rgba(0,200,160,.10) 0%, rgba(0,200,160,0) 38%, rgba(0,0,0,.08) 100%);
  --glass-border:  rgba(0,159,125,.22);
  --glass-inset:   inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px rgba(0,159,125,.04);
  --glass-shadow:  0 1px 0 rgba(0,0,0,.25), 0 28px 56px -32px rgba(0,0,0,.55);

  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   18px;
  --r-xl:   22px;
  --r-pill: 999px;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, video { max-width: 100%; display: block; }
a { text-decoration: none; }

/* === BASE === */
body {
  font-family: var(--font-body);
  background: var(--forest);
  color: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === CONTAINER === */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === SECTIONS — BLUEPRINT GRID + VIGNETTE === */
section { position: relative; }

section::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,159,125,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,159,125,0.10) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none; z-index: 0;
}
section::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 20%, rgba(0,22,21,0.36) 100%);
  pointer-events: none; z-index: 0;
}
section > * { position: relative; z-index: 1; }

.section--light::before,
.section--sand::before {
  background-image:
    linear-gradient(rgba(0,79,76,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,79,76,0.14) 1px, transparent 1px);
  background-size: 44px 44px;
}
.section--light::after,
.section--sand::after {
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 20%, rgba(0,44,43,0.09) 100%);
}

.section--ink    { background: var(--ink);    color: var(--paper); }
.section--forest { background: var(--forest); color: var(--paper); }
.section--light  { background: var(--paper);  color: var(--ink);   }
.section--sand   { background: var(--sand);   color: var(--ink);   }

/* === NAV === */
#mainNav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; height: 68px;
  display: flex; align-items: center;
  transition: background .3s, box-shadow .3s;
}
#mainNav.scrolled {
  background: rgba(5,58,54,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,159,125,0.18), 0 4px 24px -8px rgba(0,0,0,0.35);
}

.nav-inner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 24px;
}
.nav-logo { flex-shrink: 0; }
.nav-logo img { height: 30px; width: auto; display: block; }

.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 44px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,251,240,0.72);
  transition: color .2s;
}
.nav-links a:hover { color: var(--paper); }

.nav-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* === BUTTON GLOW ANIMATIONS === */
@keyframes btn-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(0,159,125,.20), 0 4px 24px -4px rgba(0,159,125,.45);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(0,159,125,.35), 0 4px 44px 0px rgba(0,159,125,.80), 0 0 28px -4px rgba(255,210,58,.50);
  }
}
@keyframes btn-secondary-pulse {
  0%, 100% {
    box-shadow: none;
    border-color: var(--emerald);
  }
  50% {
    box-shadow: 0 0 20px -4px rgba(0,159,125,.60), inset 0 0 14px -8px rgba(0,159,125,.18);
    border-color: rgba(0,159,125,.9);
  }
}
@keyframes status-text-glow {
  0%, 100% { color: rgba(255,251,240,0.42); text-shadow: none; }
  50% { color: rgba(0,159,125,.90); text-shadow: 0 0 14px rgba(0,159,125,.55); }
}

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  border-radius: var(--r-pill); cursor: pointer;
  transition: transform .12s, filter .2s, background .2s;
  border: 0; position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background-image: var(--grad-g1);
  color: var(--ink);
  box-shadow: var(--glow-g1);
  padding: 14px 28px; font-size: 12px;
  animation: btn-pulse-glow 3s ease-in-out infinite;
}
.btn-primary::after {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40);
  pointer-events: none;
}
.btn-primary:hover { filter: brightness(1.06); animation-play-state: paused; }
.btn-primary--sm { padding: 10px 22px; font-size: 11px; }

.btn-secondary {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid var(--emerald);
  padding: 14px 28px; font-size: 12px;
  animation: btn-secondary-pulse 3s ease-in-out infinite;
}
.btn-secondary:hover { background: rgba(0,159,125,.10); animation-play-state: paused; }

.btn-ghost {
  background: transparent;
  color: rgba(255,251,240,0.72);
  padding: 14px 18px; font-size: 12px;
}
.btn-ghost:hover { color: var(--paper); }

/* === EYEBROW + RULE === */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--emerald);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald); flex-shrink: 0;
}
.eyebrow--dark { color: var(--ink); }
.eyebrow--dark::before { background: var(--ink); }

.rule-yellow {
  width: 60px; height: 3px;
  background: var(--signal);
  border: 0; margin: 16px 0 0;
}

/* === TEXT GRADIENT === */
.text-grad {
  background-image: var(--grad-g1);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-grad-light {
  background-image: var(--grad-g2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* === GLASS CARD === */
@property --c-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes card-border-spin {
  to { --c-angle: 360deg; }
}

.glass-card {
  background-color: var(--glass-base);
  background-image: var(--glass-overlay);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inset), var(--glass-shadow);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease;
}
.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-inset), 0 2px 0 rgba(0,0,0,.28), 0 36px 72px -28px rgba(0,0,0,.65);
}
.glass-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, rgba(0,200,160,.40), rgba(0,200,160,0) 60%);
  z-index: 1;
}
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--c-angle),
    rgba(0,159,125,0)    0%,
    rgba(0,159,125,.55) 18%,
    rgba(255,210,58,.42) 42%,
    rgba(0,159,125,.55) 68%,
    rgba(0,159,125,0)  100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  animation: card-border-spin 9s linear infinite;
  animation-play-state: paused;
  z-index: 2;
}
.glass-card:hover::after {
  opacity: 1;
  animation-play-state: running;
}
.glass-card.light {
  background-color: #FFFFFF;
  background-image: linear-gradient(180deg, rgba(0,79,76,.025), rgba(0,79,76,0) 40%);
  border: 1px solid rgba(0,79,76,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.80), 0 1px 0 rgba(0,79,76,.04), 0 8px 24px -16px rgba(0,79,76,.18);
  color: var(--ink);
}
.glass-card.light::before { background: none; }
.glass-card.light::after {
  background: conic-gradient(
    from var(--c-angle),
    rgba(0,79,76,0)    0%,
    rgba(0,79,76,.40) 18%,
    rgba(0,159,125,.30) 42%,
    rgba(0,79,76,.40) 68%,
    rgba(0,79,76,0)   100%
  );
}

/* === BADGE === */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--r-pill);
}
.badge--emerald {
  background: rgba(0,159,125,.15);
  color: var(--emerald);
  border: 1px solid rgba(0,159,125,.40);
}
.badge--gradient { background-image: var(--grad-g1); color: var(--ink); }
.badge--flare    { background: var(--flare); color: var(--paper); }

/* === SECTION HEADER === */
.section-header { margin-bottom: 72px; }
.section-header--center { text-align: center; }
.section-header--center .rule-yellow { margin: 16px auto 0; }

.section-title {
  font-family: var(--font-sans);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600; letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 20px 0 16px; line-height: 1.1;
}
.section-lead {
  font-size: clamp(15px, 1.8vw, 17px);
  color: rgba(255,251,240,0.65);
  line-height: 1.7;
}
.section-lead--dark { color: rgba(0,44,43,0.65); }

/* === REVEAL === */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 400ms ease-out, transform 400ms ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* === STATUS DOT === */
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
  position: absolute; bottom: 36px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0.5;
}
.scroll-line {
  width: 1px; height: 44px;
  background: rgba(255,251,240,0.25);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: "";
  position: absolute; top: -44px; left: 0;
  width: 1px; height: 44px;
  background: var(--emerald);
  animation: scroll-pulse 2s cubic-bezier(0.45,0,0.55,1) infinite;
}
@keyframes scroll-pulse {
  0%   { top: -44px; opacity: 1; }
  100% { top: 44px;  opacity: 0; }
}

/* === MOBILE NAV === */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--paper);
  transition: transform .3s, opacity .3s;
}
.mobile-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: var(--ink);
  flex-direction: column;
  align-items: center; justify-content: center; gap: 36px;
}
.mobile-overlay.open { display: flex; }
.mobile-overlay a {
  font-family: var(--font-sans);
  font-size: 22px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--paper); transition: color .2s;
}
.mobile-overlay a:hover { color: var(--emerald); }
.mobile-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none;
  color: var(--paper); cursor: pointer;
  font-size: 28px; line-height: 1;
}

/* === BROWSER MOCKUP === */
.browser-mockup {
  border-radius: 10px; overflow: hidden;
  background: #0f1a19;
  box-shadow: 0 2px 0 rgba(255,255,255,0.04),
              0 40px 100px -24px rgba(0,0,0,.70);
}
.browser-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #1c2b29;
  border-bottom: 1px solid rgba(0,159,125,0.12);
}
.browser-dots { display: flex; gap: 6px; }
.browser-dot { width: 10px; height: 10px; border-radius: 50%; }
.browser-dot.red    { background: #FF5F57; }
.browser-dot.yellow { background: #FEBC2E; }
.browser-dot.green  { background: #28C840; }
.browser-url-bar {
  flex: 1; background: #0f1a19;
  border-radius: 6px; padding: 5px 12px;
  display: flex; align-items: center; gap: 6px;
}
.browser-lock { color: rgba(255,251,240,0.35); font-size: 10px; }
.browser-url {
  font-family: var(--font-body); font-size: 12px;
  color: rgba(255,251,240,0.45);
}
.browser-screen {
  aspect-ratio: 16 / 9.5;
  overflow: hidden;
  position: relative;
}
.browser-screen img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.browser-screen-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,22,21,0.3) 100%);
}

/* === FOOTER === */
footer {
  background: var(--ink);
  border-top: 1px solid rgba(0,159,125,0.18);
  padding: 48px 0 32px;
}
footer::before { background-image: none !important; }
footer::after  { background: none !important; }

.footer-inner { display: flex; flex-direction: column; gap: 32px; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
}
.footer-logo img { height: 28px; width: auto; }
.footer-nav { display: flex; gap: 28px; list-style: none; }
.footer-nav a {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,251,240,0.42); transition: color .2s;
}
.footer-nav a:hover { color: var(--paper); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255,251,240,0.06);
}
.footer-copy { font-size: 13px; color: rgba(255,251,240,0.35); }
.status-indicator {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,251,240,0.42);
  animation: status-text-glow 3.5s ease-in-out infinite;
}

/* === BACK LINK === */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,251,240,0.55);
  transition: color .2s, gap .2s;
}
.back-link:hover { color: var(--emerald); gap: 4px; }
.back-link svg { flex-shrink: 0; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .section-header { margin-bottom: 48px; }
}
@media (max-width: 640px) {
  .nav-links        { display: none; }
  .hamburger        { display: flex; }
  .footer-top       { flex-direction: column; gap: 24px; text-align: center; }
  .footer-nav       { flex-wrap: wrap; justify-content: center; }
  .footer-bottom    { flex-direction: column; gap: 12px; text-align: center; }
}
