/**
 * Mundo "Obra y plano" — romerodevs.net
 * Se carga DESPUÉS de styles.css y pro.css en todas las páginas.
 * Papel de plano, tinta azul marino, naranja de seguridad como única señal.
 *
 * Contrastes sobre papel #f3efe4: tinta #10213a = 14.6:1, texto suave #44546c = 6.7:1,
 * naranja #c2410c = 4.9:1, texto blanco sobre naranja = 5.2:1.
 */

:root,
:root[data-theme="light"] {
    --bg-0: #f3efe4;
    --bg-1: #fbf9f3;
    --bg-2: #e8e3d3;
    --line: #cdc6b1;
    --ink-0: #10213a;
    --ink-1: #44546c;
    --navy: #1d4ed8;
    --navy-2: #1e40af;
    --navy-fill: #10213a;
    --navy-fill-2: #1b3358;
    --navy-soft: rgba(29, 78, 216, 0.08);
    --accent: #c2410c;
    --signal: #c2410c;
    --signal-2: #9a3412;
    --on-accent: #ffffff;
    --scrim: #f3efe4;
    --font-sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
    --font-heading: "Bricolage Grotesque", "Schibsted Grotesk", system-ui, sans-serif;
    --font-display: var(--font-heading);
    --radius-card: 6px;
    --o-max: 1180px;
    color-scheme: light;
}

body.site-shell,
:root[data-theme="light"] body.site-shell {
    color: var(--ink-0);
    background-color: var(--bg-0);
    background-image:
        linear-gradient(to right, rgba(16, 33, 58, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 33, 58, 0.045) 1px, transparent 1px);
    background-size: 36px 36px;
}
h1, h2, h3, .brand { font-family: var(--font-heading); }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ---- Componentes compartidos ---- */
.topbar { background: rgba(243, 239, 228, 0.96); border-bottom: 1px solid var(--ink-0); }
.top-nav a, .nav-dropdown-trigger { color: var(--ink-0); }
.top-nav a:hover, .nav-dropdown-trigger:hover { color: var(--signal); }
.pill-link { border-radius: 4px !important; border: 1.5px solid var(--ink-0) !important; color: var(--ink-0) !important; background: transparent !important; }
.pill-link:hover { background: var(--ink-0) !important; color: var(--bg-0) !important; }
.nav-dropdown-menu { background: var(--bg-1); border: 1px solid var(--ink-0); border-radius: 6px; box-shadow: 6px 6px 0 rgba(16, 33, 58, 0.12); }

