/* =============================================================
   FASE 3 — Componentes avanzados
   Timeline, Floating labels, Ticker, Testimonios, Currently, SVG 404
   ============================================================= */

/* ============== TIMELINE (CV experiencia) ============== */
.timeline {
	position: relative;
	padding: var(--sp-4) 0 0 var(--sp-6);
	margin: 0;
	list-style: none;
}
.timeline::before {
	content: '';
	position: absolute;
	left: 6px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--line-strong);
}
body.dark-mode .timeline::before { background: var(--line-strong); }

.timeline > li {
	position: relative;
	padding: 0 0 var(--sp-6) var(--sp-5);
}
.timeline > li::before {
	content: '';
	position: absolute;
	left: -8px;
	top: 6px;
	width: 16px;
	height: 16px;
	background: var(--bg);
	border: 3px solid var(--accent);
	border-radius: 50%;
	z-index: 1;
	transition: transform var(--tr-base);
}
.timeline > li:hover::before {
	transform: scale(1.25);
	background: var(--accent);
}
.timeline > li.is-current::before {
	background: var(--accent);
	box-shadow: 0 0 0 4px rgba(255, 91, 46, 0.2);
	animation: dot-pulse 2.5s ease-in-out infinite;
}
@keyframes dot-pulse {
	0%, 100% { box-shadow: 0 0 0 4px rgba(255, 91, 46, 0.2); }
	50% { box-shadow: 0 0 0 10px rgba(255, 91, 46, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.timeline > li.is-current::before { animation: none; }
}

.timeline .tl-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--sp-2) var(--sp-3);
	margin-bottom: var(--sp-2);
}
.timeline .tl-period {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--accent);
	letter-spacing: var(--ls-wide);
	font-weight: var(--fw-bold);
	text-transform: uppercase;
	background: var(--accent-soft);
	padding: 2px var(--sp-2);
	border-radius: var(--r-sm);
}
.timeline .tl-company {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	letter-spacing: var(--ls-wide);
}
.timeline .tl-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);
	letter-spacing: var(--ls-tight);
}
.timeline .tl-summary {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	margin: 0 0 var(--sp-2);
	line-height: 1.6;
}
.timeline .tl-meta {
	display: flex;
	gap: var(--sp-4);
	flex-wrap: wrap;
	margin-top: var(--sp-2);
	padding-top: var(--sp-2);
	border-top: 1px dashed var(--line);
}
.timeline .tl-metric {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text);
	font-weight: var(--fw-medium);
}
.timeline .tl-metric strong {
	color: var(--accent);
	font-family: var(--font-display);
	font-size: var(--fs-sm);
	font-weight: var(--fw-bold);
	margin-right: 4px;
}

/* ============== SKILL BARS ============== */
.skill-bars {
	display: grid;
	gap: var(--sp-3);
}
.skill-bar {
	display: grid;
	gap: var(--sp-1);
}
.skill-bar-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.skill-bar-name {
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	color: var(--text);
	font-weight: var(--fw-medium);
}
.skill-bar-level {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--accent);
	letter-spacing: var(--ls-wide);
	font-weight: var(--fw-bold);
}
.skill-bar-track {
	height: 6px;
	background: var(--bg-soft);
	border-radius: var(--r-pill);
	overflow: hidden;
	position: relative;
	border: 1px solid var(--line);
}
.skill-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
	border-radius: var(--r-pill);
	width: 0;
	transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}
.skill-bar-fill::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
	animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
	.skill-bar-fill::after { animation: none; }
}
body.dark-mode .skill-bar-track { background: var(--bg-soft); border-color: var(--line); }

/* ============== FLOATING LABELS (Form) ============== */
.float-field {
	position: relative;
	margin-bottom: var(--sp-5);
}
.float-field .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: 22px var(--sp-4) 8px;
	height: auto;
	width: 100%;
	transition: all var(--tr-fast);
}
.float-field textarea.form-control {
	min-height: 160px;
	padding-top: 28px;
}
.float-field .form-label {
	position: absolute;
	left: var(--sp-4);
	top: 18px;
	font-family: var(--font-body);
	font-size: var(--fs-base);
	color: var(--text-faint);
	pointer-events: none;
	transition: all var(--tr-fast);
	letter-spacing: 0;
	text-transform: none;
	font-weight: var(--fw-regular);
}
.float-field .form-control:focus,
.float-field .form-control:not(:placeholder-shown) {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(255, 91, 46, 0.12);
	outline: 0;
}
.float-field .form-control:focus + .form-label,
.float-field .form-control:not(:placeholder-shown) + .form-label {
	top: 4px;
	font-size: 0.7rem;
	color: var(--accent);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	font-family: var(--font-mono);
}
.float-field .float-hint {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-faint);
	margin-top: var(--sp-1);
	display: none;
}
.float-field.is-valid .form-control { border-color: var(--success); }
.float-field.is-valid .float-hint { color: var(--success); display: block; }
.float-field.is-invalid .form-control { border-color: var(--danger); }
.float-field.is-invalid .float-hint { color: var(--danger); display: block; }

body.dark-mode .float-field .form-control {
	background: var(--bg-soft);
	border-color: var(--line-strong);
	color: var(--text);
}

