/* ==========================================================================
   PRISMA HABITA — Sistema visual "Plano Maestro"
   Aprobado por el Arq. José Carlos · 2026-07-15
   Raptor Marketer · HTML/CSS/JS vanilla
   ========================================================================== */

:root {
  /* Paleta */
  --ink: #0E1116;
  --ink-2: #12161C;
  --ink-3: #171C24;
  --blueprint: #9DB3C6;
  --blueprint-dim: rgba(157, 179, 198, .58);
  --chalk: #EDF1F5;
  --chalk-dim: rgba(237, 241, 245, .68);
  --brass: #C9A227;
  --brass-soft: rgba(201, 162, 39, .12);
  --line: rgba(157, 179, 198, .18);
  --wa: #25D366;

  /* Tipografía */
  --f-display: 'Archivo', system-ui, sans-serif;
  --f-mono: 'Space Mono', ui-monospace, monospace;
  --f-body: 'Inter', system-ui, sans-serif;

  /* Sistema 8px */
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem;
  --s5: 3rem; --s6: 4rem; --s7: 5rem;

  --wrap: 1240px;
  --radius: 2px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--brass); color: var(--ink); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

body {
  font-family: var(--f-body);
  background: var(--ink);
  color: var(--chalk);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Atmósfera (sin retícula — el arquitecto la rechazó) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 1100px 760px at 76% -6%, rgba(157,179,198,.10), transparent 62%),
    radial-gradient(ellipse 800px 520px at 8% 108%, rgba(201,162,39,.05), transparent 60%);
}

/* ===== EL PRISMA VIVO — se traza y deriva ===== */
.prism-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: grid; place-items: center; overflow: hidden;
}
.prism-parallax {
  transform: translate3d(0, var(--py, 0px), 0);
  display: grid; place-items: center; width: 100%; height: 100%;
}
.prism-field svg {
  width: min(148vh, 112vw); height: auto;
  color: var(--blueprint); opacity: .13;
  animation: prismDrift 52s ease-in-out infinite alternate;
  will-change: transform;
}
.prism-field [data-draw] {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: prismDraw 2.8s cubic-bezier(.22,.7,.2,1) forwards;
}
.prism-field .p-out { animation-delay: .2s; }
.prism-field .p-e1 { animation-delay: 1.4s; }
.prism-field .p-e2 { animation-delay: 1.7s; }
.prism-field .p-e3 { animation-delay: 2s; }
@keyframes prismDraw { to { stroke-dashoffset: 0; } }
@keyframes prismDrift {
  0%   { transform: translate3d(-2.4%, -1.4%, 0) rotate(-2deg) scale(1); }
  100% { transform: translate3d(2.4%, 1.4%, 0) rotate(2deg) scale(1.07); }
}

/* ===== LAYOUT ===== */
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4); position: relative; z-index: 1; }
.coord { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; color: var(--blueprint-dim); text-transform: uppercase; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brass); color: var(--ink); padding: var(--s2) var(--s3); font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Foco visible (accesibilidad) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brass); outline-offset: 3px;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(14,17,22,.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: var(--s2) 0; gap: var(--s3); }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--chalk); flex-shrink: 0; }
.brand svg { width: 30px; height: 30px; color: var(--chalk); }
.brand-word { font-family: var(--f-display); font-weight: 500; font-size: .95rem; letter-spacing: .38em; text-transform: uppercase; padding-left: .1em; white-space: nowrap; }
.nav-links { display: flex; gap: var(--s4); list-style: none; align-items: center; }
.nav-links a {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .1em;
  color: var(--chalk-dim); text-decoration: none; text-transform: uppercase; transition: color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brass); }
