:root {
	--bg: #0b1220;
	/* dark default */
	--surface: rgba(255, 255, 255, .06);
	--surface-2: rgba(255, 255, 255, .10);
	--text: #e6eaf2;
	--muted: #9aa4b2;
	--brand: #6ea8ff;
	--brand-2: #9b8cff;
	--edge-a: #6ea8ff;
	--edge-b: #9b8cff;
	--radius: 18px;
}

html[data-theme="light"] {
	--bg: #fcfdff;
	--surface: #fff;
	--surface-2: #e8eef7;
	--text: #0f172a;
	--muted: #5b6472;
	--brand: #3b82f6;
	--brand-2: #8b5cf6;
	--edge-a: #3b82f6;
	--edge-b: #8b5cf6;
}

@media (prefers-color-scheme: light) {
	html[data-theme="auto"],
	html[data-theme=""] {
		--bg: #fcfdff;
		--surface: #fff;
		--surface-2: #e8eef7;
		--text: #0f172a;
		--muted: #5b6472;
		--brand: #3b82f6;
		--brand-2: #8b5cf6;
		--edge-a: #3b82f6;
		--edge-b: #8b5cf6;
	}
}

@media (prefers-color-scheme: dark) {
	html[data-theme="auto"],
	html[data-theme=""] {
		--bg: #0b1220;
		--surface: rgba(255, 255, 255, .06);
		--surface-2: rgba(255, 255, 255, .10);
		--text: #e6eaf2;
		--muted: #9aa4b2;
		--brand: #6ea8ff;
		--brand-2: #9b8cff;
		--edge-a: #6ea8ff;
		--edge-b: #9b8cff;
	}
}

* {
	box-sizing: border-box
}

html,
body {
	height: 100%
}

body {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	color: var(--text);
	background: var(--bg);
}

.bg {
	position: relative;
	overflow-x: hidden
}

.glow {
	position: fixed;
	inset: auto -20vw 40% -20vw;
	height: 60vh;
	background: radial-gradient(60% 60% at 50% 0%,
			color-mix(in oklab, var(--brand) 35%, transparent),
			color-mix(in oklab, var(--brand-2) 25%, transparent) 35%, transparent 70%);
	filter: blur(60px);
	pointer-events: none;
	z-index: 0;
}

.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
	z-index: 1
}

@media (max-width:768px) {
	.container {
		padding: 16px
	}
}

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	position: relative;
	z-index: 1002;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--text)
}

.logo {
	min-width: 40px;
	height: 70px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	font-weight: 800
}

.logo-img {
	width: 70px;
	height: 70px;
	border-radius: 12px;
	object-fit: cover
}

.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1
}

.brand-text span {
	font-weight: 700;
	font-size: clamp(1.1rem, 2.5vw, 1.6rem)
}

.nav {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: nowrap
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 10px
}

.nav-links a {
	padding: 10px 14px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--text);
	background: transparent;
	border: 1px solid transparent;
}

.nav-links a:hover {
	background: var(--surface);
	border-color: var(--surface-2)
}

.nav-links a[aria-current="page"] {
	background: var(--surface-2);
	border-color: var(--surface-2)
}

