/* =============================================================
   COMPONENTES REDISEÑADOS — Fase 2
   Sidebar (consola), Hero, Cards, Reveals, Back-to-top
   ============================================================= */

/* ============== SIDEBAR (consola lateral) ============== */
.header {
	position: fixed;
	left: 0;
	top: 0;
	height: 100vh;
	width: var(--header-width);
	background: var(--code-bg);
	color: var(--code-text);
	overflow-y: auto;
	scrollbar-color: rgba(255, 255, 255, 0.1) var(--code-bg);
	scrollbar-width: thin;
	border-right: 1px solid rgba(255, 255, 255, 0.05);
	z-index: 1000;
}
.header::-webkit-scrollbar { width: 6px; background: var(--code-bg); }
.header::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.1); border-radius: 3px; }

body.dark-mode .header { background: #050810; }

.header::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--grain);
	opacity: 0.4;
	pointer-events: none;
	mix-blend-mode: overlay;
}

.header > * { position: relative; z-index: 1; }

.header .force-overflow {
	padding: var(--sp-5) var(--sp-4);
}

.header .blog-name {
	font-family: var(--font-mono);
	font-weight: var(--fw-bold);
	font-size: 1.1rem;
	color: #fff;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: var(--sp-5);
}
.header .blog-name a {
	color: #fff;
	text-decoration: none;
}
.header .blog-name a:hover { color: var(--accent); }

.header .blog-name .prompt { color: var(--accent); margin-right: 0.4em; }

/* Profile section */
.profile-section {
	padding: var(--sp-4) 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	margin-bottom: var(--sp-4);
}

.profile-image {
	max-width: 140px;
	border: 2px solid var(--accent);
	padding: 3px;
	background: var(--code-bg);
	transition: transform var(--tr-base);
}
.profile-image:hover {
	transform: rotate(-2deg) scale(1.03);
}

.profile-section .bio {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: rgba(230, 232, 236, 0.7);
	line-height: 1.7;
}

/* Status indicator */
.profile-status {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--success);
	margin: var(--sp-2) 0 var(--sp-3);
	padding: var(--sp-1) var(--sp-2);
	background: rgba(74, 222, 128, 0.08);
	border: 1px solid rgba(74, 222, 128, 0.25);
	border-radius: var(--r-sm);
}
.profile-status::before {
	content: '';
	width: 8px;
	height: 8px;
	background: var(--success);
	border-radius: 50%;
	animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
	50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.profile-status::before { animation: none; }
}

/* Local clock */
.profile-clock {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: rgba(230, 232, 236, 0.6);
	padding: var(--sp-2);
	background: rgba(255, 255, 255, 0.02);
	border-left: 2px solid var(--accent);
	margin: var(--sp-3) 0;
}
.profile-clock .clock-label { color: var(--text-faint); }
.profile-clock .clock-time { color: #fff; font-size: var(--fs-sm); letter-spacing: 0.05em; }

/* Nav con numeración tipo consola */
.navbar-nav {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--sp-4);
}
.navbar-nav .nav-item {
	margin-bottom: var(--sp-1);
}
.navbar-nav .nav-link {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	padding: var(--sp-3);
	color: rgba(230, 232, 236, 0.75);
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	border-left: 2px solid transparent;
	border-radius: 0;
	transition: all var(--tr-fast);
}
.navbar-nav .nav-link .nav-num {
	font-size: 0.7rem;
	color: var(--text-faint);
	font-weight: var(--fw-regular);
}
.navbar-nav .nav-link:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.04);
	border-left-color: rgba(255, 255, 255, 0.3);
	padding-left: var(--sp-4);
}
.navbar-nav .nav-item.active .nav-link {
	color: var(--accent);
	background: rgba(255, 91, 46, 0.08);
	border-left-color: var(--accent);
}
.navbar-nav .nav-item.active .nav-link .nav-num {
	color: var(--accent);
}

/* Social list */
.social-list {
	list-style: none;
	padding: var(--sp-3) 0;
	margin: 0;
	display: flex;
	gap: var(--sp-2);
	flex-wrap: wrap;
}
.social-list .list-inline-item { margin: 0; }
.social-list a {
	width: 36px;
	height: 36px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--r-sm);
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: rgba(230, 232, 236, 0.8);
	transition: all var(--tr-fast);
	font-size: var(--fs-sm);
}
.social-list a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	transform: translateY(-2px);
}

/* Sidebar button (Contact) */
.header .btn-primary {
	background: var(--accent);
	border: 1px solid var(--accent);
	color: #fff;
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: var(--sp-3);
	width: 100%;
	font-weight: var(--fw-bold);
	border-radius: var(--r-sm);
	transition: all var(--tr-fast);
}
.header .btn-primary:hover {
	background: transparent;
	border-color: var(--accent);
	color: var(--accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow-glow);
}