.nav-cta {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em;
  color: var(--ink); background: var(--brass); text-decoration: none; text-transform: uppercase;
  padding: .6rem 1.1rem; transition: box-shadow .2s; white-space: nowrap;
}
.nav-cta:hover { box-shadow: 0 0 20px rgba(201,162,39,.45); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--chalk); padding: .5rem .7rem; cursor: pointer; border-radius: var(--radius);
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ===== HERO ===== */
.hero { padding: var(--s7) 0 var(--s6); }
.hero-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s4); flex-wrap: wrap; gap: var(--s2); }
.hero-claim { font-family: var(--f-display); font-weight: 300; font-size: .88rem; letter-spacing: .5em; text-transform: uppercase; color: var(--blueprint); }
.hero-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: var(--s5); align-items: center; }
h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.08;
  letter-spacing: -.01em; margin-bottom: var(--s3);
}
h1 strong { font-weight: 600; }
h1 .thin { font-weight: 300; color: var(--blueprint); }
.hero-sub { font-size: 1.1rem; line-height: 1.7; color: var(--chalk-dim); max-width: 46ch; margin-bottom: var(--s3); font-weight: 300; }
.hero-sub strong { color: var(--chalk); font-weight: 500; }
.hero-hook {
  font-family: var(--f-mono); font-size: .82rem; color: var(--brass);
  letter-spacing: .04em; margin-bottom: var(--s4); padding-left: var(--s2);
  border-left: 2px solid var(--brass);
}
.hero-ctas { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* Prisma del hero */
.hero-prism { position: relative; display: grid; place-items: center; }
.hero-prism svg { width: 100%; max-width: 320px; color: var(--blueprint); opacity: .85; }
.hero-prism [data-draw] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: prismDraw 2.4s cubic-bezier(.22,.7,.2,1) forwards; }
.hero-prism .h-out { animation-delay: .4s; }
.hero-prism .h-e1 { animation-delay: 1.5s; }
.hero-prism .h-e2 { animation-delay: 1.75s; }
.hero-prism .h-e3 { animation-delay: 2s; }
.hero-prism .prism-label {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .2em;
  color: var(--blueprint-dim); text-transform: uppercase; white-space: nowrap;
}

/* ===== BOTONES ===== */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: .7rem; text-decoration: none;
  font-family: var(--f-display); font-size: .88rem; letter-spacing: .06em;
  padding: 1rem 1.6rem; text-transform: uppercase; transition: transform .2s, box-shadow .2s, border-color .2s, color .2s;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brass); color: var(--ink); font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(201,162,39,.3); }
.btn-ghost { background: transparent; color: var(--chalk); font-weight: 400; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brass); color: var(--brass); }

/* ===== SECCIONES ===== */
.section { padding: var(--s7) 0; border-top: 1px solid var(--line); background: rgba(14,17,22,.55); position: relative; }
.section-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-index { font-family: var(--f-mono); font-size: .8rem; font-weight: 700; color: var(--brass); letter-spacing: .1em; }
h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.6rem, 3.1vw, 2.5rem); line-height: 1.15; letter-spacing: -.01em; }
h2 strong { font-weight: 600; }
h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; letter-spacing: .01em; }
.eyebrow { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .24em; color: var(--blueprint); text-transform: uppercase; margin-bottom: .5rem; display: block; }
.lead { font-size: 1.05rem; color: var(--chalk-dim); font-weight: 300; line-height: 1.85; max-width: 68ch; }
.prose p { font-size: 1.02rem; color: var(--chalk-dim); margin-bottom: var(--s3); font-weight: 300; line-height: 1.85; max-width: 68ch; }
.prose p strong { color: var(--chalk); font-weight: 500; }
.prose ul { margin: 0 0 var(--s3) var(--s3); color: var(--chalk-dim); font-weight: 300; }
.prose li { margin-bottom: .4rem; }

/* Direct Answer (GEO / AI Overviews) */
.direct-answer {
  background: var(--brass-soft); border-left: 3px solid var(--brass);
  padding: var(--s3); margin-bottom: var(--s4);
  font-size: 1.05rem; line-height: 1.8; color: var(--chalk); font-weight: 300;
  max-width: 72ch;
}
.direct-answer strong { font-weight: 600; color: var(--chalk); }

.quote {
  font-family: var(--f-display); font-weight: 300; font-size: 1.45rem;
  line-height: 1.4; color: var(--chalk); border-left: 2px solid var(--brass);
  padding-left: var(--s3); margin: var(--s4) 0; max-width: 40ch;
}

/* ===== MÉTODO ===== */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.method-step { background: var(--ink); padding: var(--s4) 1.7rem; transition: background .3s; }
.method-step:hover { background: var(--ink-2); }
.method-step .num { font-family: var(--f-mono); font-size: .72rem; color: var(--brass); letter-spacing: .1em; margin-bottom: var(--s3); display: block; }
.method-step h3 { font-size: 1.1rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .7rem; }
.method-step p { font-size: .92rem; color: var(--chalk-dim); font-weight: 300; line-height: 1.7; }