.nav-links a:focus-visible {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

.menu-toggle {
	display: none;
	border: 1px solid var(--surface-2);
	background: transparent;
	color: var(--text);
	border-radius: 12px;
	padding: 8px 10px;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.menu-toggle:focus-visible {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

.nav-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	backdrop-filter: blur(2px);
	z-index: 1000;
	display: none;
}

.nav-backdrop.open {
	display: block
}

@media (max-width:768px) {
	.brand {
		flex: 1
	}

	.menu-toggle {
		display: inline-block;
		margin-left: auto;
	}

	.nav {
		margin-left: auto;
	}

	.nav-links {
		position: fixed;
		right: 16px;
		top: calc(64px + 8px);
		width: min(92vw, 440px);
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		background: var(--surface);
		border: 1px solid var(--surface-2);
		border-radius: 16px;
		padding: 10px;
		z-index: 1001;
		box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
		backdrop-filter: blur(6px);
		max-height: calc(100vh - 96px);
		overflow: auto;
	}

	.nav-links.open {
		display: flex
	}
}

.theme-controls {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.theme-controls select.btn {
	grid-column: 1/-1
}

.theme-controls select.btn {
	appearance: none;
	background: transparent;
	border: 1px solid var(--surface-2);
	border-radius: 12px;
	padding: 6px 10px;
	color: var(--text);
}

.theme-controls select.btn:focus {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

.theme-controls .small {
	padding: 6px 10px;
	font-size: 12px
}

.hero {
	padding: 28px 0 8px
}

.hero h1 {
	font-family: Poppins, Inter, sans-serif;
	font-size: 38px;
	line-height: 1.1;
	margin: .2rem 0 1rem
}

.hero p {
	max-width: 780px;
	opacity: .95
}

.cta-row {
	display: flex;
	gap: 12px;
	margin-top: 18px
}

.btn {
	display: inline-block;
	padding: 10px 16px;
	border-radius: 12px;
	text-decoration: none;
	font-weight: 600;
	border: 1px solid transparent
}

.btn-primary {
	background: linear-gradient(135deg, var(--brand), var(--brand-2));
	color: #0b0f1a
}

.btn-primary:hover {
	opacity: .95
}

.btn-ghost {
	color: var(--text);
	border-color: var(--surface-2);
	background: transparent
}

.btn-ghost:hover {
	background: var(--surface)
}

.btn:focus-visible {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

@media (max-width:768px) {
	.hero h1 {
		font-size: 28px
	}

	.hero p {
		font-size: 15px
	}

	.theme-controls {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr;
		gap: 8px;
	}

	.theme-controls select.btn {
		grid-column: 1/-1;
	}
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin: 28px 0
}

.card {
	background: var(--surface);
	border: 1px solid var(--surface-2);
	border-radius: var(--radius);
	padding: 18px
}

.card h3 {
	margin: 0 0 8px
}

.card p {
	color: color-mix(in oklab, var(--text) 85%, transparent)
}

.value-props {
	margin: 24px 0 8px
}

.value-props h2 {
	font-family: Poppins, Inter, sans-serif;
	margin: 0 0 8px
}

.value-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin: 12px 0 8px;
	padding: 0;
	list-style: none;
}

.value-list li {
	background: var(--surface);
	border: 1px solid var(--surface-2);
	border-radius: var(--radius);
	padding: 14px
}

.diagram-section {
	margin: 24px 0 12px
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap
}

.section-head h2 {
	font-family: Poppins, Inter, sans-serif;
	margin: 0
}

.section-head p {
	color: var(--muted);
	margin: 0
}

.diagram-wrap {
	background: linear-gradient(180deg,
			color-mix(in oklab, var(--surface) 100%, transparent),
			color-mix(in oklab, var(--surface) 70%, transparent));
	border: 1px solid var(--surface-2);
	border-radius: 22px;
	padding: 10px;
	overflow: auto;
}

.diagram {
	min-width: 900px;
	width: 100%;
	height: 520px;
	border-radius: 16px
}

@media (max-width:768px) {
	.diagram {
		height: 420px
	}
}

.nodes .node {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 14px;
	text-decoration: none;
	color: var(--text);
	background: color-mix(in oklab, var(--surface) 100%, transparent);
	border: 1px solid var(--surface-2);
}

.nodes .node:hover {
	background: color-mix(in oklab, var(--surface) 80%, transparent)
}

.nodes .node-muted {
	opacity: .85
}

.badge-img {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	object-fit: cover
}

.node .node-text {
	display: flex;
	flex-direction: column;
	line-height: 1
}

.node .node-text span {
	color: var(--muted);
	font-size: 12px;
	margin-top: 4px
}

.group-title {
	font: 600 12px/1 Inter, system-ui;
	fill: var(--muted)
}

.grid-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
	margin: 20px 0 40px
}

@media (max-width:420px) {
	.grid-links {
		grid-template-columns: 1fr
	}
}

.link-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border-radius: 14px;
	background: var(--surface);
	border: 1px solid var(--surface-2);
	text-decoration: none;
	color: var(--text);
	transition: transform .15s ease;
}

.link-card:hover {
	transform: translateY(-2px)
}

.link-card .badge-img {
	width: 32px;
	height: 32px;
	border-radius: 10px
}

.link-card small {
	display: block;
	margin-top: 2px;
	font-size: .8em;
	color: var(--muted)
}

.link-card:focus-visible {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

.prose {
	max-width: 900px
}

.prose h1,
.prose h2 {
	font-family: Poppins, Inter, sans-serif
}

.prose .muted {
	color: var(--muted)
}

.prose p,
.prose li {
	color: color-mix(in oklab, var(--text) 92%, transparent)
}

.footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border-top: 1px solid var(--surface-2);
	padding: 16px 0;
	margin-top: 12px;
	flex-wrap: wrap;
}

.footer-left {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 260px
}

.footer-copy {
	font-size: .9rem;
	flex: 0 0 auto;
	margin-right: 6px
}

.footer nav {
	display: flex;
	gap: 12px;
	flex-wrap: wrap
}

.footer a {
	color: var(--text);
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 10px
}

.footer a:hover {
	background: var(--surface)
}

.footer a:focus-visible {
	outline: 2px solid var(--edge-a);
	outline-offset: 2px
}

.footer-icons {
	display: inline-flex;
	gap: 8px
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text) !important;
  opacity: .85;
  border-radius: .5rem;
  text-decoration: none;
}

.social-link .bi {
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
}

@media (pointer:coarse) {
	.social-link {
		width: 36px;
		height: 36px
	}
}

@media (hover:hover) {
	.social-link {
		transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease, opacity .15s ease
	}

	.social-link:hover,
	.social-link:focus-visible {
		transform: translateY(-1px);
		background-color: color-mix(in oklab, var(--surface) 85%, transparent);
		color: var(--brand) !important;
		box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
		opacity: 1;
		outline: none;
	}
}

@media (prefers-color-scheme:dark) {
	.social-link:hover,
	.social-link:focus-visible {
		background-color: rgba(158, 197, 254, .12);
		box-shadow: 0 6px 18px rgba(0, 0, 0, .32);
	}
}

@media (max-width:600px) {
	.footer {
		flex-direction: column;
		text-align: center;
		gap: 10px
	}

	.footer-left {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px 10px
	}

	.footer-copy {
		flex-basis: 100%;
		margin-right: 0;
		font-size: .85rem;
		white-space: normal
	}

	.footer-icons {
		width: 100%;
		justify-content: center;
		gap: 10px
	}

	.footer nav {
		justify-content: center
	}
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

/* Lang selector: mejor contraste en dark (y estable en light) */
#lang-select {
  background-color: var(--surface) !important;  /* antes transparente */
  color: var(--text) !important;
  border-color: var(--surface-2) !important;
}

/* Menú desplegado (la lista) en la mayoría de navegadores */
#lang-select option {
  background-color: var(--bg);
  color: var(--text);
}

/* Estados accesibles */
#lang-select:hover {
  background-color: color-mix(in oklab, var(--surface) 85%, transparent) !important;
}
#lang-select:focus-visible {
  outline: 2px solid var(--edge-a);
  outline-offset: 2px;
}
