/* EJL · base, tipografía y componentes comunes */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
	scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font);
	font-size: var(--fs-base);
	font-weight: 400;
	line-height: 1.75;
	letter-spacing: 0.01em;
	text-transform: var(--ejl-case);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

main { overflow-x: clip; }
main:focus { outline: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, input[type="submit"] { text-transform: var(--ejl-case); cursor: pointer; }
input, select, textarea { text-transform: var(--ejl-case); }

/* Correos, URL y claves se muestran como se escriben */
.keep-case,
input[type="email"],
input[type="url"],
input[type="password"] { text-transform: none; }

h1, h2, h3, h4 {
	margin: 0 0 var(--space-2);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.01em;
	text-wrap: balance;
	overflow-wrap: break-word;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
h4 { font-size: var(--fs-md); line-height: 1.3; }
p { margin: 0 0 var(--space-2); text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
/* Sobre fondo claro el amarillo no alcanza contraste: anillo negro */
.site-header :focus-visible,
.section--light :focus-visible,
.section--white :focus-visible { outline-color: var(--ejl-black); }

.icon { width: 1.35em; height: 1.35em; flex: none; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: var(--space-2);
	top: -100px;
	z-index: 100;
	padding: var(--space-1) var(--space-2);
	background: var(--ejl-black);
	color: var(--ejl-white);
	font-weight: 700;
}
.skip-link:focus { top: var(--space-1); }

.wrap {
	width: min(100% - 2 * var(--gutter), var(--wrap));
	margin-inline: auto;
}

.section { position: relative; padding-block: var(--space-section); isolation: isolate; }
.section--white { background: var(--ejl-white); }
.section--light { background: var(--ejl-paper); }
.section--dark { background: var(--ejl-black); color: var(--ejl-white); }

/* Marca de sección: barra amarilla corta, como en el manual */
.heading { max-width: 46rem; margin-bottom: var(--space-4); }
.heading::before {
	content: "";
	display: block;
	width: 44px;
	height: 6px;
	margin-bottom: var(--space-3);
	background: var(--color-accent);
}
.heading h2 { margin-bottom: var(--space-2); }
.heading p { max-width: 34rem; color: var(--color-muted); }
.section--dark .heading p { color: var(--ejl-muted-dark); }
.heading__sub {
	display: block;
	margin-top: var(--space-1);
	font-weight: 300;
	letter-spacing: 0.12em;
	font-size: 0.55em;
	line-height: 1.5;
}

/* Botones */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	min-height: 48px;
	padding: 0.8rem 1.5rem;
	border: 2px solid transparent;
	border-radius: 0;
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-decoration: none;
	touch-action: manipulation;
	transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) ease, color var(--dur-ui) ease, border-color var(--dur-ui) ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon { transition: transform var(--dur-ui) var(--ease-out); }
.btn--accent { background: var(--ejl-yellow); color: var(--ejl-black); }
.btn--dark { background: var(--ejl-black); color: var(--ejl-white); }
.btn--line { border-color: currentColor; background: transparent; }

@media (hover: hover) and (pointer: fine) {
	.btn:hover .icon { transform: translateX(4px); }
	.btn--accent:hover { background: var(--ejl-white); color: var(--ejl-black); }
	.section--white .btn--accent:hover,
	.section--light .btn--accent:hover,
	.contact .btn--accent:hover { background: var(--ejl-black); color: var(--ejl-white); }
	.btn--dark:hover { background: var(--ejl-yellow); color: var(--ejl-black); }
	.btn--line:hover { background: var(--ejl-yellow); border-color: var(--ejl-yellow); color: var(--ejl-black); }
}

.round-btn {
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 1px solid currentColor;
	border-radius: 0;
	background: transparent;
	touch-action: manipulation;
	transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-ui) ease, color var(--dur-ui) ease, opacity var(--dur-ui) ease;
}
.round-btn:active { transform: scale(0.95); }
.round-btn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
	.round-btn:not(:disabled):hover { background: var(--ejl-yellow); color: var(--ejl-black); }
}

/* Entrada al hacer scroll. Sin JavaScript el contenido se ve siempre. */
.js .reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
	transition-delay: calc(var(--i, 0) * 60ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.js .reveal { transform: none; transition: opacity 200ms ease; transition-delay: 0ms; }
	.btn, .btn .icon, .round-btn { transition-property: background-color, color, border-color, opacity; }
	.btn:active, .round-btn:active { transform: none; }
}