/* ===== SERVICIOS ===== */
.serv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.serv-card {
  border: 1px solid var(--line); padding: 1.8rem; background: var(--ink-2);
  position: relative; overflow: hidden; transition: border-color .3s, transform .3s;
  text-decoration: none; color: inherit; display: block;
}
.serv-card::before { content: ""; position: absolute; top: 0; left: 0; width: 0; height: 2px; background: var(--brass); transition: width .4s ease; }
.serv-card:hover { border-color: rgba(201,162,39,.5); transform: translateY(-3px); }
.serv-card:hover::before { width: 100%; }
.serv-card .serv-ref { font-family: var(--f-mono); font-size: .66rem; color: var(--blueprint-dim); letter-spacing: .14em; margin-bottom: .9rem; display: block; }
.serv-card h3 { margin-bottom: .6rem; }
.serv-card p { font-size: .9rem; color: var(--chalk-dim); font-weight: 300; line-height: 1.65; }
.serv-card .arrow { color: var(--brass); font-family: var(--f-mono); font-size: .8rem; margin-top: var(--s2); display: inline-block; }

/* ===== PROYECTOS ===== */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.proj-card { border: 1px solid var(--line); background: var(--ink-2); overflow: hidden; transition: border-color .3s; }
.proj-card:hover { border-color: rgba(201,162,39,.45); }
.proj-thumb {
  aspect-ratio: 16/10; position: relative; display: grid; place-items: center;
  background: linear-gradient(150deg, #1C232D, #0E1116); border-bottom: 1px solid var(--line);
}
.proj-thumb .ph { font-family: var(--f-mono); font-size: .68rem; color: var(--blueprint-dim); letter-spacing: .14em; text-transform: uppercase; text-align: center; padding: var(--s2); }
.proj-thumb .tag-corner { position: absolute; top: 0; left: 0; background: var(--brass); color: var(--ink); font-family: var(--f-mono); font-size: .6rem; letter-spacing: .1em; padding: .3rem .6rem; text-transform: uppercase; }
.proj-info { padding: 1.3rem var(--s3); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.proj-info h3 { font-size: 1.1rem; }
.proj-info .meta { font-family: var(--f-mono); font-size: .66rem; color: var(--blueprint-dim); letter-spacing: .1em; text-align: right; }

/* ===== STATS ===== */
.stats-band { border: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); background: var(--line); gap: 1px; }
.stat { background: var(--ink); padding: 2.6rem var(--s3); text-align: center; }
.stat .val { font-family: var(--f-display); font-weight: 300; font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--brass); line-height: 1; margin-bottom: .6rem; }
.stat .val .u { font-size: .36em; color: var(--blueprint); }
.stat .lbl { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; color: var(--chalk-dim); text-transform: uppercase; }

/* ===== ZONAS ===== */
.zonas { display: flex; flex-wrap: wrap; gap: .7rem; }
.zona-chip { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .06em; color: var(--chalk-dim); border: 1px solid var(--line); padding: .5rem .9rem; transition: border-color .2s, color .2s; text-decoration: none; }
.zona-chip:hover { border-color: var(--brass); color: var(--brass); }

/* ===== FAQ ===== */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.4rem 0;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
  font-family: var(--f-display); font-weight: 400; font-size: 1.08rem; color: var(--chalk);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--brass); font-size: 1.3rem; transition: transform .2s; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 1.4rem; color: var(--chalk-dim); font-weight: 300; line-height: 1.8; max-width: 70ch; }

/* ===== FORMULARIO ===== */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: start; }
.cta-copy h2 { margin-bottom: var(--s3); }
.cta-copy p { color: var(--chalk-dim); font-weight: 300; margin-bottom: var(--s3); }
.wa-line { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--f-mono); font-size: .82rem; color: var(--brass); letter-spacing: .06em; }
.form-box { border: 1px solid var(--line); background: var(--ink-2); padding: var(--s4); }
.fld { margin-bottom: var(--s3); }
.fld label { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em; color: var(--blueprint); text-transform: uppercase; display: block; margin-bottom: .5rem; }
.fld input, .fld select {
  width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--chalk);
  padding: .8rem .9rem; font-family: var(--f-body); font-size: .92rem; border-radius: var(--radius);
}
.fld input:focus, .fld select:focus { outline: none; border-color: var(--brass); }
.form-submit {
  width: 100%; background: var(--brass); color: var(--ink); border: none;
  padding: 1rem; font-family: var(--f-display); font-weight: 600; font-size: .9rem;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: box-shadow .2s;
}
.form-submit:hover { box-shadow: 0 0 24px rgba(201,162,39,.45); }
.form-note { font-size: .78rem; color: var(--blueprint-dim); margin-top: var(--s2); text-align: center; }
.form-note a { color: var(--brass); }