/* Sidebar responsive */
@media (max-width: 991.98px) {
	.header {
		position: static;
		width: 100%;
		height: auto;
		max-height: none;
	}
	.header .force-overflow {
		padding: var(--sp-5) var(--sp-3) var(--sp-3);
	}
	.profile-section { text-align: center; }
	.profile-status, .profile-clock { display: inline-block; }
	.profile-clock { width: 100%; }
	.navbar-nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: var(--sp-1); }
	.navbar-nav .nav-item { flex: 1 1 30%; margin: 0; }
	.navbar-nav .nav-link { justify-content: center; padding: var(--sp-2); font-size: 0.7rem; }
	.navbar-nav .nav-link .nav-num { display: none; }
}

/* ============== MAIN WRAPPER ============== */
.main-wrapper {
	margin-left: var(--header-width);
	min-height: 100vh;
	background: var(--bg);
	background-image: var(--grain);
	background-attachment: fixed;
	transition: background-color var(--tr-base);
}
@media (max-width: 991.98px) {
	.main-wrapper { margin-left: 0; }
}

/* ============== HERO ============== */
.hero {
	padding: var(--sp-9) var(--sp-5) var(--sp-8);
	background: var(--bg);
	position: relative;
	overflow: hidden;
}
.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 20% 20%, rgba(255, 91, 46, 0.06), transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(15, 42, 74, 0.04), transparent 50%);
	pointer-events: none;
}
.hero .container { position: relative; }

.hero-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: var(--ls-wider);
	font-weight: var(--fw-medium);
	padding: var(--sp-2) var(--sp-3);
	background: var(--accent-soft);
	border: 1px solid var(--accent);
	border-radius: var(--r-sm);
	margin-bottom: var(--sp-5);
}
.hero-eyebrow .dot {
	width: 8px;
	height: 8px;
	background: var(--accent);
	border-radius: 50%;
}

.hero-title {
	font-family: var(--font-display);
	font-size: var(--fs-display);
	font-weight: var(--fw-bold);
	line-height: 0.95;
	letter-spacing: var(--ls-tight);
	color: var(--text);
	margin: 0 0 var(--sp-5);
}
.hero-title .highlight {
	color: var(--accent);
	font-style: italic;
}
.hero-title .lastname {
	display: block;
	font-size: 0.7em;
	color: var(--text-muted);
	font-weight: var(--fw-medium);
	margin-top: var(--sp-2);
}

.hero-tagline {
	font-family: var(--font-mono);
	font-size: var(--fs-md);
	color: var(--text-muted);
	max-width: 540px;
	margin: 0 0 var(--sp-6);
	line-height: 1.7;
}
.hero-tagline .cursor {
	display: inline-block;
	width: 8px;
	height: 1.1em;
	background: var(--accent);
	vertical-align: text-bottom;
	animation: blink 1s steps(1) infinite;
	margin-left: 2px;
}
@keyframes blink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.hero-tagline .cursor { animation: none; opacity: 0.5; }
}

.hero-cta {
	display: flex;
	gap: var(--sp-3);
	flex-wrap: wrap;
}

.hero-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--sp-4);
	margin-top: var(--sp-7);
	padding-top: var(--sp-5);
	border-top: 1px solid var(--line);
}
.hero-stats .stat-num {
	font-family: var(--font-display);
	font-size: var(--fs-2xl);
	font-weight: var(--fw-bold);
	color: var(--accent);
	line-height: 1;
	margin-bottom: var(--sp-1);
}
.hero-stats .stat-label {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: var(--ls-wider);
}

/* ============== BUTTONS ============== */
.btn {
	font-family: var(--font-mono);
	font-weight: var(--fw-bold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: var(--fs-sm);
	padding: var(--sp-3) var(--sp-5);
	height: auto;
	border-radius: var(--r-sm);
	transition: all var(--tr-fast);
	border: 1.5px solid transparent;
}
.btn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	box-shadow: none !important;
}
.btn-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}
.btn-primary:hover {
	background: #E54A1F;
	border-color: #E54A1F;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: var(--shadow-glow);
}
.btn-secondary {
	background: transparent;
	border-color: var(--brand);
	color: var(--brand);
}
.btn-secondary:hover {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
	transform: translateY(-2px);
}
body.dark-mode .btn-secondary {
	border-color: var(--brand);
	color: var(--brand);
}
body.dark-mode .btn-secondary:hover {
	background: var(--brand);
	color: #fff;
}
.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-base); }