.btn-solid, .btn-ghost { border-radius: 4px; font-weight: 600; transition: background 0.2s, color 0.2s, border-color 0.2s, translate 0.2s; }
.btn-solid { background: var(--signal); color: #fff; border: 1.5px solid var(--signal); }
.btn-solid:hover { background: var(--signal-2); border-color: var(--signal-2); color: #fff; translate: 0 -2px; }
.btn-ghost { background: transparent; color: var(--ink-0); border: 1.5px solid var(--ink-0); }
.btn-ghost:hover { background: var(--ink-0); color: var(--bg-0); border-color: var(--ink-0); translate: 0 -2px; }

.compact-card, .product-card { background: var(--bg-1) !important; border: 1px solid var(--line); border-radius: var(--radius-card) !important; }
.compact-card:hover, .product-card:hover { border-color: var(--ink-0) !important; }
.hero-corp { background: transparent; border-bottom: 1px solid var(--line); }
.final-cta { background: var(--ink-0) !important; color: var(--bg-0); border-top: 0; }
.final-cta h2, .final-cta p { color: var(--bg-0); }
.footer-section { background: var(--ink-0); color: var(--bg-0); border-top: 0; }
.footer-section a, .footer-section p, .footer-section li, .footer-section h3, .footer-section h4 { color: #cfd6e2; }
.footer-section a:hover { color: #fff; }
.card-icon { color: var(--signal); }
.chatbot-toggle { background: var(--signal); color: #fff; }
.chatbot-toggle:hover { background: var(--signal-2); color: #fff; }

/* ---- Progreso de lectura ---- */
.obra-progress {
    position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120;
    background: var(--signal); transform-origin: 0 50%; transform: scaleX(0);
    pointer-events: none;
}

/* ---- Estructura ---- */
.o-wrap { max-width: var(--o-max); margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 1024px) { .o-wrap { padding: 0 2rem; } }
.o-section { padding: clamp(4.5rem, 10vw, 8rem) 0 0; }
.o-head { max-width: 62ch; }
.o-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 1rem; text-wrap: balance; }
.o-head .intro { font-size: 1.125rem; color: var(--ink-1); margin: 0; max-width: 56ch; }
.o-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---- Revelados ---- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---- Hero ---- */
.o-hero { padding: clamp(2.5rem, 6vw, 5rem) 0 0; overflow: clip; }
.o-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 2rem; align-items: center; min-height: min(78vh, 680px); }
.o-hero h1 { font-size: clamp(2.5rem, 5.8vw, 4.9rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 1.4rem; text-wrap: balance; }
.o-hero .mark { background: linear-gradient(transparent 64%, rgba(194, 65, 12, 0.3) 0) no-repeat left / 0% 100%; animation: marcar 0.9s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes marcar { to { background-size: 100% 100%; } }
.o-hero .lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--ink-1); max-width: 50ch; margin: 0; }
.o-hero-copy > * { animation: subir 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.o-hero-copy .lede { animation-delay: 0.12s; }
.o-hero-copy .o-actions { animation-delay: 0.24s; }
@keyframes subir { from { opacity: 0; transform: translateY(22px); } }

.o-hero-art { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 560px; justify-self: end; }
.o-hero-art .layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.o-hero-art path, .o-hero-art rect, .o-hero-art circle { fill: none; stroke: var(--ink-0); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.o-hero-art .sun { fill: rgba(194, 65, 12, 0.14); stroke: var(--signal); }
.o-hero-art .sun-ring { stroke: var(--signal); stroke-dasharray: 3 8; opacity: 0.6; }
.o-hero-art .skyline { stroke: var(--ink-1); stroke-width: 1.5; stroke-dasharray: 5 6; fill: rgba(16, 33, 58, 0.04); }
.o-hero-art .crane path { stroke-width: 1.8; }
.o-hero-art .cable { stroke: var(--ink-0); stroke-width: 1.2; }
.o-hero-art .load { fill: var(--signal); stroke: var(--ink-0); }
.o-hero-art .crane { animation: balanceo 6s ease-in-out infinite; transform-origin: 454px 64px; }
.o-hero-art .load, .o-hero-art .cable { animation: carga 5s ease-in-out infinite; }
@keyframes balanceo { 50% { transform: rotate(0.6deg); } }
@keyframes carga { 50% { translate: 0 12px; } }
.o-hero-art .frame path { stroke-width: 3; }
.o-hero-art .frame .slab { stroke-width: 6; }
.o-hero-art .frame .todo { stroke-dasharray: 8 7; stroke-width: 2; opacity: 0.55; }
.o-hero-art .frame .brace { stroke-width: 1.5; opacity: 0.7; }
.o-hero-art .tag path { stroke-width: 1.2; }
.o-hero-art .tag text { fill: var(--ink-1); stroke: none; font: 500 13px var(--font-code); }

.o-facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1.5px solid var(--ink-0); margin-top: clamp(1rem, 3vw, 2rem); }
.o-facts > div { padding: 1.4rem 1.5rem 1.4rem 0; font-size: 0.9375rem; color: var(--ink-1); }
.o-facts > div + div { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.o-facts strong { display: block; font: 700 1.125rem var(--font-heading); color: var(--ink-0); margin-bottom: 0.2rem; }

/* ---- Roles ---- */
.o-roles { margin-top: 3rem; border-top: 1.5px solid var(--ink-0); }
.o-roles-head, .o-role { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 2.5rem; }
.o-roles-head { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font: 500 0.8125rem var(--font-code); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-1); }
.o-role { padding: 2rem 0; border-bottom: 1px solid var(--line); transition: background 0.3s, padding 0.3s; }
.o-role h3 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.o-role h3 small { display: block; margin-top: 0.4rem; font: 500 0.875rem var(--font-code); color: var(--signal); letter-spacing: 0; }
.o-role p { margin: 0; color: var(--ink-1); }
.o-role p b { display: block; color: var(--ink-0); font-weight: 600; margin-bottom: 0.2rem; }
.o-role.is-key { background: var(--ink-0); margin: 0 -1.5rem; padding: 2rem 1.5rem; border-bottom-color: var(--ink-0); }
.o-role.is-key h3, .o-role.is-key p b { color: #fff; }
.o-role.is-key p { color: #cfd6e2; }
.o-role.is-key h3 small { color: #ffb48a; }
.o-callout { margin: 2.5rem 0 0; padding: 1.4rem 1.6rem; border: 1.5px dashed var(--ink-0); border-radius: 6px; font-size: 1.125rem; max-width: 62ch; background: var(--bg-1); }
.o-callout strong { background: linear-gradient(transparent 62%, rgba(194, 65, 12, 0.28) 0); }
@media (max-width: 860px) {
    .o-roles-head { display: none; }
    .o-role, .o-role.is-key { grid-template-columns: 1fr; gap: 1rem; }
    .o-role.is-key { margin: 0 -1rem; padding: 1.75rem 1rem; }
}

/* ---- Proceso: escena fija + fases ---- */
.o-process-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4.5rem); margin-top: 3rem; align-items: start; }
.o-scene { position: sticky; top: 5.25rem; margin: 0; padding: 1.25rem 1.25rem 1rem; background: var(--bg-1); border: 1.5px solid var(--ink-0); border-radius: 6px; box-shadow: 8px 8px 0 rgba(16, 33, 58, 0.1); }
.o-scene svg { display: block; width: 100%; height: auto; max-height: 68vh; }
.o-scene figcaption { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); font: 500 0.875rem var(--font-code); color: var(--ink-0); }
.o-scene path, .o-scene rect { fill: none; stroke: var(--ink-0); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.o-scene text.lbl { fill: var(--ink-1); stroke: none; font: 500 12px var(--font-code); }
.o-scene .ground { stroke-width: 3; }
.o-scene .soil { stroke: var(--line); stroke-dasharray: 2 8; }
.o-scene .stake { stroke: var(--signal); stroke-width: 2.5; }
.o-scene .plan { stroke: var(--navy); stroke-dasharray: 7 6; stroke-width: 1.8; }
.o-scene .dim { stroke: var(--navy); stroke-width: 1.4; }
.o-scene .hatch { stroke: var(--ink-0); stroke-width: 1.5; }
.o-scene .found { fill: var(--bg-2); stroke-width: 2.5; }
.o-scene .col { fill: var(--ink-0); }
.o-scene .losa { fill: var(--ink-1); stroke: var(--ink-0); }
.o-scene .pipe { stroke: var(--navy); stroke-width: 3; }
.o-scene .wire { stroke: var(--signal); stroke-width: 3; }
.o-scene .data { stroke: #15803d; stroke-width: 3; stroke-dasharray: 2 7; }
.o-scene .wall { fill: #efe3c8; stroke-width: 1.4; }
.o-scene .door { fill: var(--signal); stroke-width: 2; }
.o-scene .win { fill: #cfe3f5; stroke-width: 1.8; }
.o-scene .flag { fill: var(--signal); stroke: var(--ink-0); stroke-width: 2; }
.o-scene .crane-s path { stroke: var(--ink-1); stroke-width: 1.6; }

/* Con JS, cada fase aparece al llegar; sin JS, todo se ve completo */
.js .o-scene .st { opacity: 0; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); transform: translateY(14px); }
.js .o-scene.on-1 .g1, .js .o-scene.on-2 .g2, .js .o-scene.on-3 .g3,
.js .o-scene.on-4 .g4, .js .o-scene.on-5 .g5, .js .o-scene.on-6 .g6 { opacity: 1; transform: none; }
.js .o-scene .g2 { transform: translateY(0) scale(0.97); transform-origin: 240px 320px; }
.js .o-scene.on-2 .g2 { transform: none; }
.js .o-scene.on-6 .g2, .js .o-scene.on-6 .g5 { opacity: 0.18; }
.js .o-scene .crane-s { transition: opacity 0.6s; opacity: 0; }
.js .o-scene.on-3 .crane-s { opacity: 1; }
.js .o-scene.on-6 .crane-s { opacity: 0; }
.o-scene .g6 .win { transition: fill 0.8s 0.3s; }
.js .o-scene.on-6 .g6 .win { fill: #fde68a; }

.o-fases { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.o-fase { display: grid; grid-template-columns: 3.25rem 1fr; gap: 1rem; min-height: 62vh; align-content: center; padding: 1.5rem 0; border-top: 1px solid var(--line); opacity: 0.38; transition: opacity 0.4s; }
.o-fase:first-child { border-top: 1.5px solid var(--ink-0); }
.o-fase.is-active { opacity: 1; }
.o-fase .n { font: 700 2.25rem/1 var(--font-heading); color: var(--signal); }
.o-fase h3 { margin: 0 0 0.9rem; font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.o-fase p { margin: 0 0 0.75rem; max-width: 46ch; color: var(--ink-1); }
.o-fase p b { color: var(--ink-0); }
.o-fase .soft { padding-left: 1rem; border-left: 3px solid var(--signal); color: var(--ink-0); }
.html:not(.js) .o-fase, :root:not(.js) .o-fase { opacity: 1; min-height: 0; }
@media (max-width: 860px) {
    .o-process-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .o-scene { top: 4.4rem; z-index: 5; padding: 0.6rem 0.8rem 0.5rem; box-shadow: 4px 4px 0 rgba(16, 33, 58, 0.1); }
    .o-scene svg { max-height: 30vh; }
    .o-scene figcaption { margin-top: 0.4rem; padding-top: 0.4rem; font-size: 0.8125rem; }
    .o-fase { min-height: 56vh; grid-template-columns: 2.5rem 1fr; }
}

/* ---- Con / sin arquitecto ---- */
.o-versus { margin-top: 3rem; }
.o-vs-head, .o-vs-row { display: grid; grid-template-columns: 1fr 1fr; }
.o-vs-head span { padding: 0.9rem 1.5rem; font: 700 1.125rem var(--font-heading); }
.o-vs-head span:first-child { border: 1.5px dashed var(--signal); border-bottom: 0; color: var(--signal-2); border-radius: 6px 0 0 0; }
.o-vs-head span:last-child { background: var(--ink-0); color: #fff; border-radius: 0 6px 0 0; }
.o-vs-row p { margin: 0; padding: 1.4rem 1.5rem; color: var(--ink-1); }
.o-vs-row p b { display: block; color: var(--ink-0); margin-bottom: 0.2rem; }
.o-vs-row .sin { border-left: 1.5px dashed var(--signal); border-right: 1.5px dashed var(--signal); border-bottom: 1px dashed var(--line); }
.o-vs-row .con { background: var(--ink-0); color: #cfd6e2; border-bottom: 1px solid #243a5c; }
.o-vs-row .con b { color: #fff; }
.o-vs-row:last-child .sin { border-bottom: 1.5px dashed var(--signal); border-radius: 0 0 0 6px; }
.o-vs-row:last-child .con { border-radius: 0 0 6px 0; }
@media (max-width: 720px) {
    .o-vs-head span { padding: 0.8rem 0.9rem; font-size: 1rem; }
    .o-vs-row p { padding: 1.1rem 0.9rem; font-size: 0.9375rem; }
}

/* ---- Servicios y garantías ---- */
.o-rows { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 1.5px solid var(--ink-0); }
.o-rows li { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); margin: 0; transition: padding 0.3s, background 0.3s; }
.o-rows li::before { content: none; }
.o-rows li:hover { padding-left: 1rem; background: var(--bg-1); }
.o-rows h3 { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.o-rows p { margin: 0; color: var(--ink-1); }
@media (max-width: 720px) { .o-rows li { grid-template-columns: 1fr; gap: 0.35rem; } }
.o-guarantees { margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.o-guarantees > div { padding: 1.4rem 0; border-top: 1.5px solid var(--ink-0); }
.o-guarantees dt { font: 700 1.25rem var(--font-heading); margin: 0 0 0.4rem; }
.o-guarantees dd { margin: 0; color: var(--ink-1); max-width: 44ch; }
@media (max-width: 720px) { .o-guarantees { grid-template-columns: 1fr; } }

/* ---- Cierre ---- */
.o-close { margin-top: clamp(4.5rem, 10vw, 8rem); background: var(--ink-0); color: #fff; position: relative; overflow: hidden; }
.o-close::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 36px 36px; }
.o-close .o-wrap { position: relative; padding-top: clamp(3.5rem, 8vw, 6rem); padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.o-close h2 { font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; max-width: 16ch; margin: 0 0 1rem; text-wrap: balance; }
.o-close p { color: #cfd6e2; font-size: 1.125rem; max-width: 50ch; margin: 0; }
.o-close .small { margin-top: 1.5rem; font-size: 0.875rem; color: #9fb0c8; }
.o-close .btn-ghost { color: #fff; border-color: #fff; }
.o-close .btn-ghost:hover { background: #fff; color: var(--ink-0); }

/* ---- Responsive hero ---- */
@media (max-width: 900px) {
    .o-hero-grid { grid-template-columns: 1fr; min-height: 0; }
    .o-hero-art { max-width: 420px; justify-self: center; margin-top: 0.5rem; }
    .o-facts { grid-template-columns: 1fr 1fr; }
    .o-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
    .o-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
    .o-facts { grid-template-columns: 1fr; }
    .o-facts > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---- Movimiento reducido ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js [data-reveal] { opacity: 1; transform: none; }
    .o-hero .mark { background-size: 100% 100%; }
    .js .o-scene .st { opacity: 1; transform: none; }
    .o-fase { opacity: 1; }
}

/* ---- Correcciones sobre styles.css heredado ---- */
h1, h2, h3, h4 { color: var(--ink-0); -webkit-text-fill-color: currentColor; background-image: none; }
.o-close h2 { color: #fff; }
.o-hero h1 .mark { background-image: linear-gradient(transparent 64%, rgba(194, 65, 12, 0.3) 0); }
.o-fases li::before, .o-fases li::after, .o-rows li::after, .o-fase::before { content: none !important; display: none; }
.o-vs-head span:last-child { color: #fff; }
.o-role.is-key h3 { color: #fff; }
/* Consultor de confianza: shared visual language */
:root, :root[data-theme="light"] {
  --bg-0:#f8faf9; --bg-1:#fff; --bg-2:#e9f2ef; --line:#cddbd8;
  --ink-0:#102b3b; --ink-1:#435e69; --navy:#087b78; --navy-2:#075e5c;
  --navy-fill:#102b3b; --navy-fill-2:#173e4d; --navy-soft:rgba(8,123,120,.08);
  --accent:#087b78; --signal:#087b78; --signal-2:#075e5c; --scrim:#f8faf9;
  --radius-card:12px;
}
body.site-shell, :root[data-theme="light"] body.site-shell { background:#f8faf9; }
.topbar { background:rgba(248,250,249,.97); border-bottom:1px solid #dce7e4; }
.pill-link { background:#102b3b !important; color:#fff !important; border-color:#102b3b !important; border-radius:8px !important; }
.pill-link:hover { background:#075e5c !important; border-color:#075e5c !important; color:#fff !important; }
.nav-dropdown-menu { border:1px solid #dce7e4; border-radius:12px; box-shadow:0 12px 30px rgba(16,43,59,.12); }
.btn-solid, .btn-ghost { border-radius:8px; }
.footer-section { background:#102b3b; }
