/* Páginas estáticas de hydroXperu (guías, nosotros, políticas): livianas, sin frameworks */
:root {
	--a: #22d3ee; --b: #a855f7; --c: #34d399;
	--text: #0f172a; --muted: #475569; --line: rgba(15, 23, 42, 0.1); --bg: #f5f6fb; --card: rgba(255, 255, 255, 0.82);
	--glass: rgba(245, 246, 251, 0.78); --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}
html[data-theme='dark'] {
	--text: #e8eaf2; --muted: #a3acc2; --line: rgba(255, 255, 255, 0.09); --bg: #07080d; --card: rgba(16, 18, 27, 0.78);
	--glass: rgba(10, 11, 18, 0.72); --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0; font-family: Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); line-height: 1.75;
	background: radial-gradient(900px circle at 85% -10%, rgba(168, 85, 247, 0.14), transparent 60%), radial-gradient(700px circle at 0% 100%, rgba(34, 211, 238, 0.1), transparent 60%), var(--bg) fixed;
	transition: background-color 0.4s, color 0.4s;
}
a { color: var(--b); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--a); }
code { font-size: 0.85em; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--b) 12%, transparent); }

/* fondo: red de partículas */
.hx-net { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.55; }
.hx-progress { position: fixed; top: 0; left: 0; z-index: 30; height: 3px; width: 0; background: linear-gradient(90deg, var(--a), var(--b)); box-shadow: 0 0 12px var(--b); }

/* cabecera */
.top {
	position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px clamp(16px, 4vw, 40px);
	background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand svg { width: 1.6rem; height: 1.6rem; color: var(--c); filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.7)); transition: transform 0.4s; }
.brand:hover svg { transform: scale(1.12) rotate(-8deg); }
.brand:hover { color: var(--text); }
.top-links { display: flex; gap: 4px; margin-left: auto; }
.top-links a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s, background 0.2s; }
.top-links a:hover, .top-links a.on { color: var(--text); background: color-mix(in srgb, var(--b) 12%, transparent); }
.icon-btn {
	width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
	color: var(--text); cursor: pointer; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--b); box-shadow: 0 8px 20px rgba(168, 85, 247, 0.25); }
.cta {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; color: #fff !important; text-decoration: none; font-weight: 600; font-size: 0.9rem;
	background: linear-gradient(90deg, var(--a), var(--b)); background-size: 200% 100%; box-shadow: 0 10px 24px rgba(168, 85, 247, 0.3); transition: background-position 0.4s, transform 0.25s;
}
.cta svg { width: 14px; height: 14px; transition: transform 0.25s; }
.cta:hover { background-position: 100% 0; transform: translateY(-2px); }
.cta:hover svg { transform: translateX(3px); }

/* contenido */
.page { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 1080px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; }
.page.with-toc { grid-template-columns: minmax(0, 1fr) 240px; }
main { min-width: 0; }
nav.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
nav.crumbs a { color: var(--muted); text-decoration: none; }
nav.crumbs a:hover { color: var(--b); }
h1 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em;
	background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--b) 70%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.4rem; margin: 40px 0 12px; scroll-margin-top: 90px; display: flex; align-items: center; gap: 10px; }
h2::before { content: ''; width: 6px; height: 22px; border-radius: 4px; background: linear-gradient(var(--a), var(--b)); flex: none; }
h3 { font-size: 1.1rem; margin: 26px 0 6px; }
.lead { font-size: 1.12rem; color: var(--muted); }
.meta { font-size: 0.85rem; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: color-mix(in srgb, var(--b) 12%, transparent); font-weight: 600; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: color-mix(in srgb, var(--a) 7%, transparent); }
.table-wrap { overflow-x: auto; }
.note { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--card); box-shadow: var(--shadow); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 18px; }
.cards a {
	position: relative; overflow: hidden; display: block; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--card);
	text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color 0.25s, transform 0.25s;
}
.cards a::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
	background: radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), rgba(168, 85, 247, 0.16), transparent 60%); }
.cards a:hover { border-color: var(--b); transform: translateY(-4px); }
.cards a:hover::after { opacity: 1; }
.cards b { display: block; margin-bottom: 6px; }
.cards small { color: var(--muted); }
.box {
	position: relative; overflow: hidden; margin-top: 44px; padding: 26px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--b) 35%, transparent);
	background: linear-gradient(135deg, color-mix(in srgb, var(--a) 12%, var(--card)), color-mix(in srgb, var(--b) 14%, var(--card))); box-shadow: var(--shadow);
}
.box h2 { margin-top: 0; }

/* índice del artículo */
.toc { position: sticky; top: 90px; align-self: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 0.85rem; box-shadow: var(--shadow); }
.toc b { display: block; margin-bottom: 8px; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; transition: all 0.2s; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--b); border-color: var(--b); background: color-mix(in srgb, var(--b) 8%, transparent); }

/* aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* pie */
.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); }
.foot-in { max-width: 1080px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; font-size: 0.88rem; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--b); }
.foot-social { display: flex; gap: 10px; }
.foot-social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); transition: transform 0.25s, color 0.25s, border-color 0.25s; }
.foot-social a svg { width: 18px; height: 18px; }
.foot-social a:hover { transform: translateY(-3px) rotate(-6deg); color: var(--c); border-color: var(--c); }

/* volver arriba */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 25; opacity: 0; transform: translateY(20px) scale(0.7); pointer-events: none; transition: all 0.35s cubic-bezier(.2,.9,.3,1.3); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 900px) {
	.page.with-toc { grid-template-columns: minmax(0, 1fr); }
	.toc { display: none; }
}
@media (max-width: 600px) {
	.top-links { display: none; }
	.top .theme { margin-left: auto; }
	.cta { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	.hx-net { display: none; }
}

/* botón de tema: luna en claro, sol en oscuro */
.theme span { display: grid; animation: hx-spin 0.5s cubic-bezier(.2,.9,.3,1.3); }
.theme .i-sun, html[data-theme='dark'] .theme .i-moon { display: none; }
html[data-theme='dark'] .theme .i-sun { display: grid; }
@keyframes hx-spin { from { transform: rotate(-120deg) scale(0.4); opacity: 0; } }

/* panel "Personaliza" (mismo diseño que la landing) */
.hx-cz { --cz-bg: #fff; --cz-soft: #f3f4fa; --cz-text: #1e1b3a; --cz-muted: #6b6f86; --cz-line: rgba(15, 23, 42, 0.08); }
html[data-theme='dark'] .hx-cz { --cz-bg: #161922; --cz-soft: #1f2330; --cz-text: #f1f2f8; --cz-muted: #9aa0b8; --cz-line: rgba(255, 255, 255, 0.08); }
.hx-cz-tab {
	position: fixed; top: 50%; right: 0; z-index: 60; width: 44px; height: 52px; display: grid; place-items: center; cursor: pointer; border: 0; border-radius: 16px 0 0 16px; color: #fff;
	transform: translateY(-50%); background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: -6px 6px 22px rgba(168, 85, 247, 0.35); transition: right 0.45s cubic-bezier(.2, .9, .3, 1), width 0.25s;
}
.hx-cz-tab svg { width: 17px; height: 17px; animation: hx-cz-spin 6s linear infinite; }
.hx-cz-tab:hover { width: 52px; }
.hx-cz.open .hx-cz-tab { right: min(360px, 100vw); }
.hx-cz-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(10, 12, 20, 0.35); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.hx-cz.open .hx-cz-backdrop { opacity: 1; pointer-events: auto; }
.hx-cz-panel {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 59; width: min(360px, 100vw); overflow-y: auto; color: var(--cz-text); line-height: 1.4;
	background: var(--cz-bg); box-shadow: -18px 0 40px rgba(0, 0, 0, 0.18); transform: translateX(100%); visibility: hidden; transition: transform 0.45s cubic-bezier(.2, .9, .3, 1), visibility 0.45s;
}
.hx-cz.open .hx-cz-panel { transform: none; visibility: visible; }
.hx-cz-panel header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; background: var(--cz-soft); border-bottom: 1px solid var(--cz-line); }
.hx-cz-panel header b { display: block; font-size: 1.05rem; }
.hx-cz-panel small { color: var(--cz-muted); font-size: 0.75rem; letter-spacing: 0.04em; }
.hx-cz-brand { background: linear-gradient(90deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-cz-close { width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer; color: var(--cz-text); background: var(--cz-bg); transition: transform 0.3s; }
.hx-cz-close:hover { transform: rotate(90deg); }
.hx-cz-panel section { padding: 22px 24px 4px; }
.hx-cz-panel h5 { font-size: 1rem; margin: 2px 0 14px; }
.hx-cz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hx-cz-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; cursor: pointer; color: var(--cz-text); font: 600 0.85rem/1.4 Poppins, system-ui, sans-serif; border: 2px solid var(--cz-line); background: var(--cz-soft); transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
.hx-cz-opt svg { width: 100%; height: auto; border-radius: 8px; }
.hx-cz-opt:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(168, 85, 247, 0.18); }
.hx-cz-opt.on { border-color: var(--b); box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15); }
.hx-cz-check { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 0.7rem; font-style: normal; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); transform: scale(0); transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.5); }
.hx-cz-opt.on .hx-cz-check { transform: scale(1); }
@keyframes hx-cz-spin { 0%, 80% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .hx-cz-tab svg { animation: none; } }

/* Transición suave al navegar entre páginas del sitio (navegadores compatibles) */
@view-transition{navigation:auto}::view-transition-old(root){animation:hx-vt-out .3s ease both}::view-transition-new(root){animation:hx-vt-in .45s cubic-bezier(.2,.8,.3,1) both}@keyframes hx-vt-out{to{opacity:0;transform:scale(.985);filter:blur(4px)}}@keyframes hx-vt-in{from{opacity:0;transform:translateY(14px);filter:blur(4px)}}@media (prefers-reduced-motion:reduce){::view-transition-old(root),::view-transition-new(root){animation:none}}