@media (prefers-reduced-motion: reduce) {
	.btn:hover { transform: none; }
}

/* ============== SECTION TITLE ============== */
.section-title {
	font-family: var(--font-display);
	font-size: var(--fs-2xl);
	font-weight: var(--fw-bold);
	color: var(--text);
	margin: 0 0 var(--sp-3);
	padding-left: var(--sp-4);
	position: relative;
}
.section-title::before {
	content: '';
	display: block;
	width: 4px;
	height: 100%;
	background: var(--accent);
	position: absolute;
	left: 0;
	top: 0;
	border-radius: 2px;
}
.section-intro {
	font-size: var(--fs-md);
	color: var(--text-muted);
	max-width: 720px;
	margin-bottom: var(--sp-6);
}

/* ============== SKILL CARDS ============== */
.overview-section {
	padding: var(--sp-8) var(--sp-4);
}
.skills-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--sp-4);
}
.skill-card {
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: var(--sp-5);
	transition: all var(--tr-base);
	position: relative;
	overflow: hidden;
}
.skill-card::after {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--tr-base);
}
.skill-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--accent);
}
.skill-card:hover::after { transform: scaleX(1); }
.skill-card .skill-num {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-faint);
	letter-spacing: var(--ls-wider);
	margin-bottom: var(--sp-2);
}
.skill-card .skill-icon {
	font-size: 2rem;
	color: var(--brand);
	margin-bottom: var(--sp-3);
	display: flex;
	gap: var(--sp-2);
}
.skill-card .skill-title {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	color: var(--text);
	margin: 0 0 var(--sp-2);
}
.skill-card .skill-desc {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	line-height: 1.6;
	margin: 0;
}
.skill-card.skill-accent {
	background: var(--code-bg);
	color: var(--code-text);
	border-color: var(--code-bg);
}
.skill-card.skill-accent .skill-title,
.skill-card.skill-accent .skill-num { color: #fff; }
.skill-card.skill-accent .skill-icon { color: var(--accent); }
.skill-card.skill-accent .skill-desc { color: rgba(230, 232, 236, 0.75); }
.skill-card.skill-accent::after { background: var(--accent); transform: scaleX(1); }
.skill-card.skill-accent:hover { box-shadow: 0 0 0 1px var(--accent), 0 12px 30px -6px rgba(255, 91, 46, 0.3); }

.skill-card.skill-outlined {
	background: transparent;
	border: 1.5px solid var(--line-strong);
}
body.dark-mode .skill-card.skill-outlined { border-color: var(--line-strong); }

@media (prefers-reduced-motion: reduce) {
	.skill-card:hover { transform: none; }
}

/* ============== ABOUT-ME SECTION ============== */
.about-me-section {
	padding: var(--sp-8) var(--sp-4);
	background: var(--bg-soft);
}
.profile-teaser {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr;
	gap: var(--sp-7);
	align-items: center;
}
@media (max-width: 991.98px) {
	.profile-teaser { grid-template-columns: 1fr; }
}
.profile-teaser .name {
	font-size: var(--fs-3xl);
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	margin-bottom: var(--sp-2);
	letter-spacing: var(--ls-tight);
}
.profile-teaser .tagline {
	font-family: var(--font-mono);
	font-size: var(--fs-md);
	color: var(--accent);
	margin-bottom: var(--sp-4);
	font-weight: var(--fw-medium);
}
.profile-teaser .bio {
	font-size: var(--fs-md);
	color: var(--text-muted);
	line-height: 1.7;
	margin-bottom: var(--sp-4);
}
.profile-teaser .profile-image {
	max-width: 100%;
	height: auto;
	border: 3px solid var(--accent);
	border-radius: var(--r-md);
	padding: 6px;
	background: var(--bg-elev);
	box-shadow: var(--shadow-lg);
}

/* ============== FOOTER ============== */
.footer {
	padding: var(--sp-5);
	text-align: center;
	background: var(--bg-soft);
	border-top: 1px solid var(--line);
}
.footer .copyright {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	letter-spacing: var(--ls-wide);
}
.footer .copyright a {
	color: var(--text-muted);
	text-decoration: none;
	border-bottom: 1px dashed var(--text-faint);
}
.footer .copyright a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ============== REVEAL ON SCROLL ============== */
.reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.reveal[data-reveal-delay="100"] { transition-delay: 100ms; }
.reveal[data-reveal-delay="200"] { transition-delay: 200ms; }
.reveal[data-reveal-delay="300"] { transition-delay: 300ms; }
.reveal[data-reveal-delay="400"] { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
}

/* ============== BACK TO TOP ============== */
.back-to-top {
	position: fixed;
	bottom: var(--sp-5);
	right: var(--sp-5);
	width: 48px;
	height: 48px;
	background: var(--accent);
	color: #fff;
	border: 0;
	border-radius: var(--r-pill);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--shadow-lg);
	opacity: 0;
	transform: translateY(20px) scale(0.8);
	pointer-events: none;
	transition: all var(--tr-base);
	z-index: 900;
	font-size: var(--fs-md);
}
.back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
.back-to-top:hover {
	background: #E54A1F;
	transform: translateY(-4px) scale(1.05);
	box-shadow: var(--shadow-glow);
}
.back-to-top:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	.back-to-top, .back-to-top:hover { transform: none; }
}