/* ============== FORM BUTTON STATE ============== */
.submit-btn {
	position: relative;
	overflow: hidden;
}
.submit-btn .btn-content {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	transition: transform var(--tr-base);
}
.submit-btn .btn-loader {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: none;
}
.submit-btn.is-loading .btn-content { transform: translateY(40px); opacity: 0; }
.submit-btn.is-loading .btn-loader { display: inline-flex; }
.submit-btn.is-success { background: var(--success) !important; border-color: var(--success) !important; }
.submit-btn.is-success .btn-content { transform: translateY(0); opacity: 1; }

/* ============== STACK TICKER ============== */
.ticker {
	overflow: hidden;
	background: var(--code-bg);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	padding: var(--sp-4) 0;
	position: relative;
	mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.ticker-track {
	display: flex;
	gap: var(--sp-7);
	animation: ticker 40s linear infinite;
	width: max-content;
}
@keyframes ticker {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
	.ticker-track { animation: none; }
}
.ticker-item {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	color: rgba(230, 232, 236, 0.7);
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	letter-spacing: var(--ls-wide);
	white-space: nowrap;
}
.ticker-item i { color: var(--accent); font-size: 1.2em; }

/* ============== TESTIMONIALS ============== */
.testimonial {
	background: var(--bg-elev);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: var(--sp-6);
	position: relative;
	margin: var(--sp-3);
}
.testimonial::before {
	content: '\201C';
	position: absolute;
	left: var(--sp-4);
	top: -8px;
	font-family: var(--font-display);
	font-size: 5rem;
	color: var(--accent);
	opacity: 0.18;
	line-height: 1;
}
.testimonial blockquote {
	font-size: var(--fs-md);
	color: var(--text);
	line-height: 1.6;
	margin: 0 0 var(--sp-4);
	font-style: italic;
}
.testimonial-author {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	padding-top: var(--sp-3);
	border-top: 1px solid var(--line);
}
.testimonial-author .avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	font-size: var(--fs-md);
}
.testimonial-author .name {
	font-family: var(--font-display);
	font-weight: var(--fw-bold);
	color: var(--text);
	margin: 0;
	font-size: var(--fs-sm);
}
.testimonial-author .role {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	margin: 0;
}

.owl-theme .owl-dots .owl-dot span {
	background: var(--line-strong) !important;
}
.owl-theme .owl-dots .owl-dot.active span,
.owl-theme .owl-dots .owl-dot:hover span {
	background: var(--accent) !important;
}
.owl-theme .owl-nav.disabled + .owl-dots { margin-top: var(--sp-4); }

/* ============== CURRENTLY ============== */
.currently {
	background: var(--code-bg);
	color: var(--code-text);
	border-radius: var(--r-md);
	padding: var(--sp-5);
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	line-height: 1.8;
	border-left: 4px solid var(--accent);
}
.currently .now-label {
	color: var(--accent);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	font-size: var(--fs-xs);
	margin-bottom: var(--sp-2);
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
}
.currently .now-label::before {
	content: '';
	width: 8px;
	height: 8px;
	background: var(--accent);
	border-radius: 50%;
	animation: pulse 2s ease-in-out infinite;
}
.currently .now-line {
	color: rgba(230, 232, 236, 0.85);
	margin: 0;
}
.currently .now-line .key { color: var(--text-faint); }
.currently .now-line .val { color: #fff; }
.currently .now-line .val-accent { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
	.currently .now-label::before { animation: none; }
}

/* ============== 404 TERMINAL SVG ============== */
.terminal-svg {
	width: 100%;
	max-width: 480px;
	margin: 0 auto var(--sp-5);
	display: block;
}
.terminal-svg .term-bg { fill: var(--code-bg); }
.terminal-svg .term-header { fill: var(--bg-soft); }
.terminal-svg .term-dot-red { fill: #FF5F57; }
.terminal-svg .term-dot-yellow { fill: #FEBC2E; }
.terminal-svg .term-dot-green { fill: #28C840; }
.terminal-svg .term-text { fill: #E6E8EC; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.terminal-svg .term-prompt { fill: var(--accent); }
.terminal-svg .term-error { fill: #FF7A4D; }
.terminal-svg .term-cursor { fill: var(--accent); }
.terminal-svg .term-cursor-blink {
	animation: cursor-blink 1.1s steps(1) infinite;
}
@keyframes cursor-blink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.terminal-svg .term-cursor-blink { animation: none; opacity: 0.6; }
}

/* ============== QUICK FACTS (CV) ============== */
.quick-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--sp-3);
	margin: var(--sp-5) 0;
}
.quick-facts .qf {
	background: var(--bg-soft);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: var(--sp-3) var(--sp-4);
}
.quick-facts .qf-label {
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: var(--ls-wider);
	margin-bottom: var(--sp-1);
}
.quick-facts .qf-value {
	font-family: var(--font-display);
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	color: var(--accent);
}

/* ============== DIVIDER ============== */
.divider {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	color: var(--text-faint);
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	letter-spacing: var(--ls-wider);
	margin: var(--sp-7) 0;
}
.divider::before, .divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--line);
}