/* ===== FOOTER ===== */
.site-footer { border-top: 1px solid var(--line); padding: var(--s5) 0 var(--s4); position: relative; z-index: 1; background: rgba(14,17,22,.7); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s4); margin-bottom: var(--s4); }
.foot-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: var(--s3); }
.foot-brand svg { width: 28px; height: 28px; color: var(--chalk); }
.foot-brand .w { font-family: var(--f-display); font-weight: 500; letter-spacing: .38em; text-transform: uppercase; font-size: .88rem; }
.foot-tag { color: var(--chalk-dim); font-weight: 300; font-size: .92rem; max-width: 34ch; }
.foot-col h4 { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .16em; color: var(--blueprint); text-transform: uppercase; margin-bottom: var(--s2); font-weight: 400; }
.foot-col a, .foot-col p { display: block; color: var(--chalk-dim); text-decoration: none; font-size: .9rem; font-weight: 300; margin-bottom: .5rem; }
.foot-col a:hover { color: var(--brass); }
.foot-bottom { border-top: 1px solid var(--line); padding-top: var(--s3); display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }

/* ===== BOTONES FLOTANTES ===== */
.float-btns { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: flex; flex-direction: column; gap: .7rem; }
.float-btn {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: transform .2s;
}
.float-btn:hover { transform: translateY(-3px) scale(1.05); }
.float-btn svg { width: 26px; height: 26px; }
.float-wa { background: var(--wa); color: #fff; }
.float-call { background: var(--brass); color: var(--ink); }

/* ===== BREADCRUMB ===== */
.breadcrumb { padding: var(--s3) 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; }
.breadcrumb a { color: var(--blueprint-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--brass); }
.breadcrumb li:not(:last-child)::after { content: " /"; color: var(--blueprint-dim); margin-left: .5rem; }
.breadcrumb [aria-current="page"] { color: var(--chalk-dim); }

/* ===== LEGAL ===== */
.legal-body h2 { font-size: 1.4rem; margin: var(--s4) 0 var(--s2); }
.legal-body h3 { font-size: 1.1rem; margin: var(--s3) 0 var(--s1); }
.legal-body p, .legal-body li { color: var(--chalk-dim); font-weight: 300; font-size: .96rem; line-height: 1.8; margin-bottom: var(--s2); }
.legal-body ul { margin-left: var(--s3); }

/* ===== 404 ===== */
.err-wrap { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.err-code { font-family: var(--f-mono); font-size: 4rem; color: var(--brass); line-height: 1; margin-bottom: var(--s2); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid { gap: var(--s4); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .hero-prism { order: -1; }
  .hero-prism svg { max-width: 200px; }
  .method-grid { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.is-open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--ink-2);
    border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4);
    gap: var(--s3); align-items: flex-start;
  }
  .nav-links.is-open a { font-size: .9rem; }
}
@media (max-width: 768px) {
  .section { padding: var(--s6) 0; }
  .hero { padding: var(--s6) 0 var(--s5); }
  .serv-grid, .proj-grid { grid-template-columns: 1fr; }
  .stats-band { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 1.4rem; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn-primary, .hero-ctas .btn-ghost { justify-content: center; }
  .brand-word { font-size: .8rem; letter-spacing: .28em; }
  .direct-answer { font-size: .98rem; padding: var(--s2); }
  .quote { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1.1rem; }
  h1 { font-size: clamp(1.7rem, 7.6vw, 2.2rem); }
  .brand svg { width: 26px; height: 26px; }
  .brand-word { font-size: .7rem; letter-spacing: .22em; }
  .nav-cta { font-size: .64rem; padding: .5rem .8rem; letter-spacing: .08em; }
  .hero-claim { font-size: .72rem; letter-spacing: .34em; }
  .float-btn { width: 48px; height: 48px; }
  .float-btn svg { width: 22px; height: 22px; }
  .section-head { gap: var(--s2); }
}

/* ===== ACCESIBILIDAD: movimiento reducido ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .prism-field svg { animation: none; }
  .prism-field [data-draw], .hero-prism [data-draw] { animation: none; stroke-dashoffset: 0; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