/* ============== CTA SECTION (contacto, resumen) ============== */
.cta-section {
	padding: var(--sp-8) var(--sp-4);
	background: var(--bg-soft);
	border-bottom: 1px solid var(--line);
	text-align: center;
}
.cta-section .heading {
	font-family: var(--font-display);
	font-size: var(--fs-3xl);
	font-weight: var(--fw-bold);
	color: var(--text);
	margin-bottom: var(--sp-4);
}
.cta-section .intro {
	max-width: 720px;
	margin: 0 auto;
	color: var(--text-muted);
}
.cta-section .intro a {
	color: var(--accent);
	border-bottom: 1px solid currentColor;
}

/* ============== RESUME (CV) ============== */
.resume-wrapper {
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: var(--sp-6);
	box-shadow: var(--shadow-md);
}
.resume-name {
	font-family: var(--font-display);
	font-size: var(--fs-3xl);
	font-weight: var(--fw-bold);
	color: var(--text);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	margin: 0;
}
.resume-tagline {
	font-family: var(--font-mono);
	font-size: var(--fs-md);
	color: var(--accent);
	margin-top: var(--sp-2);
}
.resume-section-heading {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	color: var(--text);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	margin: 0 0 var(--sp-4);
	padding-left: var(--sp-3);
	position: relative;
}
.resume-section-heading::before {
	content: '';
	position: absolute;
	left: 0; top: 0;
	width: 3px;
	height: 100%;
	background: var(--accent);
	border-radius: 2px;
}
.resume-main .item-title {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	color: var(--text);
	margin: 0 0 var(--sp-1);
}
.resume-main .item-meta {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
}
.resume-list {
	list-style: none;
	padding: 0;
	margin: var(--sp-2) 0 0;
}
.resume-list li {
	position: relative;
	padding-left: var(--sp-5);
	margin-bottom: var(--sp-2);
	font-size: var(--fs-sm);
	color: var(--text-muted);
	line-height: 1.6;
}
.resume-list li::before {
	content: '▸';
	position: absolute;
	left: 0;
	color: var(--accent);
}
.resume-aside {
	border-left: 1px solid var(--line);
	padding-left: var(--sp-5);
}
@media (max-width: 991.98px) {
	.resume-aside { border-left: 0; padding-left: 0; }
}
.resume-aside .item-title {
	font-family: var(--font-display);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	color: var(--text);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	margin: 0 0 var(--sp-2);
}
.resume-skills-list, .resume-education-list, .resume-awards-list, .resume-lang-list, .resume-interests-list {
	list-style: none;
	padding: 0;
	margin: 0;
}
.resume-skills-list li, .resume-education-list li, .resume-awards-list li, .resume-lang-list li, .resume-interests-list li {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	margin-bottom: var(--sp-2);
}
.resume-degree { color: var(--text); font-weight: var(--fw-semibold); }
.resume-degree-org, .resume-degree-time { font-family: var(--font-mono); font-size: var(--fs-xs); }
.resume-link { color: var(--text-muted); text-decoration: none; }
.resume-link:hover { color: var(--accent); }

/* ============== FORM (contacto) ============== */
.contact-form .form-label {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	font-weight: var(--fw-medium);
	margin-bottom: var(--sp-2);
}
.contact-form .form-control {
	font-family: var(--font-body);
	font-size: var(--fs-base);
	color: var(--text);
	background: var(--bg-elev);
	border: 1.5px solid var(--line);
	border-radius: var(--r-sm);
	padding: var(--sp-3) var(--sp-4);
	height: auto;
	transition: all var(--tr-fast);
}
.contact-form .form-control:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(255, 91, 46, 0.15);
	outline: 0;
}
body.dark-mode .contact-form .form-control {
	background: var(--bg-soft);
	border-color: var(--line-strong);
	color: var(--text);
}
.contact-form textarea.form-control { min-height: 140px; resize: vertical; }
